Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Implemented
-
1.4.0
Description
There is a base class `org.apache.hadoop.hdds.scm.node.states.Node2ObjectsMap for Node2PipelineMap and Node2ContainerMap.
It is redundant because of:
1. Node2ContainerMap is used only in tests
2. Node2PipelineMap doesn't need inheritance at all
Moreover Node2PipelineMap contains ConcurrentHashMap<UUID, Set<PipelineID>> and 2 synchronized methods:
- void addPipeline(Pipeline pipeline) -> compute if absent for concurrent hash map
- void removePipeline(Pipeline pipeline) -> compute if present for concurrent hash map
I suppose synchronized is redundant here for these two methods.
Proposed changes:
1. Remove org.apache.hadoop.hdds.scm.node.states.Node2ObjectsMap class
2. Move Node2ContainerMap to tests
3. Don't use synchronized for Node2PipelineMap::addPipeline and Node2PipelineMap::removePipeline
GitHub discussions here
Attachments
Issue Links
- links to