Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2077

Wild-card/Regex Support for Zookeeper client commands

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • java client
    • None

    Description

      We had an use-case where we had to list nodes matching a particular pattern from a given path. While looking at the ZK client commands, it seems that it does not support wildcard/regex.

      I did try to overcome this by making some basic changes to the LSCommand.java and adding a "-m" switch which accepts regex. Since I implemented this using java.util.regex, it supports everything that Java regex supports.

      I was thinking such functionality can be useful for 'ls' as well as 'delete' (and deleteall). Though I implemented this at the client code for ls - this can be done at the server side code as well and I have a preliminary plan on top of my head to do this for ls, delete, deleteall.

      Will it be worthwhile addition to make to zookeeper client? If so, I can work on submitting a patch.

      Points to consider in case such a support can be implemented:
      1. Do we support Java regex or Unix Shell wildcards ( * )?
      2. Right now, create allows creating nodes with characters like * - we need to make sure that such a change does not break or create confusion (Unix too allows creating a directory with * BTW).

      Any thoughts on whether this will be a worthwhile addition to Zookeeper client?

      Attachments

        Activity

          People

            Unassigned Unassigned
            vivekpm Vivek Madani
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: