Search in sources :

Example 1 with FilteringNodeCursorWrapper

use of org.neo4j.kernel.impl.newapi.FilteringNodeCursorWrapper in project neo4j by neo4j.

the class TransactionImpl method allNodesByLabelWithoutIndex.

private ResourceIterator<Node> allNodesByLabelWithoutIndex(KernelTransaction ktx, int labelId) {
    NodeCursor cursor = ktx.cursors().allocateNodeCursor(ktx.cursorContext());
    ktx.dataRead().allNodesScan(cursor);
    var filetredCursor = new FilteringNodeCursorWrapper(cursor, CursorPredicates.hasLabel(labelId));
    return new CursorIterator<>(filetredCursor, NodeCursor::nodeReference, c -> newNodeEntity(c.nodeReference()), coreApiResourceTracker);
}
Also used : FilteringNodeCursorWrapper(org.neo4j.kernel.impl.newapi.FilteringNodeCursorWrapper) CursorIterator(org.neo4j.kernel.impl.coreapi.internal.CursorIterator) NodeCursor(org.neo4j.internal.kernel.api.NodeCursor)

Aggregations

NodeCursor (org.neo4j.internal.kernel.api.NodeCursor)1 CursorIterator (org.neo4j.kernel.impl.coreapi.internal.CursorIterator)1 FilteringNodeCursorWrapper (org.neo4j.kernel.impl.newapi.FilteringNodeCursorWrapper)1