You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Andrei Mikhalev (Jira)" <ji...@apache.org> on 2024/05/08 07:46:00 UTC

[jira] [Created] (HDDS-10830) Replace ConcurrentHashMap with HashMap protected by ReadWriteLock

Andrei Mikhalev created HDDS-10830:
--------------------------------------

             Summary: Replace ConcurrentHashMap with HashMap protected by ReadWriteLock
                 Key: HDDS-10830
                 URL: https://issues.apache.org/jira/browse/HDDS-10830
             Project: Apache Ozone
          Issue Type: Improvement
          Components: SCM
            Reporter: Andrei Mikhalev


There is a class [NodeStateMap|https://github.com/apache/ozone/blob/master/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/states/NodeStateMap.java#L47] with 3 fields:
 # {{ConcurrentHashMap<UUID, DatanodeInfo> nodeMap}}
 # {{ConcurrentHashMap<UUID, Set<ContainerID>> nodeToContainer}}
 # {{rivate final ReadWriteLock lock}}

Both *read* and *write* in _NodeStateMap_ are protected by *lock*.

We can safely replace  _ConcurrentHashMap_ with pure  _HashMap_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org