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_r340551678
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PartitionTrackerImpl.java
##########
@@ -123,6 +120,22 @@ 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
Review comment:
I think the main reason why this is icky is that we are treating the
`partitionTable` and `partitionInfos` as separate structures even though they
belong conceptually together. If one adds something to `partitionTable` then
one also wants to add something to `partitionInfos` and vice versa.
I would suggest to introduce a data structure which combines both and has
the API `Optional<PartitionInfo> remove(ResultPartitionID)` and
`Collection<PartitionInfos> removePartitionsProducedBy(ResourceID)`.
Conceptually it is a `Map<ResourceID, PartitionInfo>` which also keeps an index
on `ResultPartitionID`.
----------------------------------------------------------------
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