Class AssignRangeIndex<IN>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.api.common.functions.RichMapPartitionFunction<IN,Tuple2<Integer,IN>>
-
- org.apache.flink.runtime.operators.udf.AssignRangeIndex<IN>
-
- Type Parameters:
IN
- The original data type.
- All Implemented Interfaces:
Serializable
,Function
,MapPartitionFunction<IN,Tuple2<Integer,IN>>
,RichFunction
public class AssignRangeIndex<IN> extends RichMapPartitionFunction<IN,Tuple2<Integer,IN>>
This mapPartition function require a DataSet with RangeBoundaries as broadcast input, it generate Tuple2 which includes range index and record itself as output.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AssignRangeIndex(TypeComparatorFactory<IN> typeComparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mapPartition(Iterable<IN> values, Collector<Tuple2<Integer,IN>> out)
A user-implemented function that modifies or transforms an incoming object.-
Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
-
-
-
-
Constructor Detail
-
AssignRangeIndex
public AssignRangeIndex(TypeComparatorFactory<IN> typeComparator)
-
-
Method Detail
-
mapPartition
public void mapPartition(Iterable<IN> values, Collector<Tuple2<Integer,IN>> out) throws Exception
Description copied from interface:MapPartitionFunction
A user-implemented function that modifies or transforms an incoming object.- Specified by:
mapPartition
in interfaceMapPartitionFunction<IN,Tuple2<Integer,IN>>
- Specified by:
mapPartition
in classRichMapPartitionFunction<IN,Tuple2<Integer,IN>>
- Parameters:
values
- All records for the mapperout
- The collector to hand results to.- Throws:
Exception
- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
-