java.lang.Object
org.apache.flink.runtime.scheduler.adaptivebatch.util.SubpartitionSlice

public class SubpartitionSlice extends Object
Helper class that describes the statistics of all subpartitions with a specific index within the given partition range. It may represent a complete subpartition group or a part of the subpartition group, depending on the partition range.
  • Method Details

    • getDataBytes

      public long getDataBytes()
    • getSubpartitionRange

      public IndexRange getSubpartitionRange()
    • getPartitionRange

      public IndexRange getPartitionRange(int numPartitions)
      SubpartitionSlice is used to describe a group of inputs with the same type number which may have different numbers of partitions, so we need to use the specific partitions number to get the correct partition range.

      Example, given a specific typeNumber with 2 inputs, and partition counts of 3 and 2 respectively, if the current SubpartitionSlice's PartitionRange is [1,2], it may need adjustment for the second input. the adjustment ensures that the PartitionRange aligns with the expected partition count.
      -input 0: partition count = 3, valid PartitionRange = [0, 2]
      -input 1: partition count = 2, valid PartitionRange = [0, 1]
      If the SubpartitionSlice's PartitionRange is [1, 2], it should be corrected to [1, 1] for typeNumber 1 to match its partition count.

      Parameters:
      numPartitions - the number of partitions
      Returns:
      the partition range if the partition range is valid, empty otherwise
    • createSubpartitionSlice

      public static SubpartitionSlice createSubpartitionSlice(IndexRange partitionRange, IndexRange subpartitionRange, long dataBytes)
    • createSubpartitionSlicesByMultiPartitionRanges

      public static List<SubpartitionSlice> createSubpartitionSlicesByMultiPartitionRanges(List<IndexRange> partitionRanges, IndexRange subpartitionRange, Map<Integer,long[]> subpartitionBytesByPartition)