[ https://issues.apache.org/jira/browse/ZOOKEEPER-2077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vivek Madani updated ZOOKEEPER-2077: ------------------------------------ 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? was: 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? > Wild-card/Regex Support for Zookeeper client commands > ----------------------------------------------------- > > Key: ZOOKEEPER-2077 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2077 > Project: ZooKeeper > Issue Type: New Feature > Components: java client > Reporter: Vivek Madani > > 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? -- This message was sent by Atlassian JIRA (v6.3.4#6332)