Class IndexRangeUtil

java.lang.Object
org.apache.flink.runtime.executiongraph.IndexRangeUtil

public class IndexRangeUtil extends Object
Utils for IndexRange.
  • Constructor Details

    • IndexRangeUtil

      public IndexRangeUtil()
  • Method Details

    • mergeIndexRanges

      public static List<IndexRange> mergeIndexRanges(Collection<IndexRange> ranges)
      Merges overlapping or consecutive IndexRange instances from the given collection.

      The method sorts the provided ranges by their start index, then iteratively merges ranges that either overlap or are directly adjacent. The result is a list of non-overlapping and consolidated IndexRange instances.

      Parameters:
      ranges - the collection of IndexRange instances to merge.
      Returns:
      a list of merged IndexRange instances. If the input is null or empty, an empty list is returned.