davidradl commented on code in PR #27459:
URL: https://github.com/apache/flink/pull/27459#discussion_r2720895437
##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/storage/TieredStorageResourceRegistry.java:
##########
@@ -20,19 +20,19 @@
import
org.apache.flink.runtime.io.network.partition.hybrid.tiered.common.TieredStorageDataIdentifier;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
/**
* A registry that maintains local or remote resources that correspond to a
certain set of data in
* the Tiered Storage.
*/
public class TieredStorageResourceRegistry {
- private final Map<TieredStorageDataIdentifier, List<TieredStorageResource>>
- registeredResources = new HashMap<>();
+ private final ConcurrentHashMap<
+ TieredStorageDataIdentifier,
CopyOnWriteArrayList<TieredStorageResource>>
Review Comment:
I am curious, why do we need the `CopyOnWriteArrayList`, is the
introduction of `ConcurrentHashMap `not enough to solve this?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]