GitHub user TyqITstudent opened a pull request:
https://github.com/apache/zookeeper/pull/720
add an API to get total count of recursive sub nodes of one node
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.
Now, we can only use API getChildren which returns the List 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.
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/720.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 #720
----
commit f21dab121f255959032148e6608b84c12ed0bd68
Author: tianyiqun <891707263@...>
Date: 2018-11-24T06:39:30Z
add an API to get total count of recursive sub nodes of one node
----
---