tillrohrmann commented on a change in pull request #9960: [FLINK-14476] Extend 
PartitionTracker to support promotions
URL: https://github.com/apache/flink/pull/9960#discussion_r340555175
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PartitionTrackerImpl.java
 ##########
 @@ -147,22 +160,35 @@ public boolean isPartitionTracked(final 
ResultPartitionID resultPartitionID) {
                return Optional.of(partitionInfo);
        }
 
+       private Stream<PartitionInfo> 
stopTrackingPartitionsAndRetrievePartitionInfo(Collection<ResultPartitionID> 
resultPartitionIds) {
+               return resultPartitionIds.stream()
+                       .map(this::internalStopTrackingPartition)
+                       .flatMap(PartitionTrackerImpl::asStream);
+       }
+
        private void internalReleasePartitions(
                ResourceID potentialPartitionLocation,
                Collection<ResultPartitionDeploymentDescriptor> 
partitionDeploymentDescriptors) {
 
                
internalReleasePartitionsOnTaskExecutor(potentialPartitionLocation, 
partitionDeploymentDescriptors);
-               
internalReleasePartitionsOnShuffleMaster(partitionDeploymentDescriptors);
+               
internalReleasePartitionsOnShuffleMaster(partitionDeploymentDescriptors.stream());
+       }
+
+       private void internalReleaseOrPromotePartitions(
+               ResourceID potentialPartitionLocation,
+               Collection<ResultPartitionDeploymentDescriptor> 
partitionDeploymentDescriptors) {
+
+               
internalReleaseOrPromotePartitionsOnTaskExecutor(potentialPartitionLocation, 
partitionDeploymentDescriptors);
+               
internalReleasePartitionsOnShuffleMaster(excludePersistentPartitions(partitionDeploymentDescriptors));
 
 Review comment:
   It is not supported yet, but I would assume that we would also need to tell 
the `ShuffleMaster` which partitions to promote and which ones to release. I 
guess we could calculate these two sets once and pass it to the 
`internalReleaseOrPromotePartitionsOnTaskExecutor` and 
`internalReleasePartitionsOnShuffleMaster`.

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