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

    Constructors
    Constructor
    Description
    AssignRangeIndex(org.apache.flink.api.common.typeutils.TypeComparatorFactory<IN> typeComparator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    mapPartition(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      mapPartition in interface org.apache.flink.api.common.functions.MapPartitionFunction<IN,org.apache.flink.api.java.tuple.Tuple2<Integer,IN>>
      Specified by:
      mapPartition in class org.apache.flink.api.common.functions.RichMapPartitionFunction<IN,org.apache.flink.api.java.tuple.Tuple2<Integer,IN>>
      Throws:
      Exception