Github user nkalmar commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/720#discussion_r236036464
--- Diff:
zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java ---
@@ -2495,6 +2495,30 @@ public void setACL(final String path, List<ACL> acl,
int version,
return getChildren(path, watch ? watchManager.defaultWatcher :
null);
}
+ /*
+ * Get all children number of one node
+ * */
+ public int getAllChildrenNumber(final String path)
+ throws KeeperException, InterruptedException {
+ int totalNumber = 0;
+ final String clientPath = path;
+ PathUtils.validatePath(clientPath);
+ // the watch contains the un-chroot path
+ WatchRegistration wcb = null;
+ final String serverPath = prependChroot(clientPath);
+ RequestHeader h = new RequestHeader();
+ h.setType(ZooDefs.OpCode.getAllChildrenNumber);
+ GetAllChildrenNumberRequest request = new
GetAllChildrenNumberRequest();
--- End diff --
You need to import the class GetAllChildrenNumberRequest which jute
generates.
---