public abstract class AggregatorFactory extends Object implements Cacheable
CardinalityAggregatorFactory
).Constructor and Description |
---|
AggregatorFactory() |
Modifier and Type | Method and Description |
---|---|
abstract Object |
combine(Object lhs,
Object rhs)
A method that knows how to combine the outputs of
Aggregator.get() produced via factorize(io.druid.segment.ColumnSelectorFactory) or BufferAggregator.get(java.nio.ByteBuffer, int) produced via factorizeBuffered(io.druid.segment.ColumnSelectorFactory) . |
abstract Object |
deserialize(Object object)
A method that knows how to "deserialize" the object from whatever form it might have been put into
in order to transfer via JSON.
|
abstract Aggregator |
factorize(ColumnSelectorFactory metricFactory) |
abstract BufferAggregator |
factorizeBuffered(ColumnSelectorFactory metricFactory) |
abstract Object |
finalizeComputation(Object object)
"Finalizes" the computation of an object.
|
abstract AggregatorFactory |
getCombiningFactory()
Returns an AggregatorFactory that can be used to combine the output of aggregators from this factory.
|
abstract Comparator |
getComparator() |
abstract int |
getMaxIntermediateSize()
Returns the maximum size that this aggregator will require in bytes for intermediate storage of results.
|
AggregatorFactory |
getMergingFactory(AggregatorFactory other)
Returns an AggregatorFactory that can be used to merge the output of aggregators from this factory and
other factory.
|
abstract String |
getName() |
abstract List<AggregatorFactory> |
getRequiredColumns()
Gets a list of all columns that this AggregatorFactory will scan
|
abstract String |
getTypeName() |
AggregateCombiner |
makeAggregateCombiner()
Creates an AggregateCombiner to fold rollup aggregation results from serveral "rows" of different indexes during
index merging.
|
static AggregatorFactory[] |
mergeAggregators(List<AggregatorFactory[]> aggregatorsList)
Merges the list of AggregatorFactory[] (presumable from metadata of some segments being merged) and
returns merged AggregatorFactory[] (for the metadata for merged segment).
|
abstract List<String> |
requiredFields() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCacheKey
public abstract Aggregator factorize(ColumnSelectorFactory metricFactory)
public abstract BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory)
public abstract Comparator getComparator()
public abstract Object combine(Object lhs, Object rhs)
Aggregator.get()
produced via factorize(io.druid.segment.ColumnSelectorFactory)
or BufferAggregator.get(java.nio.ByteBuffer, int)
produced via factorizeBuffered(io.druid.segment.ColumnSelectorFactory)
. Note, even though this method is called "combine",
this method's contract *does* allow for mutation of the input objects. Thus, any use of lhs or rhs after calling
this method is highly discouraged.lhs
- The left hand side of the combinerhs
- The right hand side of the combinepublic AggregateCombiner makeAggregateCombiner()
combine(java.lang.Object, java.lang.Object)
, with the difference that it uses
ColumnValueSelector
and it's subinterfaces to get inputs and implements ColumnValueSelector
to provide output.AggregateCombiner
,
IndexMerger
public abstract AggregatorFactory getCombiningFactory()
public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException
AggregatorFactoryNotMergeableException
public abstract List<AggregatorFactory> getRequiredColumns()
public abstract Object deserialize(Object object)
object
- the object to deserializepublic abstract Object finalizeComputation(Object object)
object
- the object to be finalizedpublic abstract String getName()
public abstract String getTypeName()
public abstract int getMaxIntermediateSize()
@Nullable public static AggregatorFactory[] mergeAggregators(List<AggregatorFactory[]> aggregatorsList)
aggregatorsList
- Copyright © 2011–2018. All rights reserved.