azagrebin commented on a change in pull request #12278:
URL: https://github.com/apache/flink/pull/12278#discussion_r430441131



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImpl.java
##########
@@ -112,6 +114,9 @@
        /** The requests that are waiting for the resource manager to be 
connected. */
        private final LinkedHashMap<SlotRequestId, PendingRequest> 
waitingForResourceManager;
 
+       /** Maps a request to its allocation. */
+       private final BiMap<SlotRequestId, AllocationID> requestedAllocations;

Review comment:
       Looking into the implementation of `DualKeyLinkedMap` for 
`pendingRequests`, it seems we can just remove the first matching 
`SlotRequestId` and then remap the orphaned `SlotRequestId` to its 
`AllocationID`. The original insertion ordering should not suffer in 
`DualKeyLinkedMap.aMap`. If so, we could remove  `requestedAllocations`.
   
   EDIT: `waitingForResourceManager` -> `pendingRequests`




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


Reply via email to