Class RichReduceFunction<T>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.api.common.functions.RichReduceFunction<T>
-
- Type Parameters:
T- Type of the elements that this function processes.
- All Implemented Interfaces:
Serializable,Function,ReduceFunction<T>,RichFunction
@Public public abstract class RichReduceFunction<T> extends AbstractRichFunction implements ReduceFunction<T>
Rich variant of theReduceFunction. As aRichFunction, it gives access to theRuntimeContextand provides setup and teardown methods:RichFunction.open(org.apache.flink.configuration.Configuration)andRichFunction.close().- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RichReduceFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Treduce(T value1, T value2)The core method of ReduceFunction, combining two values into one value of the same type.-
Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
-
-
-
-
Method Detail
-
reduce
public abstract T reduce(T value1, T value2) throws Exception
Description copied from interface:ReduceFunctionThe 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.- Specified by:
reducein interfaceReduceFunction<T>- 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.
-
-