Package org.openrdf.sail.nativerdf.btree

Examples of org.openrdf.sail.nativerdf.btree.RecordIterator


      long size = 0L;

      for (int contextID : contextIDs) {
        // Iterate over all explicit statements
        RecordIterator iter = nativeStore.getTripleStore().getTriples(subjID, predID, objID, contextID,
            !includeInferred, !isAutoCommit());

        try {
          while (iter.next() != null) {
            size++;
          }
        }
        finally {
          iter.close();
        }
      }

      return size;
    }
View Full Code Here


        List<Statement> removedStatements = Collections.emptyList();

        if (hasConnectionListeners()) {
          // We need to iterate over all matching triples so that they can
          // be reported
          RecordIterator btreeIter = tripleStore.getTriples(subjID, predID, objID, contextID, explicit,
              true);

          NativeStatementCursor iter = new NativeStatementCursor(btreeIter, valueStore);

          removedStatements = new ArrayList<Statement>();
View Full Code Here

  protected Cursor<Resource> getContextIDs(boolean readTransaction)
    throws IOException
  {
    Cursor<? extends Statement> stIter;
    Cursor<Resource> ctxIter;
    RecordIterator btreeIter;
    btreeIter = tripleStore.getAllTriplesSortedByContext(readTransaction);
    if (btreeIter == null) {
      // Iterator over all statements
      stIter = createStatementCursor(null, null, null, true, readTransaction);
    }
View Full Code Here

    ArrayList<NativeStatementCursor> perContextIterList = new ArrayList<NativeStatementCursor>(
        contextIDList.size());

    for (int contextID : contextIDList) {
      RecordIterator btreeIter;

      if (includeInferred) {
        // Get both explicit and inferred statements
        btreeIter = tripleStore.getTriples(subjID, predID, objID, contextID, readTransaction);
      }
View Full Code Here

          logger.debug("Initializing new index '" + fieldSeq + "'...");

          TripleIndex addedIndex = new TripleIndex(fieldSeq);
          BTree addedBTree = addedIndex.getBTree();

          RecordIterator sourceIter = sourceIndex.getBTree().iterateAll();
          try {
            byte[] value = null;
            while ((value = sourceIter.next()) != null) {
              addedBTree.insert(value);
            }
          }
          finally {
            sourceIter.close();
          }

          addedBTree.close();
        }
View Full Code Here

        flags |= TripleStore.EXPLICIT_FLAG;
        flagsMask |= TripleStore.EXPLICIT_FLAG;
      }
    }

    RecordIterator btreeIter = getTriples(subj, pred, obj, context, flags, flagsMask);

    if (readTransaction && explicit) {
      // Filter implicit statements from the result
      btreeIter = new ExplicitStatementFilter(btreeIter);
    }
View Full Code Here

  }

  public int removeTriples(int subj, int pred, int obj, int context)
    throws IOException
  {
    RecordIterator iter = getTriples(subj, pred, obj, context, 0, 0);
    return removeTriples(iter);
  }
View Full Code Here

   */
  public int removeTriples(int subj, int pred, int obj, int context, boolean explicit)
    throws IOException
  {
    byte flags = explicit ? EXPLICIT_FLAG : 0;
    RecordIterator iter = getTriples(subj, pred, obj, context, flags, EXPLICIT_FLAG);
    return removeTriples(iter);
  }
View Full Code Here

      updatedTriplesCache.storeRecords(removedTriplesCache);

      for (TripleIndex index : indexes) {
        BTree btree = index.getBTree();

        RecordIterator recIter = removedTriplesCache.getRecords();
        try {
          while ((data = recIter.next()) != null) {
            btree.insert(data);
          }
        }
        finally {
          recIter.close();
        }
      }
    }
    finally {
      removedTriplesCache.discard();
View Full Code Here

      iter.close();

      for (TripleIndex index : indexes) {
        BTree btree = index.getBTree();

        RecordIterator recIter = recordCache.getRecords();
        try {
          while ((data = recIter.next()) != null) {
            btree.remove(data);
          }
        }
        finally {
          recIter.close();
        }
      }
    }
    finally {
      recordCache.discard();
View Full Code Here

TOP

Related Classes of org.openrdf.sail.nativerdf.btree.RecordIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.