errose28 commented on code in PR #6577:
URL: https://github.com/apache/ozone/pull/6577#discussion_r1580237914


##########
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/pipeline/ClosePipelineSubcommand.java:
##########
@@ -35,13 +41,49 @@
     mixinStandardHelpOptions = true,
     versionProvider = HddsVersionProvider.class)
 public class ClosePipelineSubcommand extends ScmSubcommand {
+  @CommandLine.ArgGroup(multiplicity = "1")
+  private CloseOptionGroup closeOption;
 
-  @CommandLine.Parameters(description = "ID of the pipeline to close")
-  private String pipelineId;
+  @CommandLine.Mixin
+  private final FilterPipelineOptions filterOptions = new 
FilterPipelineOptions();
 
   @Override
   public void execute(ScmClient scmClient) throws IOException {
-    scmClient.closePipeline(
-        HddsProtos.PipelineID.newBuilder().setId(pipelineId).build());
+    if (!Strings.isNullOrEmpty(closeOption.pipelineId)) {
+      if (filterOptions.getReplicationFilter().isPresent()) {
+        System.out.println("When close pipeline by ID filters are ignored.");

Review Comment:
   ```suggestion
           System.err.println("Replication filters can only be used with 
--all");
   ```
   
   This check looks like a good way to do it. I think we should fail the 
command with a message like this to make sure the command is not doing 
something the user did not expect given the combination of flags they tried to 
use.



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