Class ReduceOperatorBase<T,FT extends org.apache.flink.api.common.functions.ReduceFunction<T>>
- java.lang.Object
-
- org.apache.flink.api.common.operators.Operator<OUT>
-
- org.apache.flink.api.common.operators.AbstractUdfOperator<OUT,FT>
-
- org.apache.flink.api.common.operators.SingleInputOperator<T,T,FT>
-
- org.apache.flink.api.common.operators.base.ReduceOperatorBase<T,FT>
-
- Type Parameters:
T- The type (parameters and return type) of the reduce function.FT- The type of the reduce function.
@Internal public class ReduceOperatorBase<T,FT extends org.apache.flink.api.common.functions.ReduceFunction<T>> extends SingleInputOperator<T,T,FT>
Base data flow operator for Reduce user-defined functions. Accepts reduce functions and key positions. The key positions are expected in the flattened common data model.- See Also:
ReduceFunction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReduceOperatorBase.CombineHintAn enumeration of hints, optionally usable to tell the system exactly how to execute the combiner phase of a reduce.
-
Field Summary
-
Fields inherited from class org.apache.flink.api.common.operators.SingleInputOperator
input
-
Fields inherited from class org.apache.flink.api.common.operators.AbstractUdfOperator
broadcastInputs, userFunction
-
Fields inherited from class org.apache.flink.api.common.operators.Operator
compilerHints, name, operatorInfo, parameters
-
-
Constructor Summary
Constructors Constructor Description ReduceOperatorBase(FT udf, UnaryOperatorInformation<T,T> operatorInfo, int[] keyPositions, String name)Creates a grouped reduce data flow operator.ReduceOperatorBase(FT udf, UnaryOperatorInformation<T,T> operatorInfo, String name)Creates a non-grouped reduce data flow operator (all-reduce).ReduceOperatorBase(Class<? extends FT> udf, UnaryOperatorInformation<T,T> operatorInfo, int[] keyPositions, String name)Creates a grouped reduce data flow operator.ReduceOperatorBase(Class<? extends FT> udf, UnaryOperatorInformation<T,T> operatorInfo, String name)Creates a non-grouped reduce data flow operator (all-reduce).ReduceOperatorBase(UserCodeWrapper<FT> udf, UnaryOperatorInformation<T,T> operatorInfo, int[] keyPositions, String name)Creates a grouped reduce data flow operator.ReduceOperatorBase(UserCodeWrapper<FT> udf, UnaryOperatorInformation<T,T> operatorInfo, String name)Creates a non-grouped reduce data flow operator (all-reduce).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<T>executeOnCollections(List<T> inputData, RuntimeContext ctx, ExecutionConfig executionConfig)ReduceOperatorBase.CombineHintgetCombineHint()Partitioner<?>getCustomPartitioner()voidsetCombineHint(ReduceOperatorBase.CombineHint hint)voidsetCustomPartitioner(Partitioner<?> customPartitioner)-
Methods inherited from class org.apache.flink.api.common.operators.SingleInputOperator
accept, addInput, addInput, clearInputs, getInput, getKeyColumns, getNumberOfInputs, getOperatorInfo, getSemanticProperties, setInput, setInput, setInputs, setSemanticProperties
-
Methods inherited from class org.apache.flink.api.common.operators.AbstractUdfOperator
asArray, emptyClassArray, getBroadcastInputs, getUserCodeWrapper, setBroadcastVariable, setBroadcastVariables
-
Methods inherited from class org.apache.flink.api.common.operators.Operator
createUnionCascade, createUnionCascade, createUnionCascade, getCompilerHints, getMinResources, getName, getParallelism, getParameters, getPreferredResources, setName, setParallelism, setParameter, setParameter, setParameter, setResources, toString
-
-
-
-
Constructor Detail
-
ReduceOperatorBase
public ReduceOperatorBase(UserCodeWrapper<FT> udf, UnaryOperatorInformation<T,T> operatorInfo, int[] keyPositions, String name)
Creates a grouped reduce data flow operator.- Parameters:
udf- The user-defined function, contained in the UserCodeWrapper.operatorInfo- The type information, describing input and output types of the reduce function.keyPositions- The positions of the key fields, in the common data model (flattened).name- The name of the operator (for logging and messages).
-
ReduceOperatorBase
public ReduceOperatorBase(FT udf, UnaryOperatorInformation<T,T> operatorInfo, int[] keyPositions, String name)
Creates a grouped reduce data flow operator.- Parameters:
udf- The user-defined function, as a function object.operatorInfo- The type information, describing input and output types of the reduce function.keyPositions- The positions of the key fields, in the common data model (flattened).name- The name of the operator (for logging and messages).
-
ReduceOperatorBase
public ReduceOperatorBase(Class<? extends FT> udf, UnaryOperatorInformation<T,T> operatorInfo, int[] keyPositions, String name)
Creates a grouped reduce data flow operator.- Parameters:
udf- The class representing the parameterless user-defined function.operatorInfo- The type information, describing input and output types of the reduce function.keyPositions- The positions of the key fields, in the common data model (flattened).name- The name of the operator (for logging and messages).
-
ReduceOperatorBase
public ReduceOperatorBase(UserCodeWrapper<FT> udf, UnaryOperatorInformation<T,T> operatorInfo, String name)
Creates a non-grouped reduce data flow operator (all-reduce).- Parameters:
udf- The user-defined function, contained in the UserCodeWrapper.operatorInfo- The type information, describing input and output types of the reduce function.name- The name of the operator (for logging and messages).
-
ReduceOperatorBase
public ReduceOperatorBase(FT udf, UnaryOperatorInformation<T,T> operatorInfo, String name)
Creates a non-grouped reduce data flow operator (all-reduce).- Parameters:
udf- The user-defined function, as a function object.operatorInfo- The type information, describing input and output types of the reduce function.name- The name of the operator (for logging and messages).
-
ReduceOperatorBase
public ReduceOperatorBase(Class<? extends FT> udf, UnaryOperatorInformation<T,T> operatorInfo, String name)
Creates a non-grouped reduce data flow operator (all-reduce).- Parameters:
udf- The class representing the parameterless user-defined function.operatorInfo- The type information, describing input and output types of the reduce function.name- The name of the operator (for logging and messages).
-
-
Method Detail
-
setCustomPartitioner
public void setCustomPartitioner(Partitioner<?> customPartitioner)
-
getCustomPartitioner
public Partitioner<?> getCustomPartitioner()
-
executeOnCollections
protected List<T> executeOnCollections(List<T> inputData, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception
- Specified by:
executeOnCollectionsin classSingleInputOperator<T,T,FT extends org.apache.flink.api.common.functions.ReduceFunction<T>>- Throws:
Exception
-
setCombineHint
public void setCombineHint(ReduceOperatorBase.CombineHint hint)
-
getCombineHint
public ReduceOperatorBase.CombineHint getCombineHint()
-
-