zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] maoling opened a new pull request #790: ZOOKEEPER-3167:add an API and the corresponding CLI to get total count of recursive sub nodes under a specific path
Date Thu, 31 Jan 2019 02:27:05 GMT
maoling opened a new pull request #790: ZOOKEEPER-3167:add an API and the corresponding CLI
to get total count of recursive sub nodes under a specific path
URL: https://github.com/apache/zookeeper/pull/790
 
 
   - 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).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message