Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-10446

Refactoring Node2ObjectsMap, Node2PipelineMap, Node2ContainerMap

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Implemented
    • 1.4.0
    • 2.0.0
    • SCM

    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:

      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

          Activity

            People

              montura Andrei Mikhalev
              montura Andrei Mikhalev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: