Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-10430

Add ls command to ZkCLI for listing only sub-directories

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: scripts and tools
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      Current list command prints out the whole directory/file tree, which can be too verbose for some situations, especially when the cluster gets bigger over time.

      Add a "ls" command that would support listing only part of the file tree based on the input path given

      1. SOLR-10430.patch
        18 kB
        Peter Szantai-Kis
      2. SOLR-10430.patch
        18 kB
        Peter Szantai-Kis
      3. SOLR-10430.patch
        17 kB
        Peter Szantai-Kis
      4. SOLR-10430.patch
        5 kB
        Peter Szantai-Kis

        Activity

        Hide
        erickerickson Erick Erickson added a comment -

        WDYT about adding this capability to the bin/solr zk commands instead?

        Show
        erickerickson Erick Erickson added a comment - WDYT about adding this capability to the bin/solr zk commands instead?
        Hide
        szantaikis Peter Szantai-Kis added a comment - - edited

        Erick Erickson, actually bin/solr already have this functionality via SolrCLI.ZkLsTool, so adding this to ZkCLI is just for providing another way of using it. for reference: SOLR-9194

        Deep down both implementations are using the SolZkClient.getChildren method.

        Show
        szantaikis Peter Szantai-Kis added a comment - - edited Erick Erickson , actually bin/solr already have this functionality via SolrCLI.ZkLsTool, so adding this to ZkCLI is just for providing another way of using it. for reference: SOLR-9194 Deep down both implementations are using the SolZkClient.getChildren method.
        Hide
        markrmiller@gmail.com Mark Miller added a comment -

        Thanks for the patch Peter Szantai-Kis, looks like a couple precommit violations:

        [forbidden-apis] Scanning classes for violations...
        [forbidden-apis] Forbidden method invocation: java.io.PrintStream#<init>(java.io.OutputStream) [Uses default charset]
        [forbidden-apis]   in org.apache.solr.cloud.ZkCLITest (ZkCLITest.java:198)
        [forbidden-apis] Forbidden method invocation: java.io.ByteArrayOutputStream#toString() [Uses default charset]
        [forbidden-apis]   in org.apache.solr.cloud.ZkCLITest (ZkCLITest.java:203)
        [forbidden-apis] Forbidden method invocation: java.io.PrintStream#<init>(java.io.OutputStream) [Uses default charset]
        [forbidden-apis]   in org.apache.solr.cloud.ZkCLITest (ZkCLITest.java:215)
        [forbidden-apis] Forbidden method invocation: java.io.ByteArrayOutputStream#toString() [Uses default charset]
        [forbidden-apis]   in org.apache.solr.cloud.ZkCLITest (ZkCLITest.java:220)
        [forbidden-apis] Scanned 3641 (and 2473 related) class file(s) for forbidden API invocations (in 3.22s), 4 error(s).
        

        We forbid using methods that use the default charset - generally you want to use .ROOT or .ENGLISH.

        Show
        markrmiller@gmail.com Mark Miller added a comment - Thanks for the patch Peter Szantai-Kis , looks like a couple precommit violations: [forbidden-apis] Scanning classes for violations... [forbidden-apis] Forbidden method invocation: java.io.PrintStream#<init>(java.io.OutputStream) [Uses default charset] [forbidden-apis] in org.apache.solr.cloud.ZkCLITest (ZkCLITest.java:198) [forbidden-apis] Forbidden method invocation: java.io.ByteArrayOutputStream#toString() [Uses default charset] [forbidden-apis] in org.apache.solr.cloud.ZkCLITest (ZkCLITest.java:203) [forbidden-apis] Forbidden method invocation: java.io.PrintStream#<init>(java.io.OutputStream) [Uses default charset] [forbidden-apis] in org.apache.solr.cloud.ZkCLITest (ZkCLITest.java:215) [forbidden-apis] Forbidden method invocation: java.io.ByteArrayOutputStream#toString() [Uses default charset] [forbidden-apis] in org.apache.solr.cloud.ZkCLITest (ZkCLITest.java:220) [forbidden-apis] Scanned 3641 (and 2473 related) class file(s) for forbidden API invocations (in 3.22s), 4 error(s). We forbid using methods that use the default charset - generally you want to use .ROOT or .ENGLISH.
        Hide
        szantaikis Peter Szantai-Kis added a comment -

        Mark Miller,

        updated the patch with the fix. I ran the precommit locally this time.

        Thanks

        Show
        szantaikis Peter Szantai-Kis added a comment - Mark Miller , updated the patch with the fix. I ran the precommit locally this time. Thanks
        Hide
        markrmiller@gmail.com Mark Miller added a comment -

        Thanks Peter.

        I ran the precommit locally this time

        Yeah, it's a long command, so I don't run it for every commit, Jenkins has to get a defensive workout occasionally, but I've often hit issues with ZkCLI and this type of thing, so just ran it based on experience.

        Show
        markrmiller@gmail.com Mark Miller added a comment - Thanks Peter. I ran the precommit locally this time Yeah, it's a long command, so I don't run it for every commit, Jenkins has to get a defensive workout occasionally, but I've often hit issues with ZkCLI and this type of thing, so just ran it based on experience.
        Hide
        markrmiller@gmail.com Mark Miller added a comment -

        Looks good. Guess I was thinking of locale vs charset

        Updated to trunk due to some recent changes and am now finishing a test and precommit run. Will commit shortly.

        Show
        markrmiller@gmail.com Mark Miller added a comment - Looks good. Guess I was thinking of locale vs charset Updated to trunk due to some recent changes and am now finishing a test and precommit run. Will commit shortly.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit c4872add50113439bcad128c40e07949b6524ae1 in lucene-solr's branch refs/heads/master from Mark Miller
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c4872ad ]

        SOLR-10430: Add ls command to ZkCLI for listing only sub-directories.

        Show
        jira-bot ASF subversion and git services added a comment - Commit c4872add50113439bcad128c40e07949b6524ae1 in lucene-solr's branch refs/heads/master from Mark Miller [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c4872ad ] SOLR-10430 : Add ls command to ZkCLI for listing only sub-directories.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 6017202d6ebcbcc1c6c8d9328530acb68b858d7d in lucene-solr's branch refs/heads/branch_6x from Mark Miller
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6017202 ]

        SOLR-10430: Add ls command to ZkCLI for listing only sub-directories.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 6017202d6ebcbcc1c6c8d9328530acb68b858d7d in lucene-solr's branch refs/heads/branch_6x from Mark Miller [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6017202 ] SOLR-10430 : Add ls command to ZkCLI for listing only sub-directories.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 5f77aa089713ae84d3af010f77d2862c9a2528c0 in lucene-solr's branch refs/heads/master from Cassandra Targett
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=5f77aa0 ]

        Ref Guide: Update list of available zkcli commands from SOLR-10430; rework page a bit

        Show
        jira-bot ASF subversion and git services added a comment - Commit 5f77aa089713ae84d3af010f77d2862c9a2528c0 in lucene-solr's branch refs/heads/master from Cassandra Targett [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=5f77aa0 ] Ref Guide: Update list of available zkcli commands from SOLR-10430 ; rework page a bit
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 9f6622af976e6bcec38af1d0a9aff1536fd71be8 in lucene-solr's branch refs/heads/branch_6x from Cassandra Targett
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9f6622a ]

        Ref Guide: Update list of available zkcli commands from SOLR-10430; rework page a bit

        Show
        jira-bot ASF subversion and git services added a comment - Commit 9f6622af976e6bcec38af1d0a9aff1536fd71be8 in lucene-solr's branch refs/heads/branch_6x from Cassandra Targett [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9f6622a ] Ref Guide: Update list of available zkcli commands from SOLR-10430 ; rework page a bit
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 3f63e8649c9a5425c479b5843344c60c825fb1b1 in lucene-solr's branch refs/heads/branch_6_6 from Cassandra Targett
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3f63e86 ]

        Ref Guide: Update list of available zkcli commands from SOLR-10430; rework page a bit

        Show
        jira-bot ASF subversion and git services added a comment - Commit 3f63e8649c9a5425c479b5843344c60c825fb1b1 in lucene-solr's branch refs/heads/branch_6_6 from Cassandra Targett [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3f63e86 ] Ref Guide: Update list of available zkcli commands from SOLR-10430 ; rework page a bit

          People

          • Assignee:
            markrmiller@gmail.com Mark Miller
            Reporter:
            szantaikis Peter Szantai-Kis
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development