[
https://issues.apache.org/jira/browse/HDDS-10830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrei Mikhalev updated HDDS-10830:
-----------------------------------
Description:
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_
was:
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_
> 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
> Assignee: Andrei Mikhalev
> Priority: Major
>
> 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: [email protected]
For additional commands, e-mail: [email protected]