public abstract class IntegralAvgAggFunction<T> extends AggregateFunction<T,IntegralAvgAccumulator>
Constructor and Description |
---|
IntegralAvgAggFunction() |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(IntegralAvgAccumulator acc,
Object value) |
IntegralAvgAccumulator |
createAccumulator()
Creates and init the Accumulator for this
AggregateFunction . |
TypeInformation<?> |
getAccumulatorType() |
T |
getValue(IntegralAvgAccumulator acc)
Called every time when an aggregation result should be materialized.
|
void |
merge(IntegralAvgAccumulator acc,
Iterable<IntegralAvgAccumulator> its) |
void |
resetAccumulator(IntegralAvgAccumulator acc) |
abstract T |
resultTypeConvert(long value)
Convert the intermediate result to the expected aggregation result type
|
void |
retract(IntegralAvgAccumulator acc,
Object value) |
requiresOver
close, functionIdentifier, open
public IntegralAvgAccumulator createAccumulator()
AggregateFunction
AggregateFunction
.
createAccumulator
in class AggregateFunction<T,IntegralAvgAccumulator>
public void accumulate(IntegralAvgAccumulator acc, Object value)
public void retract(IntegralAvgAccumulator acc, Object value)
public T getValue(IntegralAvgAccumulator acc)
AggregateFunction
getValue
in class AggregateFunction<T,IntegralAvgAccumulator>
acc
- the accumulator which contains the current
aggregated resultspublic void merge(IntegralAvgAccumulator acc, Iterable<IntegralAvgAccumulator> its)
public void resetAccumulator(IntegralAvgAccumulator acc)
public TypeInformation<?> getAccumulatorType()
public abstract T resultTypeConvert(long value)
value
- the intermediate result. We use a Long container to save
the intermediate result to avoid the overflow by sum operation.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.