tillrohrmann commented on a change in pull request #10362: 
[FLINK-14792][coordination] Implement TE cluster partition release
URL: https://github.com/apache/flink/pull/10362#discussion_r394490219
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/TaskExecutorPartitionTrackerImpl.java
 ##########
 @@ -92,6 +92,14 @@ public void 
promoteJobPartitions(Collection<ResultPartitionID> partitionsToPromo
                );
        }
 
+       @Override
+       public void 
stopTrackingAndReleaseClusterPartitions(Collection<IntermediateDataSetID> 
dataSetsToRelease) {
+               dataSetsToRelease.stream()
+                       .map(clusterPartitions::remove)
+                       .map(PartitionEntry::getPartitionIds)
+                       .forEach(shuffleEnvironment::releasePartitionsLocally);
 
 Review comment:
   ```suggestion
   for (IntermediateDataSetID intermediateDataSetID : dataSetsToRelease) {
                        final PartitionEntry entry = 
clusterPartitions.remove(intermediateDataSetID);
                        
shuffleEnvironment.releasePartitionsLocally(entry.getPartitionIds());
                }
   ```
   
   We should use the streams API only with pure functions and loops for 
imperative programs.

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