lokeshj1703 commented on code in PR #3762:
URL: https://github.com/apache/ozone/pull/3762#discussion_r976275349


##########
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerStartSubcommand.java:
##########
@@ -55,31 +54,23 @@ public class DiskBalancerStartSubcommand extends 
ScmSubcommand {
       description = "Max parallelThread for DiskBalancer.")
   private Optional<Integer> parallelThread;
 
-  @Option(names = {"-a", "--allDatanodes"},
-      description = "Start diskBalancer on all datanodes.")
-  private boolean allHosts;
-
-  @Parameters(description = "List of fully qualified host names")
-  private List<String> hosts = new ArrayList<>();
+  @CommandLine.Mixin
+  private DiskBalancerCommonOptions commonOptions =
+      new DiskBalancerCommonOptions();
 
   @Override
   public void execute(ScmClient scmClient) throws IOException {
-    if (hosts.size() == 0 && !allHosts) {
-      System.out.println("Datanode not specified. Please specify " +
-          "\"--allDatanodes\" to start diskBalancer on all datanodes");
-      return;
-    }
-    if (hosts.size() != 0 && allHosts) {
-      System.out.println("Confused options. Omit \"--allDatanodes\" or " +
-          "Datanodes.");
+    if (!commonOptions.check()) {
       return;
     }
     List<DatanodeAdminError> errors =
         scmClient.startDiskBalancer(threshold, bandwidthInMB, parallelThread,
-            hosts.size() == 0 ? Optional.empty() : Optional.of(hosts));
+            commonOptions.getHosts().size() == 0 ? Optional.empty() :
+                Optional.of(commonOptions.getHosts()));

Review Comment:
   @symious Can you please address this as well? I am +1 on the PR o.w.



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