zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anmolnar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #650: ZOOKEEPER-1908: setAcl should be have a recursi...
Date Tue, 02 Oct 2018 12:06:47 GMT
Github user anmolnar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/650#discussion_r221922741
  
    --- Diff: src/java/main/org/apache/zookeeper/cli/SetAclCommand.java ---
    @@ -69,9 +72,22 @@ public boolean exec() throws CliException {
                 version = -1;
             }
             try {
    -            Stat stat = zk.setACL(path, acl, version);
    -            if (cl.hasOption("s")) {
    -                new StatPrinter(out).print(stat);
    +            if (cl.hasOption("R")) {
    +                ZKUtil.visitSubTreeDFS(zk, path, false, new StringCallback() {
    +                    @Override
    +                    public void processResult(int rc, String path, Object ctx, String
name) {
    +                        try {
    +                            zk.setACL(path, acl, version);
    +                        } catch (KeeperException | InterruptedException e) {
    +                            out.print(e.getMessage());
    +                        }
    +                    }
    +                });
    +            } else {
    +                Stat stat = zk.setACL(path, acl, version);
    +                if (cl.hasOption("s")) {
    --- End diff --
    
    Unfortunately we don't have documentation for the CLI. It would be useful to start one
either on wiki, in docs or implement a more detailed help page, but I don't want to overload
this PR.
    What if we just add a more detailed javadoc to the class?


---

Mime
View raw message