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