GitHub user TyqITstudent opened a pull request:
https://github.com/apache/zookeeper/pull/705
ZOOKEEPER-3167:add an API to get total count of recursive sub nodes of one
node
1. In production environment, there will be always a situation that there
are a lot of recursive sub nodes of one node. We need to count total number of
it.
2. Now, we can only use API getChildren which returns the List<String> of
first level of sub nodes. We need to iterate every sub node to get recursive
sub nodes. It will cost a lot of time.
3. In zookeeper server side, it uses Hasp<String, DataNode> to store node.
The key of the map represents the path of the node. We can iterate the map get
total number of all levels of sub nodes of one node.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/TyqITstudent/zookeeper ZOOKEEPER-3167
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zookeeper/pull/705.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #705
----
commit c70c9ac4cac284ff20d1d74b007fe51728288a48
Author: tianyiqun <891707263@...>
Date: 2018-11-18T13:21:11Z
add an API to get total count of recursive sub nodes of one node
----
---