Class 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:
    Serialized Form
    • Constructor Detail

      • AssignRangeIndex

        public AssignRangeIndex​(org.apache.flink.api.common.typeutils.TypeComparatorFactory<IN> typeComparator)
    • Method Detail

      • 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