Class ConciseBitmapFactory
- java.lang.Object
-
- org.apache.druid.collections.bitmap.ConciseBitmapFactory
-
- All Implemented Interfaces:
BitmapFactory
public class ConciseBitmapFactory extends Object implements BitmapFactory
As the name suggests, this class instantiates bitmaps of the types WrappedConciseBitmap and WrappedImmutableConciseBitmap.
-
-
Constructor Summary
Constructors Constructor Description ConciseBitmapFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableBitmapcomplement(ImmutableBitmap b, int length)ImmutableBitmapintersection(Iterable<ImmutableBitmap> b)Compute the intersection (bitwise-AND) of a set of bitmaps.ImmutableBitmapmakeEmptyImmutableBitmap()MutableBitmapmakeEmptyMutableBitmap()Create a new empty bitmapImmutableBitmapmakeImmutableBitmap(MutableBitmap mutableBitmap)ImmutableBitmapmapImmutableBitmap(ByteBuffer b)Given a ByteBuffer pointing at a serialized version of a bitmap, instantiate an immutable mapped bitmap.ImmutableBitmapunion(Iterable<ImmutableBitmap> b)Compute the union (bitwise-OR) of a set of bitmaps.
-
-
-
Method Detail
-
makeEmptyMutableBitmap
public MutableBitmap makeEmptyMutableBitmap()
Description copied from interface:BitmapFactoryCreate a new empty bitmap- Specified by:
makeEmptyMutableBitmapin interfaceBitmapFactory- Returns:
- the new bitmap
-
makeEmptyImmutableBitmap
public ImmutableBitmap makeEmptyImmutableBitmap()
- Specified by:
makeEmptyImmutableBitmapin interfaceBitmapFactory
-
makeImmutableBitmap
public ImmutableBitmap makeImmutableBitmap(MutableBitmap mutableBitmap)
- Specified by:
makeImmutableBitmapin interfaceBitmapFactory
-
mapImmutableBitmap
public ImmutableBitmap mapImmutableBitmap(ByteBuffer b)
Description copied from interface:BitmapFactoryGiven 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:
mapImmutableBitmapin interfaceBitmapFactory- Parameters:
b- the input byte buffer- Returns:
- the new bitmap
-
union
public ImmutableBitmap union(Iterable<ImmutableBitmap> b) throws ClassCastException
Description copied from interface:BitmapFactoryCompute 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:
unionin interfaceBitmapFactory- Parameters:
b- input ImmutableGenericBitmap objects- Returns:
- the union.
- Throws:
ClassCastException- if one of the ImmutableGenericBitmap objects if not an instance of WrappedImmutableConciseBitmap
-
intersection
public ImmutableBitmap intersection(Iterable<ImmutableBitmap> b) throws ClassCastException
Description copied from interface:BitmapFactoryCompute the intersection (bitwise-AND) of a set of bitmaps. They are assumed to be instances of the proper WrappedConciseBitmap otherwise a ClassCastException is thrown.- Specified by:
intersectionin interfaceBitmapFactory- Parameters:
b- input ImmutableGenericBitmap objects- Returns:
- the union.
- Throws:
ClassCastException- if one of the ImmutableGenericBitmap objects if not an instance of WrappedImmutableConciseBitmap
-
complement
public ImmutableBitmap complement(ImmutableBitmap b, int length)
- Specified by:
complementin interfaceBitmapFactory
-
-