Search in sources :

Example 1 with BitmapExtractor

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));
}
Also used : BitmapExtractor(org.neo4j.kernel.api.impl.labelscan.bitmaps.BitmapExtractor) LongPageIterator(org.neo4j.kernel.api.impl.labelscan.bitmaps.LongPageIterator) ValuesIterator(org.neo4j.kernel.api.impl.index.collector.ValuesIterator)

Aggregations

ValuesIterator (org.neo4j.kernel.api.impl.index.collector.ValuesIterator)1 BitmapExtractor (org.neo4j.kernel.api.impl.labelscan.bitmaps.BitmapExtractor)1 LongPageIterator (org.neo4j.kernel.api.impl.labelscan.bitmaps.LongPageIterator)1