azagrebin commented on a change in pull request #7856: 
[FLINK-11776][coordination] Refactor to simplify the process of 
scheduleOrUpdateConsumers
URL: https://github.com/apache/flink/pull/7856#discussion_r268189476
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
 ##########
 @@ -1119,27 +1076,15 @@ private void finishCancellation() {
                }
        }
 
-       void cachePartitionInfo(PartialInputChannelDeploymentDescriptor 
partitionInfo) {
-               partialInputChannelDeploymentDescriptors.add(partitionInfo);
+       void cachePartitionInfo(PartitionInfo partitionInfo) {
+               partitionInfos.add(partitionInfo);
        }
 
-       void sendPartitionInfos() {
-               // check if the ExecutionVertex has already been archived and 
thus cleared the
-               // partial partition infos queue
-               if (partialInputChannelDeploymentDescriptors != null && 
!partialInputChannelDeploymentDescriptors.isEmpty()) {
-
-                       PartialInputChannelDeploymentDescriptor 
partialInputChannelDeploymentDescriptor;
-
-                       List<PartitionInfo> partitionInfos = new 
ArrayList<>(partialInputChannelDeploymentDescriptors.size());
-
-                       while ((partialInputChannelDeploymentDescriptor = 
partialInputChannelDeploymentDescriptors.poll()) != null) {
-                               partitionInfos.add(
-                                       new PartitionInfo(
-                                               
partialInputChannelDeploymentDescriptor.getResultId(),
-                                               
partialInputChannelDeploymentDescriptor.createInputChannelDeploymentDescriptor(this)));
-                       }
+       private void sendPartitionInfos() {
+               if (!partitionInfos.isEmpty()) {
+                       
sendUpdatePartitionInfoRpcCall(Lists.newArrayList(partitionInfos));
 
 Review comment:
   Could we avoid using 3rd party dependencies like Guava? it could be just 
`new ArrayList<>(partitionInfos)`. Is his defensive copy of `partitionInfos` 
actually needed?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to