Class ValueSummaryAggregator<VT extends org.apache.flink.types.Value,PT,R,A extends Aggregator<PT,R>>
- java.lang.Object
-
- org.apache.flink.api.java.summarize.aggregation.ValueSummaryAggregator<VT,PT,R,A>
-
- Type Parameters:
VT- the "Value Type" to aggregate, e.g. DoubleValue, StringValuePT- the "Primitive Type" that "Value Type" can be naturally converted to, e.g. DoubleValue converts to DoubleR- the result type of the aggregation, e.g. NumericColumnSummary<Double>A- the underlying primitive Aggregator that does the actual work, e.g. DoubleSummaryAggregator
- All Implemented Interfaces:
Serializable,Aggregator<VT,R>
- Direct Known Subclasses:
ValueSummaryAggregator.BooleanValueSummaryAggregator,ValueSummaryAggregator.DoubleValueSummaryAggregator,ValueSummaryAggregator.FloatValueSummaryAggregator,ValueSummaryAggregator.IntegerValueSummaryAggregator,ValueSummaryAggregator.LongValueSummaryAggregator,ValueSummaryAggregator.ShortValueSummaryAggregator,ValueSummaryAggregator.StringValueSummaryAggregator
@Internal public abstract class ValueSummaryAggregator<VT extends org.apache.flink.types.Value,PT,R,A extends Aggregator<PT,R>> extends Object implements Aggregator<VT,R>
This is a generic Aggregator for Value types like StringValue, DoubleValue, etc. This class makes it easy to re-use the implementation of another aggregator.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValueSummaryAggregator.BooleanValueSummaryAggregatorAValueSummaryAggregatorforBoolean.static classValueSummaryAggregator.DoubleValueSummaryAggregatorAValueSummaryAggregatorforDouble.static classValueSummaryAggregator.FloatValueSummaryAggregatorAValueSummaryAggregatorforFloat.static classValueSummaryAggregator.IntegerValueSummaryAggregatorAValueSummaryAggregatorforInteger.static classValueSummaryAggregator.LongValueSummaryAggregatorAValueSummaryAggregatorforLong.static classValueSummaryAggregator.ShortValueSummaryAggregatorAValueSummaryAggregatorforShort.static classValueSummaryAggregator.StringValueSummaryAggregatorAValueSummaryAggregatorforString.
-
Constructor Summary
Constructors Constructor Description ValueSummaryAggregator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaggregate(VT value)Add a value to the current aggregation.voidcombine(Aggregator<VT,R> otherSameType)Combine two aggregations of the same type.protected abstract PTgetValue(VT value)Get the value out of a value type.protected abstract AinitPrimitiveAggregator()Initialize an aggregator that can be used for the underlying primitive in the Value type.Rresult()Provide the final result of the aggregation.
-
-
-
Method Detail
-
aggregate
public void aggregate(VT value)
Description copied from interface:AggregatorAdd a value to the current aggregation.- Specified by:
aggregatein interfaceAggregator<VT extends org.apache.flink.types.Value,PT>
-
combine
public void combine(Aggregator<VT,R> otherSameType)
Description copied from interface:AggregatorCombine two aggregations of the same type.(Implementations will need to do an unchecked cast).
- Specified by:
combinein interfaceAggregator<VT extends org.apache.flink.types.Value,PT>
-
result
public R result()
Description copied from interface:AggregatorProvide the final result of the aggregation.- Specified by:
resultin interfaceAggregator<VT extends org.apache.flink.types.Value,PT>
-
initPrimitiveAggregator
protected abstract A initPrimitiveAggregator()
Initialize an aggregator that can be used for the underlying primitive in the Value type.E.g. DoubleValues can easily be converted to Double and could use an underlying Aggregator<Double,?>
-
-