sumitagrawl commented on code in PR #9719:
URL: https://github.com/apache/ozone/pull/9719#discussion_r3021120245


##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ReportSubcommand.java:
##########
@@ -44,13 +44,73 @@ public class ReportSubcommand extends ScmSubcommand {
   @CommandLine.Spec
   private CommandLine.Model.CommandSpec spec;
 
+  @CommandLine.ArgGroup(exclusive = true, multiplicity = "0..1")
+  private SuppressOptions suppressOptions;
+
+  @CommandLine.Mixin
+  private ContainerIDParameters containerList;
+
   @CommandLine.Option(names = { "--json" },
       defaultValue = "false",
       description = "Format output as JSON")
   private boolean json;
 
+  static class SuppressOptions {
+    @CommandLine.Option(names = {"--suppress"},
+        description = "Suppress container(s) from future reports")
+    private boolean suppress;
+
+    @CommandLine.Option(names = {"--unsuppress"},
+        description = "Unsuppress container(s) to include in future reports")
+    private boolean unsuppress;
+
+    public boolean isSuppress() {
+      return suppress;
+    }
+
+    public boolean isUnsuppress() {
+      return unsuppress;
+    }
+  }
+
   @Override
   public void execute(ScmClient scmClient) throws IOException {
+    if (suppressOptions != null) {
+      handleSuppressUnsuppress(scmClient);
+      return;
+    }
+
+    printReport(scmClient);
+  }
+
+  private void handleSuppressUnsuppress(ScmClient scmClient) throws 
IOException {
+    boolean suppress = suppressOptions.isSuppress();
+    List<Long> containerIDs = containerList.getValidatedIDs();
+
+    int failures = 0;
+    for (long id : containerIDs) {
+      try {
+        scmClient.suppressContainer(id, suppress);

Review Comment:
   we can handle as batch operation passing multiple container Id, instead of 
one my one.



##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ReportSubcommand.java:
##########
@@ -44,13 +44,73 @@ public class ReportSubcommand extends ScmSubcommand {
   @CommandLine.Spec
   private CommandLine.Model.CommandSpec spec;
 
+  @CommandLine.ArgGroup(exclusive = true, multiplicity = "0..1")
+  private SuppressOptions suppressOptions;
+
+  @CommandLine.Mixin
+  private ContainerIDParameters containerList;
+
   @CommandLine.Option(names = { "--json" },
       defaultValue = "false",
       description = "Format output as JSON")
   private boolean json;
 
+  static class SuppressOptions {
+    @CommandLine.Option(names = {"--suppress"},
+        description = "Suppress container(s) from future reports")
+    private boolean suppress;
+
+    @CommandLine.Option(names = {"--unsuppress"},

Review Comment:
   unable to find usages of this flag



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