You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/10/25 15:14:47 UTC

[GitHub] [flink] zentol commented on a change in pull request #9960: [FLINK-14476] Extend PartitionTracker to support promotions

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

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PartitionTrackerImpl.java
 ##########
 @@ -122,6 +122,27 @@ public void stopTrackingAndReleasePartitionsFor(ResourceID producingTaskExecutor
 		stopTrackingAndReleasePartitions(resultPartitionIds);
 	}
 
+	@Override
+	public void stopTrackingAndReleaseOrPromotePartitionsFor(ResourceID producingTaskExecutorId) {
+		Preconditions.checkNotNull(producingTaskExecutorId);
+
+		// this is a bit icky since we make 2 calls to pT#stopTrackingPartitions
+		Collection<ResultPartitionID> resultPartitionIds = partitionTable.stopTrackingPartitions(producingTaskExecutorId);
+
+		// stop tracking partitions to be released and group them by task executor ID
+		Map<ResourceID, List<ResultPartitionDeploymentDescriptor>> partitionsToReleaseOrPromoteByResourceId = resultPartitionIds.stream()
+			.map(this::internalStopTrackingPartition)
+			.filter(Optional::isPresent)
+			.map(Optional::get)
+			.collect(Collectors.groupingBy(
 
 Review comment:
   yes, we can simplify this implementation rather significantly.

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


With regards,
Apache Git Services