sreejasahithi commented on code in PR #9812:
URL: https://github.com/apache/ozone/pull/9812#discussion_r2850725061


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancer.java:
##########
@@ -510,4 +514,22 @@ public String toString() {
         "%-30s %b%n", "Key", "Value", "Running", isBalancerRunning());
     return status + config.toString();
   }
+
+  private void validateNodeList(Set<String> nodes, String type)

Review Comment:
   could you also add a javadoc for validateNodeList method.



##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancerTask.java:
##########
@@ -411,6 +413,39 @@ public void balancerShouldMoveOnlyPositiveSizeContainers()
     assertFalse(zeroOrNegSizeContainerMoved);
   }
 
+  @Test
+  public void testStartBalancerWithInvalidNodes() {
+    ContainerBalancer balancer = new ContainerBalancer(scm);
+    ContainerBalancerConfiguration cbConf = 
conf.getObject(ContainerBalancerConfiguration.class);
+
+    // Testing invalid hostname and ip for includeNodes
+    cbConf.setIncludeNodes("invalid-host-name");

Review Comment:
   you could also assert that the error message contains the actual invalid 
node name (similarly for others). This ensures that users see which specific 
node caused the validation failure.
   
   for example:
   ```
   assertThat(exception.getMessage()).contains("invalid-host-name");
   ```



-- 
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