Class IndexRangeUtil
- java.lang.Object
-
- org.apache.flink.runtime.executiongraph.IndexRangeUtil
-
public class IndexRangeUtil extends Object
Utils forIndexRange
.
-
-
Constructor Summary
Constructors Constructor Description IndexRangeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<IndexRange>
mergeIndexRanges(Collection<IndexRange> ranges)
Merges overlapping or consecutiveIndexRange
instances from the given collection.
-
-
-
Method Detail
-
mergeIndexRanges
public static List<IndexRange> mergeIndexRanges(Collection<IndexRange> ranges)
Merges overlapping or consecutiveIndexRange
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 ofIndexRange
instances to merge.- Returns:
- a list of merged
IndexRange
instances. If the input is null or empty, an empty list is returned.
-
-