azagrebin 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_r326135285
 
 

 ##########
 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:
   We can also add a check if this assumption holds to better debug it if fails:
   `Preconditions.checkArgument(!consumers.isEmpty(), "Currently there has to 
be exactly one consumer in real jobs");`

----------------------------------------------------------------
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