[ 
https://issues.apache.org/jira/browse/CURATOR-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14084173#comment-14084173
 ] 

ASF GitHub Bot commented on CURATOR-132:
----------------------------------------

GitHub user cammckenzie opened a pull request:

    https://github.com/apache/curator/pull/32

    CURATOR-132 - Modified the NamespaceFacade so that it does not proxy

    Modified the NamespaceFacade so that it does not proxy getACL() and 
setACL() calls to the underlying client (which is not namespace aware), and 
instead handles them itself.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/curator CURATOR-132

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/32.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 #32
    
----
commit 97351385561f3038b2aba9a25a617a204a14e023
Author: Cam McKenzie <[email protected]>
Date:   2014-08-04T00:04:22Z

    CURATOR-132 - Modified the NamespaceFacade so that it does not proxy
    getACL() and setACL() calls to the underlying client (which is not
    namespace aware), and instead handles them itself.

----


> setACL doesn't work with namespaced curator
> -------------------------------------------
>
>                 Key: CURATOR-132
>                 URL: https://issues.apache.org/jira/browse/CURATOR-132
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 2.3.0, 2.6.0
>            Reporter: John Vines
>            Assignee: Cameron McKenzie
>
> Experienced this on 2.3.0, doesn't seem to be resolved in 2.6.0
> Attempting to setACL with a namespaced curator fails to recognize the 
> namespace. It seems that setACL doesn't properly pass on the Namespaced 
> facade. The following test code is an exemplar.
> {code}public class BreakCurator {
>   public static void main(String args[]) throws Exception {
>     TestingServer ts = new TestingServer();
>     CuratorFramework curator = 
> CuratorFrameworkFactory.builder().connectString(ts.getConnectString()).retryPolicy(new
>  ExponentialBackoffRetry(1000, 5)).build();
>     curator.start();
>     curator.getZookeeperClient().blockUntilConnectedOrTimedOut();
>     curator.create().creatingParentsIfNeeded().forPath("/parent/child", "A 
> string".getBytes());
>     CuratorFramework curator2 = curator.usingNamespace("parent");
>     try {
>       System.out.println(new String(curator2.getData().forPath("child")));
>       curator.setACL().withACL(Collections.singletonList(new 
> ACL(ZooDefs.Perms.WRITE, 
> ZooDefs.Ids.ANYONE_ID_UNSAFE))).forPath("/parent/child");
> // This should attempt to setACL on /parent/child, but instead fails because 
> /child isn't present. Using "child" causes a failure because the path doesn't 
> start with a slash
>       curator2.setACL().withACL(Collections.singletonList(new 
> ACL(ZooDefs.Perms.DELETE, ZooDefs.Ids.ANYONE_ID_UNSAFE))).forPath("/child");
>       System.out.println(curator2.getACL().forPath("/child"));
>     } catch (Exception e) {
>       e.printStackTrace();
>     }
>     ts.close();
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to