Class ComparableAggregator<T>
- java.lang.Object
-
- org.apache.flink.streaming.api.functions.aggregation.AggregationFunction<T>
-
- org.apache.flink.streaming.api.functions.aggregation.ComparableAggregator<T>
-
- All Implemented Interfaces:
Serializable
,Function
,ReduceFunction<T>
@Internal public class ComparableAggregator<T> extends AggregationFunction<T>
AnAggregationFunction
that computes values based on comparisons ofComparables
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.streaming.api.functions.aggregation.AggregationFunction
AggregationFunction.AggregationType
-
-
Constructor Summary
Constructors Constructor Description ComparableAggregator(int positionToAggregate, TypeInformation<T> typeInfo, AggregationFunction.AggregationType aggregationType, boolean first, ExecutionConfig config)
ComparableAggregator(int positionToAggregate, TypeInformation<T> typeInfo, AggregationFunction.AggregationType aggregationType, ExecutionConfig config)
ComparableAggregator(String field, TypeInformation<T> typeInfo, AggregationFunction.AggregationType aggregationType, boolean first, ExecutionConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
reduce(T value1, T value2)
The core method of ReduceFunction, combining two values into one value of the same type.
-
-
-
Constructor Detail
-
ComparableAggregator
public ComparableAggregator(int positionToAggregate, TypeInformation<T> typeInfo, AggregationFunction.AggregationType aggregationType, ExecutionConfig config)
-
ComparableAggregator
public ComparableAggregator(int positionToAggregate, TypeInformation<T> typeInfo, AggregationFunction.AggregationType aggregationType, boolean first, ExecutionConfig config)
-
ComparableAggregator
public ComparableAggregator(String field, TypeInformation<T> typeInfo, AggregationFunction.AggregationType aggregationType, boolean first, ExecutionConfig config)
-
-
Method Detail
-
reduce
public T reduce(T value1, T value2) throws Exception
Description copied from interface:ReduceFunction
The core method of ReduceFunction, combining two values into one value of the same type. The reduce function is consecutively applied to all values of a group until only a single value remains.- Parameters:
value1
- The first value to combine.value2
- The second value to combine.- Returns:
- The combined value of both input values.
- Throws:
Exception
- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
-