Class IndexRangeUtil
java.lang.Object
org.apache.flink.runtime.executiongraph.IndexRangeUtil
Utils for
IndexRange.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<IndexRange>mergeIndexRanges(Collection<IndexRange> ranges) Merges overlapping or consecutiveIndexRangeinstances from the given collection.
-
Constructor Details
-
IndexRangeUtil
public IndexRangeUtil()
-
-
Method Details
-
mergeIndexRanges
Merges overlapping or consecutiveIndexRangeinstances 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
IndexRangeinstances.- Parameters:
ranges- the collection ofIndexRangeinstances to merge.- Returns:
- a list of merged
IndexRangeinstances. If the input is null or empty, an empty list is returned.
-