Package org.apache.druid.query
Class DefaultBitmapResultFactory
- java.lang.Object
-
- org.apache.druid.query.DefaultBitmapResultFactory
-
- All Implemented Interfaces:
BitmapResultFactory<ImmutableBitmap>
public final class DefaultBitmapResultFactory extends Object implements BitmapResultFactory<ImmutableBitmap>
-
-
Constructor Summary
Constructors Constructor Description DefaultBitmapResultFactory(BitmapFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableBitmapcomplement(ImmutableBitmap bitmapResult, int numRows)Delegates toBitmapFactory.complement(ImmutableBitmap, int)on the wrapped bitmap, and returns a bitmap result wrapping the resulting complement ImmutableBitmap.ImmutableBitmapintersection(Iterable<ImmutableBitmap> bitmapResults)Delegates toBitmapFactory.intersection(Iterable)on the wrapped bitmaps, and returns a bitmap result wrapping the resulting intersection ImmutableBitmap.booleanisEmpty(ImmutableBitmap bitmapResult)Checks that the wrapped bitmap is empty, seeImmutableBitmap.isEmpty().ImmutableBitmaptoImmutableBitmap(ImmutableBitmap bitmapResult)Unwraps bitmapResult back to ImmutableBitmap.ImmutableBitmapunion(Iterable<ImmutableBitmap> bitmapResults)Delegates toBitmapFactory.union(Iterable)on the wrapped bitmaps, and returns a bitmap result wrapping the resulting union ImmutableBitmap.ImmutableBitmapunionDimensionValueBitmaps(Iterable<ImmutableBitmap> dimensionValueBitmaps)Equivalent of intersection(Iterables.transform(dimensionValueBitmaps, factory::wrapDimensionValue)), but doesn't create a lot of bitmap result objects.ImmutableBitmapwrapAllFalse(ImmutableBitmap allFalseBitmap)Wraps a bitmap which is a result ofBitmapFactory.makeEmptyImmutableBitmap()call.ImmutableBitmapwrapAllTrue(ImmutableBitmap allTrueBitmap)Wraps a bitmap which is a result ofBitmapFactory.complement(ImmutableBitmap, int)called withBitmapFactory.makeEmptyImmutableBitmap()as argument.ImmutableBitmapwrapDimensionValue(ImmutableBitmap bitmap)Wraps a bitmap which designates rows in a segment with some specific dimension value.
-
-
-
Constructor Detail
-
DefaultBitmapResultFactory
public DefaultBitmapResultFactory(BitmapFactory factory)
-
-
Method Detail
-
wrapDimensionValue
public ImmutableBitmap wrapDimensionValue(ImmutableBitmap bitmap)
Description copied from interface:BitmapResultFactoryWraps a bitmap which designates rows in a segment with some specific dimension value.- Specified by:
wrapDimensionValuein interfaceBitmapResultFactory<ImmutableBitmap>
-
wrapAllFalse
public ImmutableBitmap wrapAllFalse(ImmutableBitmap allFalseBitmap)
Description copied from interface:BitmapResultFactoryWraps a bitmap which is a result ofBitmapFactory.makeEmptyImmutableBitmap()call.- Specified by:
wrapAllFalsein interfaceBitmapResultFactory<ImmutableBitmap>
-
wrapAllTrue
public ImmutableBitmap wrapAllTrue(ImmutableBitmap allTrueBitmap)
Description copied from interface:BitmapResultFactoryWraps a bitmap which is a result ofBitmapFactory.complement(ImmutableBitmap, int)called withBitmapFactory.makeEmptyImmutableBitmap()as argument.- Specified by:
wrapAllTruein interfaceBitmapResultFactory<ImmutableBitmap>
-
isEmpty
public boolean isEmpty(ImmutableBitmap bitmapResult)
Description copied from interface:BitmapResultFactoryChecks that the wrapped bitmap is empty, seeImmutableBitmap.isEmpty().- Specified by:
isEmptyin interfaceBitmapResultFactory<ImmutableBitmap>
-
intersection
public ImmutableBitmap intersection(Iterable<ImmutableBitmap> bitmapResults)
Description copied from interface:BitmapResultFactoryDelegates toBitmapFactory.intersection(Iterable)on the wrapped bitmaps, and returns a bitmap result wrapping the resulting intersection ImmutableBitmap.- Specified by:
intersectionin interfaceBitmapResultFactory<ImmutableBitmap>
-
union
public ImmutableBitmap union(Iterable<ImmutableBitmap> bitmapResults)
Description copied from interface:BitmapResultFactoryDelegates toBitmapFactory.union(Iterable)on the wrapped bitmaps, and returns a bitmap result wrapping the resulting union ImmutableBitmap.- Specified by:
unionin interfaceBitmapResultFactory<ImmutableBitmap>
-
unionDimensionValueBitmaps
public ImmutableBitmap unionDimensionValueBitmaps(Iterable<ImmutableBitmap> dimensionValueBitmaps)
Description copied from interface:BitmapResultFactoryEquivalent of intersection(Iterables.transform(dimensionValueBitmaps, factory::wrapDimensionValue)), but doesn't create a lot of bitmap result objects.- Specified by:
unionDimensionValueBitmapsin interfaceBitmapResultFactory<ImmutableBitmap>
-
complement
public ImmutableBitmap complement(ImmutableBitmap bitmapResult, int numRows)
Description copied from interface:BitmapResultFactoryDelegates toBitmapFactory.complement(ImmutableBitmap, int)on the wrapped bitmap, and returns a bitmap result wrapping the resulting complement ImmutableBitmap.- Specified by:
complementin interfaceBitmapResultFactory<ImmutableBitmap>
-
toImmutableBitmap
public ImmutableBitmap toImmutableBitmap(ImmutableBitmap bitmapResult)
Description copied from interface:BitmapResultFactoryUnwraps bitmapResult back to ImmutableBitmap. BitmapResultFactory should emit query metric dimension(s) in the implementation of this method.- Specified by:
toImmutableBitmapin interfaceBitmapResultFactory<ImmutableBitmap>
-
-