Class AssignRangeIndex<IN>
java.lang.Object
org.apache.flink.api.common.functions.AbstractRichFunction
org.apache.flink.api.common.functions.RichMapPartitionFunction<IN,org.apache.flink.api.java.tuple.Tuple2<Integer,IN>>
org.apache.flink.runtime.operators.udf.AssignRangeIndex<IN>
- Type Parameters:
IN- The original data type.
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function,org.apache.flink.api.common.functions.MapPartitionFunction<IN,,org.apache.flink.api.java.tuple.Tuple2<Integer, IN>> org.apache.flink.api.common.functions.RichFunction
public class AssignRangeIndex<IN>
extends org.apache.flink.api.common.functions.RichMapPartitionFunction<IN,org.apache.flink.api.java.tuple.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:
-
Constructor Summary
ConstructorsConstructorDescriptionAssignRangeIndex(org.apache.flink.api.common.typeutils.TypeComparatorFactory<IN> typeComparator) -
Method Summary
Modifier and TypeMethodDescriptionvoidmapPartition(Iterable<IN> values, org.apache.flink.util.Collector<org.apache.flink.api.java.tuple.Tuple2<Integer, IN>> out) Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
-
Constructor Details
-
AssignRangeIndex
public AssignRangeIndex(org.apache.flink.api.common.typeutils.TypeComparatorFactory<IN> typeComparator)
-
-
Method Details
-
mapPartition
public void mapPartition(Iterable<IN> values, org.apache.flink.util.Collector<org.apache.flink.api.java.tuple.Tuple2<Integer, IN>> out) throws Exception- Specified by:
mapPartitionin interfaceorg.apache.flink.api.common.functions.MapPartitionFunction<IN,org.apache.flink.api.java.tuple.Tuple2<Integer, IN>> - Specified by:
mapPartitionin classorg.apache.flink.api.common.functions.RichMapPartitionFunction<IN,org.apache.flink.api.java.tuple.Tuple2<Integer, IN>> - Throws:
Exception
-