[ 
https://issues.apache.org/jira/browse/HDDS-1894?focusedWorklogId=295969&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-295969
 ]

ASF GitHub Bot logged work on HDDS-1894:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Aug/19 02:38
            Start Date: 16/Aug/19 02:38
    Worklog Time Spent: 10m 
      Work Description: timmylicheng commented on pull request #1286: 
HDDS-1894. Add filter to scmcli listPipelines.
URL: https://github.com/apache/hadoop/pull/1286#discussion_r314565875
 
 

 ##########
 File path: 
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/pipeline/ListPipelinesSubcommand.java
 ##########
 @@ -38,11 +38,34 @@
   @CommandLine.ParentCommand
   private SCMCLI parent;
 
+  @CommandLine.Option( names = {"-ffc", "--filterByFactor"},
+          description = "Filter listed pipelines by Factor(ONE/one)", 
defaultValue = "",
+          required = false)
+  private String factor;
+
+  @CommandLine.Option( names = {"-fst", "--filterByState"},
+          description = "Filter listed pipelines by State(OPEN/CLOSE)", 
defaultValue = "",
+          required = false)
+  private String state;
+
+
   @Override
   public Void call() throws Exception {
     try (ScmClient scmClient = parent.createScmClient()) {
-      scmClient.listPipelines().forEach(System.out::println);
+      if (isNullOrEmpty(factor) && isNullOrEmpty(state)) {
+        System.out.println("No filter. List all.");
 
 Review comment:
   Removed
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 295969)
            Time Spent: 10m
    Remaining Estimate: 0h

> Support listPipelines by filters in scmcli
> ------------------------------------------
>
>                 Key: HDDS-1894
>                 URL: https://issues.apache.org/jira/browse/HDDS-1894
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Xiaoyu Yao
>            Assignee: Li Cheng
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Today scmcli has a subcmd that allow list all pipelines. This ticket is 
> opened to filter the results by switches, e.g., filter by Factor: THREE and 
> State: OPEN. This will be useful for trouble shooting in large cluster.
>  
> {code}
> bin/ozone scmcli listPipelines
> Pipeline[ Id: a8d1b0c9-e1d4-49ea-8746-3f61dfb5ee3f, Nodes: 
> cce44fde-bc8d-4063-97b3-6f557af756e1\{ip: 10.17.112.65, host: 
> ia0230.halxg.cloudera.com, networkLocation: /default-rack, certSerialId: 
> null}, Type:RATIS, Factor:ONE, State:OPEN]
> Pipeline[ Id: c9c453d1-d74c-4414-b87f-1d3585d78a7c, Nodes: 
> 0b7b0b93-8323-4b82-8cc0-a9a5c10ab827\{ip: 10.17.112.29, host: 
> ia0138.halxg.cloudera.com, networkLocation: /default-rack, certSerialId: 
> null}c756a0e0-5a1b-4d03-ba5b-cafbcabac877\{ip: 10.17.112.27, host: 
> ia0134.halxg.cloudera.com, networkLocation: /default-rack, certSerialId: 
> null}bee45bd7-1ee6-4726-b3d1-81476dc1eb49\{ip: 10.17.112.28, host: 
> ia0136.halxg.cloudera.com, networkLocation: /default-rack, certSerialId: 
> null}, Type:RATIS, Factor:THREE, State:OPEN]
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to