ZOOKEEPER-3167:add an API and the corresponding CLI to get total count of recursive sub nodes under a specific path#790
Closed
maoling wants to merge 1 commit intoapache:masterfrom
Closed
Conversation
…t of recursive sub nodes under a specific path
Member
Author
|
retest this please |
Member
Author
|
@dineshappavoo
|
Contributor
|
Landed. Thanks @maoling ! |
Member
Author
|
@anmolnar |
RokLenarcic
pushed a commit
to RokLenarcic/zookeeper
that referenced
this pull request
Sep 3, 2022
…nt of recursive sub nodes under a specific path - Thanks the original patch from [TyqITstudent ](https://github.com/TyqITstudent). - the `getAllChildrenNumber` api supports `sync` and `async`, don't support `watch`. since` getChildren()` can get the number of the first level,to keep the api short and clean,don't use a boolean flag to let this api get the number of the first level child. - the implements using the` parallelStream()` which have the almost `4x` speed up than `forEach`(I test),it will return at once even a millons of keys. - `getAllChildrenNumber` doesn't have a `synchronized `lock, to avoid holding the `nodes` for a long time,so when too many concurrent writes, the number will be not very precise. - about `getAllChildrenNumber` CLI: > [zk: localhost:2181(CONNECTED) 6] getAllChildrenNumber /zookeeper > 2 > [zk: localhost:2181(CONNECTED) 7] getAllChildrenNumber /zookeeper/quota > 0 - there is no good place to document the new api, I create a seperate jira-[ZOOKEEPER-3259](https://issues.apache.org/jira/projects/ZOOKEEPER/issues/ZOOKEEPER-3259). Author: maoling <maoling199210191@sina.com> Reviewers: andor@apache.org Closes apache#790 from maoling/ZOOKEEPER-3167
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks the original patch from TyqITstudent .
the
getAllChildrenNumberapi supportssyncandasync, don't supportwatch.since
getChildren()can get the number of the first level,to keep the api short and clean,don't use a boolean flag to let this api get the number of the first level child.the implements using the
parallelStream()which have the almost4xspeed up thanforEach(I test),it will return at once even a millons of keys.getAllChildrenNumberdoesn't have asynchronizedlock, to avoid holding thenodesfor a long time,so when too many concurrent writes, the number will be not very precise.about
getAllChildrenNumberCLI:there is no good place to document the new api, I create a seperate jira-ZOOKEEPER-3259.