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

 ##########
 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:
   Yeah, I think it makes sense to use `new ArrayList<>(partitionInfos)` 
directly.

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