GJL commented on a change in pull request #10112: [FLINK-14640] Change Type of 
Field currentExecutions from ConcurrentHashMap to HashMap
URL: https://github.com/apache/flink/pull/10112#discussion_r344663558
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphDeploymentTest.java
 ##########
 @@ -397,14 +404,16 @@ public void testRegistrationOfExecutionsCanceled() {
                        JobVertex v1 = new JobVertex("v1", jid1);
                        JobVertex v2 = new JobVertex("v2", jid2);
 
-                       Map<ExecutionAttemptID, Execution> executions = 
setupExecution(v1, 19, v2, 37).f1;
+                       Tuple2<ExecutionGraph, Map<ExecutionAttemptID, 
Execution>> graphExecutionsTuple = setupExecution(v1, 19, v2, 37);
+                       ExecutionGraph testExecutionGraph = 
graphExecutionsTuple.f0;
+                       Map<ExecutionAttemptID, Execution> executions = new 
ConcurrentHashMap<>(graphExecutionsTuple.f1);
 
 Review comment:
   Why are you using `ConcurrentHashMap`? There won't be concurrent 
modifications as far as I am concerned. 
   Moreover, we do not really require a Map, i.e., something like 
`Collection<Execution>` would suffice.
   
   ```suggestion
                        Collection<Execution> executions = new 
ArrayList<>(graphExecutionsTuple.f1.values());
   ```

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