use of org.neo4j.kernel.api.impl.labelscan.bitmaps.BitmapExtractor in project neo4j by neo4j.
the class PageOfRangesIterator method fetchNextOrNull.
@Override
protected PrimitiveLongIterator fetchNextOrNull() {
if (searcher == null) {
// we are done searching with this iterator
return null;
}
ValuesIterator ranges = getRanges();
int pageSize = Math.min(ranges.remaining(), rangesPerPage);
long[] rangeMap = new long[pageSize * 2];
for (int i = 0; i < pageSize; i++) {
long range = ranges.next();
rangeMap[i * 2] = range;
rangeMap[i * 2 + 1] = labeledBitmap(ranges);
}
if (// not a full page => this is the last page (optimization)
pageSize < rangesPerPage) {
// avoid searching again
searcher = null;
}
return new LongPageIterator(new BitmapExtractor(format.bitmapFormat(), rangeMap));
}
Aggregations