klion26 commented on a change in pull request #8934: [FLINK-12628][Runtime / 
Coordination] Check test failure if partitionhas no consumers in 
Execution.getPartitionMaxParallelism
URL: https://github.com/apache/flink/pull/8934#discussion_r299006008
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
 ##########
 @@ -679,14 +678,10 @@ public void setInitialState(@Nullable 
JobManagerTaskRestore taskRestore) {
        }
 
        private static int 
getPartitionMaxParallelism(IntermediateResultPartition partition) {
-               // TODO consumers.isEmpty() only exists for test, currently 
there has to be exactly one consumer in real jobs!
                final List<List<ExecutionEdge>> consumers = 
partition.getConsumers();
-               int maxParallelism = 
KeyGroupRangeAssignment.UPPER_BOUND_MAX_PARALLELISM;
-               if (!consumers.isEmpty()) {
-                       List<ExecutionEdge> consumer = consumers.get(0);
-                       ExecutionJobVertex consumerVertex = 
consumer.get(0).getTarget().getJobVertex();
-                       maxParallelism = consumerVertex.getMaxParallelism();
-               }
+               List<ExecutionEdge> consumer = consumers.get(0);
 
 Review comment:
   As the previous comment said, `consumers will be empty in test`, so 
`consumers.get(0)` will throw an exception here?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to