Skip to content

Commit

Permalink
Move initialization to LabelScanReader
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusmelke committed Jan 9, 2018
1 parent 056c977 commit 1af1b18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Expand Up @@ -110,8 +110,7 @@ public PrimitiveLongResourceIterator nodesWithAllLabels( int... labelIds )
} }


@Override @Override
public LabelScanValueIndexProgressor nodesWithLabel( IndexProgressor.NodeLabelClient client, public void nodesWithLabel( IndexProgressor.NodeLabelClient client, int labelId )
int labelId )
{ {
RawCursor<Hit<LabelScanKey,LabelScanValue>,IOException> cursor; RawCursor<Hit<LabelScanKey,LabelScanValue>,IOException> cursor;
try try
Expand All @@ -124,7 +123,7 @@ public LabelScanValueIndexProgressor nodesWithLabel( IndexProgressor.NodeLabelCl
throw new UncheckedIOException( e ); throw new UncheckedIOException( e );
} }


return new LabelScanValueIndexProgressor( cursor, openCursors, client ); client.initialize( new LabelScanValueIndexProgressor( cursor, openCursors, client ), false );
} }


private List<PrimitiveLongResourceIterator> iteratorsForLabels( int[] labelIds ) private List<PrimitiveLongResourceIterator> iteratorsForLabels( int[] labelIds )
Expand Down
Expand Up @@ -141,7 +141,7 @@ public final void nodeLabelScan( int label, org.neo4j.internal.kernel.api.NodeLa


NodeLabelIndexCursor indexCursor = (NodeLabelIndexCursor) cursor; NodeLabelIndexCursor indexCursor = (NodeLabelIndexCursor) cursor;
indexCursor.setRead( this ); indexCursor.setRead( this );
indexCursor.initialize( labelScanReader().nodesWithLabel( indexCursor, label ) ); labelScanReader().nodesWithLabel( indexCursor, label );
} }


@Override @Override
Expand Down
Expand Up @@ -34,13 +34,12 @@ public interface LabelScanReader extends Resource
PrimitiveLongResourceIterator nodesWithLabel( int labelId ); PrimitiveLongResourceIterator nodesWithLabel( int labelId );


/** /**
* Returns the index progressor over the label id * Sets the client up for a label scan on <code>labelId</code>
* *
* @param client the client to communicate with * @param client the client to communicate with
* @param labelId label token id * @param labelId label token id
* @return index progressor with the given {@code labelId}
*/ */
IndexProgressor nodesWithLabel( IndexProgressor.NodeLabelClient client, int labelId ); void nodesWithLabel( IndexProgressor.NodeLabelClient client, int labelId );


/** /**
* @param labelIds label token ids. * @param labelIds label token ids.
Expand Down

0 comments on commit 1af1b18

Please sign in to comment.