Class RoaringBitmapFactory
- java.lang.Object
-
- org.apache.druid.collections.bitmap.RoaringBitmapFactory
-
- All Implemented Interfaces:
BitmapFactory
public class RoaringBitmapFactory extends Object implements BitmapFactory
As the name suggests, this class instantiates bitmaps of the types WrappedRoaringBitmap and WrappedImmutableRoaringBitmap.
-
-
Field Summary
Fields Modifier and Type Field Description static RoaringBitmapFactory
INSTANCE
-
Constructor Summary
Constructors Constructor Description RoaringBitmapFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableBitmap
complement(ImmutableBitmap b, int length)
ImmutableBitmap
intersection(Iterable<ImmutableBitmap> b)
Compute the intersection (bitwise-AND) of a set of bitmaps.ImmutableBitmap
makeEmptyImmutableBitmap()
MutableBitmap
makeEmptyMutableBitmap()
Create a new empty bitmapImmutableBitmap
makeImmutableBitmap(MutableBitmap mutableBitmap)
ImmutableBitmap
mapImmutableBitmap(ByteBuffer b)
Given a ByteBuffer pointing at a serialized version of a bitmap, instantiate an immutable mapped bitmap.ImmutableBitmap
union(Iterable<ImmutableBitmap> b)
Compute the union (bitwise-OR) of a set of bitmaps.
-
-
-
Field Detail
-
INSTANCE
public static final RoaringBitmapFactory INSTANCE
-
-
Method Detail
-
makeEmptyMutableBitmap
public MutableBitmap makeEmptyMutableBitmap()
Description copied from interface:BitmapFactory
Create a new empty bitmap- Specified by:
makeEmptyMutableBitmap
in interfaceBitmapFactory
- Returns:
- the new bitmap
-
makeEmptyImmutableBitmap
public ImmutableBitmap makeEmptyImmutableBitmap()
- Specified by:
makeEmptyImmutableBitmap
in interfaceBitmapFactory
-
makeImmutableBitmap
public ImmutableBitmap makeImmutableBitmap(MutableBitmap mutableBitmap)
- Specified by:
makeImmutableBitmap
in interfaceBitmapFactory
-
mapImmutableBitmap
public ImmutableBitmap mapImmutableBitmap(ByteBuffer b)
Description copied from interface:BitmapFactory
Given a ByteBuffer pointing at a serialized version of a bitmap, instantiate an immutable mapped bitmap. When using RoaringBitmap (with the RoaringBitmapFactory class), it is not necessary for b.limit() to indicate the end of the serialized content whereas it is critical to set b.limit() appropriately with ConciseSet (with the ConciseBitmapFactory).- Specified by:
mapImmutableBitmap
in interfaceBitmapFactory
- Parameters:
b
- the input byte buffer- Returns:
- the new bitmap
-
union
public ImmutableBitmap union(Iterable<ImmutableBitmap> b)
Description copied from interface:BitmapFactory
Compute the union (bitwise-OR) of a set of bitmaps. They are assumed to be instances of of the proper WrappedConciseBitmap otherwise a ClassCastException is thrown.- Specified by:
union
in interfaceBitmapFactory
- Parameters:
b
- input ImmutableGenericBitmap objects- Returns:
- the union.
-
intersection
public ImmutableBitmap intersection(Iterable<ImmutableBitmap> b)
Description copied from interface:BitmapFactory
Compute the intersection (bitwise-AND) of a set of bitmaps. They are assumed to be instances of of the proper WrappedConciseBitmap otherwise a ClassCastException is thrown.- Specified by:
intersection
in interfaceBitmapFactory
- Parameters:
b
- input ImmutableGenericBitmap objects- Returns:
- the union.
-
complement
public ImmutableBitmap complement(ImmutableBitmap b, int length)
- Specified by:
complement
in interfaceBitmapFactory
-
-