Ethan Rose created HDDS-13545:
---------------------------------

             Summary: MutableVolumeSet code cleanup
                 Key: HDDS-13545
                 URL: https://issues.apache.org/jira/browse/HDDS-13545
             Project: Apache Ozone
          Issue Type: Improvement
          Components: Ozone Datanode
            Reporter: Ethan Rose


A list of things that can be fixed in {{MutableVolumeSet}}
 * {{addVolume}} and {{removeVolume}} are only used in tests, but contain 
locking and logging like prod code and must be updated for changes like 
HDDS-13093
 ** {{addVolume}} can be replaced in tests by setting the volume as an 
{{hdds.datanode.dir}} in the config.
 ** {{removeVolume}} is only used in a test for itself. It can be removed.
 * {{getVolumeList}} is used in prod code, its {{@VisibleForTesting}} 
annotation should be removed.

 - {{getVolumeMap}} is {{@VisibleForTesting}} but has a [single prod 
usage|https://github.com/apache/ozone/blob/dc9952e446940b82b277a7e8c9d02239a8417a06/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/VersionEndpointTask.java#L120]
 which should be replaced with {{{}getVolumeList{}}}.

 * {{hasEnoughVolumes}} should use {{failedVolumeMap}} and {{volumeMap}} fields 
directly instead of their getters to avoid an extra copy.
 * {{VolumeStateMap}} can be removed.
 ** Although its values are updated, nothing is reading them.
 ** When we add storage policy/tiering by disk type it may not even be 
implemented this way, so for now we can remove this field to avoid having 
another data structure to keep in sync.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to