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 09:37:00 UTC

[jira] [Updated] (HDDS-10830) Replace ConcurrentHashMap with HashMap protected by ReadWriteLock in NodeStateMap

     [ https://issues.apache.org/jira/browse/HDDS-10830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Mikhalev updated HDDS-10830:
-----------------------------------
    Summary: Replace ConcurrentHashMap with HashMap protected by ReadWriteLock in NodeStateMap  (was: Replace ConcurrentHashMap with HashMap protected by ReadWriteLock)

> Replace ConcurrentHashMap with HashMap protected by ReadWriteLock in NodeStateMap
> ---------------------------------------------------------------------------------
>
>                 Key: HDDS-10830
>                 URL: https://issues.apache.org/jira/browse/HDDS-10830
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: SCM
>            Reporter: Andrei Mikhalev
>            Assignee: Andrei Mikhalev
>            Priority: Major
>              Labels: pull-request-available
>
> 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}}
>  # {{private 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