zhuzhurk commented on a change in pull request #12278: URL: https://github.com/apache/flink/pull/12278#discussion_r436628282
########## 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: Yes we can improve `DualKeyLinkedMap` and drop the `requestedAllocations`. The needed improvement would be: 1. re-insert a record does not affect its order 2. get keyA from keyB, and vice versa ########## 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: done. ########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/DualKeyLinkedMap.java ########## @@ -37,20 +44,20 @@ private final LinkedHashMap<A, Tuple2<B, V>> aMap; - private final LinkedHashMap<B, A> bMap; + private final HashMap<B, A> bMap; private transient Collection<V> values; public DualKeyLinkedMap(int initialCapacity) { Review comment: @azagrebin what do you think of making this class package private? It looks like a common util class but no one other than `SlotPoolImpl` uses it. ---------------------------------------------------------------- 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