Skip to content

Commit

Permalink
Code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusmelke committed Jan 8, 2018
1 parent 3a2a6d2 commit 056c977
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Expand Up @@ -47,16 +47,18 @@ class LabelScanValueIndexProgressor extends LabelScanValueIndexAccessor implemen
} }


/** /**
* @return next node id in the current {@link LabelScanValue} or, if current value exhausted, * Progress through the index until the next accepted entry.
* goes to next {@link LabelScanValue} from {@link RawCursor}. Returns {@code true} if next node id *
* was found, otherwise {@code false}. * Progress the cursor to the current {@link LabelScanValue}, if this is not accepted by the client or if current
* value is exhausted it continues to the next {@link LabelScanValue} from {@link RawCursor}.
* @return <code>true</code> if an accepted entry was found, <code>false</code> otherwise
*/ */
@Override @Override
public boolean next() public boolean next()
{ {
while ( true ) for ( ; ; )
{ {
if ( bits != 0 ) while ( bits != 0 )
{ {
int delta = Long.numberOfTrailingZeros( bits ); int delta = Long.numberOfTrailingZeros( bits );
bits &= bits - 1; bits &= bits - 1;
Expand Down
Expand Up @@ -32,7 +32,6 @@
import org.neo4j.graphdb.index.Index; import org.neo4j.graphdb.index.Index;
import org.neo4j.index.internal.gbptree.GBPTree; import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.Hit; import org.neo4j.index.internal.gbptree.Hit;
import org.neo4j.kernel.impl.index.schema.NumberHitIndexProgressor;
import org.neo4j.storageengine.api.schema.IndexProgressor; import org.neo4j.storageengine.api.schema.IndexProgressor;
import org.neo4j.storageengine.api.schema.LabelScanReader; import org.neo4j.storageengine.api.schema.LabelScanReader;


Expand Down Expand Up @@ -110,7 +109,8 @@ public PrimitiveLongResourceIterator nodesWithAllLabels( int... labelIds )
return new CompositeLabelScanValueIterator( iterators, true ); return new CompositeLabelScanValueIterator( iterators, true );
} }


public LabelScanValueIndexProgressor nodesWithLabelIndex( IndexProgressor.NodeLabelClient client, @Override
public LabelScanValueIndexProgressor nodesWithLabel( IndexProgressor.NodeLabelClient client,
int labelId ) int labelId )
{ {
RawCursor<Hit<LabelScanKey,LabelScanValue>,IOException> cursor; RawCursor<Hit<LabelScanKey,LabelScanValue>,IOException> cursor;
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().nodesWithLabelIndex( indexCursor, label ) ); indexCursor.initialize( labelScanReader().nodesWithLabel( indexCursor, label ) );
} }


@Override @Override
Expand Down
Expand Up @@ -40,7 +40,7 @@ public interface LabelScanReader extends Resource
* @param labelId label token id * @param labelId label token id
* @return index progressor with the given {@code labelId} * @return index progressor with the given {@code labelId}
*/ */
IndexProgressor nodesWithLabelIndex( IndexProgressor.NodeLabelClient client, int labelId ); IndexProgressor nodesWithLabel( IndexProgressor.NodeLabelClient client, int labelId );


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

0 comments on commit 056c977

Please sign in to comment.