use of io.druid.collections.bitmap.WrappedImmutableRoaringBitmap in project druid by druid-io.
the class BitmapOffset method getReverseBitmapOffsetIterator.
public static IntIterator getReverseBitmapOffsetIterator(ImmutableBitmap bitmapIndex) {
ImmutableBitmap roaringBitmap = bitmapIndex;
if (!(bitmapIndex instanceof WrappedImmutableRoaringBitmap)) {
final MutableBitmap bitmap = ROARING_BITMAP_FACTORY.makeEmptyMutableBitmap();
final IntIterator iterator = bitmapIndex.iterator();
while (iterator.hasNext()) {
bitmap.add(iterator.next());
}
roaringBitmap = ROARING_BITMAP_FACTORY.makeImmutableBitmap(bitmap);
}
return ((WrappedImmutableRoaringBitmap) roaringBitmap).getBitmap().getReverseIntIterator();
}
Aggregations