Thesharing commented on a change in pull request #16856:
URL: https://github.com/apache/flink/pull/16856#discussion_r697295044



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/strategy/ConsumedPartitionGroup.java
##########
@@ -19,22 +19,32 @@
 package org.apache.flink.runtime.scheduler.strategy;
 
 import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.runtime.jobgraph.IntermediateDataSetID;
 import org.apache.flink.runtime.jobgraph.IntermediateResultPartitionID;
 
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import static org.apache.flink.util.Preconditions.checkArgument;
+
 /** Group of consumed {@link IntermediateResultPartitionID}s. */
 public class ConsumedPartitionGroup implements 
Iterable<IntermediateResultPartitionID> {
 
     private final List<IntermediateResultPartitionID> resultPartitions;
 
     private final AtomicInteger unfinishedPartitions;
 
+    private final IntermediateDataSetID intermediateDataSetID;
+
     private ConsumedPartitionGroup(List<IntermediateResultPartitionID> 
resultPartitions) {
+        checkArgument(
+                resultPartitions.size() > 0,
+                "The size of result partitions in a ConsumedPartitionGroup 
should be larger than 0.");
+

Review comment:
       > I am wondering whether we should also check as precondition that all 
`resultPartitions` have the same `IntermediateDataSetID`.
   
   Sorry that I misunderstood the meaning of the check. The complexity of this 
sanity check is O(n). Although it will slightly increase the time cost on 
initialization of DefaultExecutionGraph, I think it's tolerable. I've updated 
the commit and squashed all the commits. Let's wait for CI to give green.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to