T
- the bitmap result (wrapper) typepublic interface BitmapResultFactory<T>
BitmapFactory
: it
has the same methods with the exception that it accepts generic type T (bitmap wrapper type) instead of ImmutableBitmap
.
DefaultBitmapResultFactory
is a no-op implementation, where "wrapper" type is ImmutableBitmap
itself.
BitmapResultFactory delegates actual operations on bitmaps to a BitmapFactory
, which it accepts in
constructor, called from QueryMetrics.makeBitmapResultFactory(BitmapFactory)
.
Emitting of query metric dimension(s) should be done from toImmutableBitmap(Object)
, the "unwrapping"
method, called only once to obtain the final preFilter bitmap.
Implementors expectations
-------------------------
BitmapResultFactory is a part of the QueryMetrics
subsystem, so this interface could be changed often, in
every Druid release (including "patch" releases). Users who create their custom implementations of
BitmapResultFactory should be ready to fix the code of their code to accommodate interface changes (e. g. implement
new methods) when they update Druid. See QueryMetrics
Javadoc for more info.Modifier and Type | Method and Description |
---|---|
T |
complement(T bitmapResult,
int numRows)
Delegates to
BitmapFactory.complement(ImmutableBitmap, int) on the wrapped bitmap, and returns a bitmap
result wrapping the resulting complement ImmutableBitmap. |
T |
intersection(Iterable<T> bitmapResults)
Delegates to
BitmapFactory.intersection(Iterable) on the wrapped bitmaps, and returns a bitmap result
wrapping the resulting intersection ImmutableBitmap. |
boolean |
isEmpty(T bitmapResult)
Checks that the wrapped bitmap is empty, see
ImmutableBitmap.isEmpty() . |
ImmutableBitmap |
toImmutableBitmap(T bitmapResult)
Unwraps bitmapResult back to ImmutableBitmap.
|
T |
union(Iterable<T> bitmapResults)
Delegates to
BitmapFactory.union(Iterable) on the wrapped bitmaps, and returns a bitmap result wrapping
the resulting union ImmutableBitmap. |
T |
unionDimensionValueBitmaps(Iterable<ImmutableBitmap> dimensionValueBitmaps)
Equivalent of intersection(Iterables.transform(dimensionValueBitmaps, factory::wrapDimensionValue)), but doesn't
create a lot of bitmap result objects.
|
T |
wrapAllFalse(ImmutableBitmap allFalseBitmap)
Wraps a bitmap which is a result of
BitmapFactory.makeEmptyImmutableBitmap() call. |
T |
wrapAllTrue(ImmutableBitmap allTrueBitmap)
Wraps a bitmap which is a result of
BitmapFactory.complement(ImmutableBitmap, int) called with
BitmapFactory.makeEmptyImmutableBitmap() as argument. |
T |
wrapDimensionValue(ImmutableBitmap bitmap)
Wraps a bitmap which designates rows in a segment with some specific dimension value.
|
T wrapDimensionValue(ImmutableBitmap bitmap)
T wrapAllFalse(ImmutableBitmap allFalseBitmap)
BitmapFactory.makeEmptyImmutableBitmap()
call.T wrapAllTrue(ImmutableBitmap allTrueBitmap)
BitmapFactory.complement(ImmutableBitmap, int)
called with
BitmapFactory.makeEmptyImmutableBitmap()
as argument.boolean isEmpty(T bitmapResult)
ImmutableBitmap.isEmpty()
.T intersection(Iterable<T> bitmapResults)
BitmapFactory.intersection(Iterable)
on the wrapped bitmaps, and returns a bitmap result
wrapping the resulting intersection ImmutableBitmap.T union(Iterable<T> bitmapResults)
BitmapFactory.union(Iterable)
on the wrapped bitmaps, and returns a bitmap result wrapping
the resulting union ImmutableBitmap.T unionDimensionValueBitmaps(Iterable<ImmutableBitmap> dimensionValueBitmaps)
T complement(T bitmapResult, int numRows)
BitmapFactory.complement(ImmutableBitmap, int)
on the wrapped bitmap, and returns a bitmap
result wrapping the resulting complement ImmutableBitmap.ImmutableBitmap toImmutableBitmap(T bitmapResult)
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.