shuan1026 commented on code in PR #11503:
URL: https://github.com/apache/ozone/pull/11503#discussion_r4265990759


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -240,11 +240,8 @@ private void loadDiskBalancerInfo() throws IOException {
       if (diskBalancerInfoFile.exists()) {
         diskBalancerInfo = readDiskBalancerInfoFile(diskBalancerInfoFile);
       } else {
-        boolean shouldRunDefault =
-            conf.getObject(DiskBalancerConfiguration.class)
-                .getDiskBalancerShouldRun();
-        diskBalancerInfo = new DiskBalancerInfo(shouldRunDefault,
-            new DiskBalancerConfiguration());
+        DiskBalancerConfiguration diskBalancerConf = 
conf.getObject(DiskBalancerConfiguration.class);

Review Comment:
   Thanks @Gargi-jais11. 
   
   Added `@PostConstruct validate()` to `DiskBalancerConfiguration`.
   Added `testInitialDiskBalancerInfoFallsBackToDefaultsForInvalidConfig`, 
which sets raw invalid values with no `diskBalancer.info` and checks that both 
the in-memory info and the written YAML use the defaults.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to