[ https://issues.apache.org/jira/browse/HDDS-13586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gargi Jaiswal updated HDDS-13586: --------------------------------- Description: *1. Improve data structures and type safety* : * In {*}DiskBalancerService{*}, use *ContainerID* instead of *Long* for container id. * Use *Objects.requireNonNull(..)* instead of {*}Preconditions.checkNotNull(..){*}. * In *DiskBalancerService* do not throw *RuntimeException* instead throw {*}IOException{*}. * Use *StorageVolume.TMP_DIR_NAME* to replace *DiskBalancerService.DISK_BALANCER_TMP_DIR* * In *DefaultVolumeChoosingPolicy.chooseVolume(..), getCurrentUsage()* is called multiple times so it can return different values. *2. Replace the use of Optional for method parameters in DiskBalancer:* As a general rule, parameters should be explicitly required or nullable, not wrapped in an Optional. For context, see: [https://www.reddit.com/r/java/comments/sat1j4/opinions_on_using_optional_as_parameter/] *3. Cleanup of Dead Code:* * Remove the new *Container.importContainerData(Path containerPath)* method since it is never used. * Rename *Container.copyContainerData* to {*}copyContainerDirectory{*}. As, it sounds like copy/import the ContainerData class. * *SlidingWindow* and *TestSlidingWindow* remove since unused. *4. parameterize disk balancer related unit tests with different container schema versions.* was: *1. Improve data structures and type safety* : * In {*}DiskBalancerService{*}, use *ContainerID* instead of *Long* for container id. * Use *Objects.requireNonNull(..)* instead of {*}Preconditions.checkNotNull(..){*}. * In *DiskBalancerService* do not throw *RuntimeException* instead throw {*}IOException{*}. * Use *StorageVolume.TMP_DIR_NAME* to replace *DiskBalancerService.DISK_BALANCER_TMP_DIR* * In *DefaultVolumeChoosingPolicy.chooseVolume(..), getCurrentUsage()* is called multiple times so it can return different values. *2. Replace the use of Optional for method parameters in DiskBalancer:* As a general rule, parameters should be explicitly required or nullable, not wrapped in an Optional. For context, see: [https://www.reddit.com/r/java/comments/sat1j4/opinions_on_using_optional_as_parameter/] *3. Cleanup of Dead Code:* * Remove the new *Container.importContainerData(Path containerPath)* method since it is never used. * Rename *Container.copyContainerData* to {*}copyContainerDirectory{*}. As, it sounds like copy/import the ContainerData class. * *SlidingWindow* and *TestSlidingWindow* remove since unused. > [DiskBalancer] Refactor DiskBalancer to remove unused methods and improve > naming > -------------------------------------------------------------------------------- > > Key: HDDS-13586 > URL: https://issues.apache.org/jira/browse/HDDS-13586 > Project: Apache Ozone > Issue Type: Sub-task > Reporter: Gargi Jaiswal > Assignee: Gargi Jaiswal > Priority: Minor > Labels: pull-request-available > > *1. Improve data structures and type safety* : > * In {*}DiskBalancerService{*}, use *ContainerID* instead of *Long* for > container id. > * Use *Objects.requireNonNull(..)* instead of > {*}Preconditions.checkNotNull(..){*}. > * In *DiskBalancerService* do not throw *RuntimeException* instead throw > {*}IOException{*}. > * Use *StorageVolume.TMP_DIR_NAME* to replace > *DiskBalancerService.DISK_BALANCER_TMP_DIR* > * In *DefaultVolumeChoosingPolicy.chooseVolume(..), getCurrentUsage()* is > called multiple times so it can return different values. > *2. Replace the use of Optional for method parameters in DiskBalancer:* > As a general rule, parameters should be explicitly required or nullable, not > wrapped in an Optional. For context, see: > [https://www.reddit.com/r/java/comments/sat1j4/opinions_on_using_optional_as_parameter/] > *3. Cleanup of Dead Code:* > * Remove the new *Container.importContainerData(Path containerPath)* method > since it is never used. > * Rename *Container.copyContainerData* to {*}copyContainerDirectory{*}. As, > it sounds like copy/import the ContainerData class. > * *SlidingWindow* and *TestSlidingWindow* remove since unused. > *4. parameterize disk balancer related unit tests with different container > schema versions.* -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org