while (entries.hasNext()) { final ODocument document = entries.next().getRecord();
/** * {@inheritDoc} */ @Override public boolean hasNext() { if (source.isRebuilding()) throwRebuildException(); final boolean isNext = delegate.hasNext(); if (source.getRebuildVersion() != indexRebuildVersion) throwRebuildException(); return isNext; }
@Override public List<Object> edgeLookup(String edgeLabel, String indexPostfix, Object key) { OrientBaseGraph orientBaseGraph = unwrapCurrentGraph(); List<Object> ids = new ArrayList<>(); // Load the edge type in order to access the indices of the edge OrientEdgeType edgeType = orientBaseGraph.getEdgeType(edgeLabel); if (edgeType != null) { // Fetch the required index OIndex<?> index = edgeType.getClassIndex("e." + edgeLabel.toLowerCase() + "_" + indexPostfix); if (index != null) { // Iterate over the sb-tree index entries OIndexCursor cursor = index.iterateEntriesMajor(new OCompositeKey(key), true, false); while (cursor.hasNext()) { Entry<Object, OIdentifiable> entry = cursor.nextEntry(); if (entry != null) { OCompositeKey entryKey = (OCompositeKey) entry.getKey(); // The index returns all entries. We thus need to filter it manually if (entryKey.getKeys().get(1).equals(key)) { Object inId = entryKey.getKeys().get(0); // Only add the inbound vertex id to the list of ids ids.add(inId); } } else { break; } } } } return ids; }
count = ((OSizeable) cursor).size(); else { while (cursor.hasNext()) { cursor.next(); count++;