public abstract class SimpleLongAggregatorFactory extends NullableNumericAggregatorFactory<ColumnValueSelector>
AggregatorFactory implementations that consume long input
and produce long output on aggregation.
It extends "NullableAggregatorFactory| Modifier and Type | Field and Description |
|---|---|
protected String |
expression |
protected com.google.common.base.Supplier<Expr> |
fieldExpression |
protected String |
fieldName |
protected ExprMacroTable |
macroTable |
protected String |
name |
| Constructor and Description |
|---|
SimpleLongAggregatorFactory(ExprMacroTable macroTable,
String name,
String fieldName,
String expression) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Aggregator |
buildAggregator(BaseLongColumnValueSelector selector) |
protected abstract BufferAggregator |
buildBufferAggregator(BaseLongColumnValueSelector selector) |
boolean |
canVectorize(ColumnInspector columnInspector)
Returns whether or not this aggregation class supports vectorization.
|
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.
|
boolean |
equals(Object o) |
protected Aggregator |
factorize(ColumnSelectorFactory metricFactory,
ColumnValueSelector selector)
Creates an
Aggregator to aggregate values from several rows, by using the provided selector. |
protected BufferAggregator |
factorizeBuffered(ColumnSelectorFactory metricFactory,
ColumnValueSelector selector)
Creates an
BufferAggregator to aggregate values from several rows into a ByteBuffer. |
Object |
finalizeComputation(Object object)
"Finalizes" the computation of an object.
|
Comparator |
getComparator() |
String |
getExpression() |
String |
getFieldName() |
ColumnType |
getIntermediateType()
Get the "intermediate"
ColumnType for this aggregator. |
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 combine the output of aggregators from this factory and
another factory.
|
String |
getName() |
int |
hashCode() |
protected abstract long |
nullValue() |
List<String> |
requiredFields()
Get a list of fields that aggregators built by this factory will need to read.
|
protected ColumnValueSelector |
selector(ColumnSelectorFactory metricFactory)
Creates a
ColumnValueSelector for the aggregated column. |
protected VectorValueSelector |
vectorSelector(VectorColumnSelectorFactory columnSelectorFactory)
Creates a
VectorValueSelector for the aggregated column. |
factorize, factorizeBuffered, factorizeVector, factorizeVector, getMaxIntermediateSizeWithNulls, getResultType, makeNullableAggregateCombinercombine, factorizeWithSize, getCombiningFactory, getComplexTypeName, getFinalizedType, getRequiredColumns, getType, guessAggregatorHeapFootprint, makeAggregateCombiner, mergeAggregators, optimizeForSegment, withNameclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetCacheKeyprotected final String name
protected final ExprMacroTable macroTable
protected final com.google.common.base.Supplier<Expr> fieldExpression
protected Aggregator factorize(ColumnSelectorFactory metricFactory, ColumnValueSelector selector)
NullableNumericAggregatorFactoryAggregator to aggregate values from several rows, by using the provided selector.factorize in class NullableNumericAggregatorFactory<ColumnValueSelector>metricFactory - metricFactoryselector - ColumnValueSelector for the column to aggregate.Aggregatorprotected BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory, ColumnValueSelector selector)
NullableNumericAggregatorFactoryBufferAggregator to aggregate values from several rows into a ByteBuffer.factorizeBuffered in class NullableNumericAggregatorFactory<ColumnValueSelector>metricFactory - columnSelectorFactory in case any other columns are needed.selector - ColumnValueSelector for the column to aggregate.BufferAggregatorprotected ColumnValueSelector selector(ColumnSelectorFactory metricFactory)
NullableNumericAggregatorFactoryColumnValueSelector for the aggregated column.selector in class NullableNumericAggregatorFactory<ColumnValueSelector>ColumnValueSelectorprotected VectorValueSelector vectorSelector(VectorColumnSelectorFactory columnSelectorFactory)
NullableNumericAggregatorFactoryVectorValueSelector for the aggregated column.vectorSelector in class NullableNumericAggregatorFactory<ColumnValueSelector>VectorValueSelectorpublic Object deserialize(Object object)
AggregatorFactorydeserialize in class AggregatorFactoryobject - the object to deserializepublic ColumnType getIntermediateType()
AggregatorFactoryColumnType for this aggregator. This is the same as the type returned by
AggregatorFactory.deserialize(java.lang.Object) and the type accepted by AggregatorFactory.combine(java.lang.Object, java.lang.Object). However, it is *not* necessarily the same type
returned by AggregatorFactory.finalizeComputation(java.lang.Object).
Refer to the ColumnType javadocs for details on the implications of choosing a type.getIntermediateType in class AggregatorFactorypublic int getMaxIntermediateSize()
AggregatorFactorygetMaxIntermediateSize in class AggregatorFactorypublic Comparator getComparator()
getComparator in class AggregatorFactory@Nullable public Object finalizeComputation(@Nullable Object object)
AggregatorFactoryfinalizeComputation in class AggregatorFactoryobject - the object to be finalizedpublic List<String> requiredFields()
AggregatorFactoryrequiredFields in class AggregatorFactorypublic AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException
AggregatorFactoryAggregatorFactoryNotMergeableException, meaning that "this" and "other" are not
compatible and values from one cannot sensibly be combined with values from the other.getMergingFactory in class AggregatorFactoryAggregatorFactoryNotMergeableExceptionwhich is equivalent to {@code foo.getMergingFactory(foo)} (when "this" and "other"
are the same instance).public String getName()
getName in class AggregatorFactorypublic boolean canVectorize(ColumnInspector columnInspector)
AggregatorFactorycanVectorize in class AggregatorFactoryprotected abstract long nullValue()
protected abstract Aggregator buildAggregator(BaseLongColumnValueSelector selector)
protected abstract BufferAggregator buildBufferAggregator(BaseLongColumnValueSelector selector)
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.