[jira] [Comment Edited] (ZOOKEEPER-1962) Add a CLI command to recursively list a znode and children

2016-08-26 Thread Michael Han (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15440041#comment-15440041
 ] 

Michael Han edited comment on ZOOKEEPER-1962 at 8/26/16 10:33 PM:
--

+1 on the idea of reusing existing code.

However, {{listSubTreeBFS}} would buffer entire tree starting from the pathRoot 
passed in, so it's likely running into memory issues for large snapshot. I 
think what's mentioned earlier by Enis would work, and it preserves both the 
order properties (we buffer children of each node while doing dfs), and the 
memory constraint (we don't buffer all nodes, and we increase depth iteratively 
after each layer is printed.). This technique is formally known as [Iterative 
deepening depth-first 
search|https://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search]. 
We could either update {{listSubTreeBFS}} or add a ID dfs version of same 
function in ZKUtil and use that instead.


was (Author: hanm):
+1 on the idea of reusing existing code.

However, {{listSubTreeBFS}} would buffer full tree, so it's likely running into 
memory issues for large snapshot. I think what's mentioned earlier by Enis 
would work, and it preserves both the order properties (we buffer children of 
each node while doing dfs), and the memory constraint (we don't buffer all 
nodes, and we increase depth iteratively after each layer is printed.). This 
technique is formally known as [Iterative deepening depth-first 
search|https://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search]. 
We could either update {{listSubTreeBFS}} or add a ID dfs version of same 
function in ZKUtil and use that instead.

> Add a CLI command to recursively list a znode and children
> --
>
> Key: ZOOKEEPER-1962
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1962
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: java client
>Affects Versions: 3.4.6
>Reporter: Gautam Gopalakrishnan
>Assignee: Gautam Gopalakrishnan
>Priority: Minor
> Fix For: 3.5.3, 3.6.0
>
> Attachments: ZOOKEEPER-1962.diff, ZOOKEEPER-1962_v2.patch, 
> ZOOKEEPER-1962_v3.patch, ZOOKEEPER-1962_v4.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> When troubleshooting applications where znodes can be multiple levels deep  
> (eg. HBase replication), it is handy to see all child znodes recursively 
> rather than run an ls for each node manually.
> So I propose adding an option to the "ls" command (-r) which will list all 
> child nodes under a given znode. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (ZOOKEEPER-1962) Add a CLI command to recursively list a znode and children

2016-08-26 Thread Abraham Fine (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15439531#comment-15439531
 ] 

Abraham Fine edited comment on ZOOKEEPER-1962 at 8/26/16 6:41 PM:
--

I agree with [~phunt] that reusing the logic from deleteall (listSubTreeBFS) is 
likely a good idea

It also may be valuable to add a comment to the code/command output that 
explains that modifications can occur to the tree while the ls -R command is 
running and it may be the case that the output does not necessarily represent 
the actual state of zookeeper at any given point in time.

In other words, the race condition noted above can occur with the creation of 
nodes, which will not cause any of the listing operations to fail so we would 
have no way to fail intelligently.


was (Author: abrahamfine):
I agree with [~phunt] that reusing the logic from deleteall (listSubTreeBFS) is 
likely a good idea

It also may be valuable to add a comment to the code/command output that 
explains that modifications can occur to the tree while the ls -R command is 
running and it may be the case that the output does not necessarily represent 
the actual state of zookeeper at any given point in time.

> Add a CLI command to recursively list a znode and children
> --
>
> Key: ZOOKEEPER-1962
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1962
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: java client
>Affects Versions: 3.4.6
>Reporter: Gautam Gopalakrishnan
>Assignee: Gautam Gopalakrishnan
>Priority: Minor
> Fix For: 3.5.3, 3.6.0
>
> Attachments: ZOOKEEPER-1962.diff, ZOOKEEPER-1962_v2.patch, 
> ZOOKEEPER-1962_v3.patch, ZOOKEEPER-1962_v4.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> When troubleshooting applications where znodes can be multiple levels deep  
> (eg. HBase replication), it is handy to see all child znodes recursively 
> rather than run an ls for each node manually.
> So I propose adding an option to the "ls" command (-r) which will list all 
> child nodes under a given znode. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)