You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Arpit Agarwal <aa...@hortonworks.com> on 2017/06/22 18:04:09 UTC

Version parameter passed to ZooKeeper.setACL

Greetings,

For the ZooKeeper.setACL call:

https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/ZooKeeper.java#L2368

     public Stat setACL(final String path, List<ACL> acl, int version)

Should version be set to Stat.version or Stat.aversion?

Thanks,
Arpit



RE: Version parameter passed to ZooKeeper.setACL

Posted by Brahma Reddy Battula <br...@huawei.com>.
Done. https://issues.apache.org/jira/browse/ZOOKEEPER-2818

Thanks.

--Brahma Reddy Battula

-----Original Message-----
From: Rakesh Radhakrishnan [mailto:rakeshr@apache.org] 
Sent: 23 June 2017 11:10
To: user@zookeeper.apache.org
Subject: Re: Version parameter passed to ZooKeeper.setACL

Agreed. Please feel free to raise a jira task for improving zkcli#setACL() javadoc.

Rakesh

On Fri, Jun 23, 2017 at 8:32 AM, Brahma Reddy Battula < brahmareddy.battula@huawei.com> wrote:

> One suggestion here.
>
> Java doc or argument can be improved which might not mislead..?
>
> i) public Stat setACL(final String path, List<ACL> acl, int aversion 
> or
> aclVersion)
> ii) "should pass aclversion only"..something like this..
>
>
>
> --Brahma Reddy Battula
>
> -----Original Message-----
> From: Rakesh Radhakrishnan [mailto:rakeshr@apache.org]
> Sent: 23 June 2017 10:47
> To: user@zookeeper.apache.org
> Subject: Re: Version parameter passed to ZooKeeper.setACL
>
> Hi Arpit,
>
> Stat#aversion represents "the number of changes to the ACL of this znode."
> On calling the zkcli#setACL api, internally ZK server will increase 
> the 'aversion' by one. If the given 'aversion' does not match the 
> znode's aversion it will throw BadVersionException.
>
> While invoking the #setACL api, you should pass "Stat.aversion".
>
> Rakesh
>
> On Thu, Jun 22, 2017 at 11:34 PM, Arpit Agarwal 
> <aa...@hortonworks.com>
> wrote:
>
> > Greetings,
> >
> > For the ZooKeeper.setACL call:
> >
> > https://github.com/apache/zookeeper/blob/master/src/java/
> > main/org/apache/zookeeper/ZooKeeper.java#L2368
> >
> >      public Stat setACL(final String path, List<ACL> acl, int 
> > version)
> >
> > Should version be set to Stat.version or Stat.aversion?
> >
> > Thanks,
> > Arpit
> >
> >
> >
>

Re: Version parameter passed to ZooKeeper.setACL

Posted by Rakesh Radhakrishnan <ra...@apache.org>.
Agreed. Please feel free to raise a jira task for improving zkcli#setACL()
javadoc.

Rakesh

On Fri, Jun 23, 2017 at 8:32 AM, Brahma Reddy Battula <
brahmareddy.battula@huawei.com> wrote:

> One suggestion here.
>
> Java doc or argument can be improved which might not mislead..?
>
> i) public Stat setACL(final String path, List<ACL> acl, int aversion or
> aclVersion)
> ii) "should pass aclversion only"..something like this..
>
>
>
> --Brahma Reddy Battula
>
> -----Original Message-----
> From: Rakesh Radhakrishnan [mailto:rakeshr@apache.org]
> Sent: 23 June 2017 10:47
> To: user@zookeeper.apache.org
> Subject: Re: Version parameter passed to ZooKeeper.setACL
>
> Hi Arpit,
>
> Stat#aversion represents "the number of changes to the ACL of this znode."
> On calling the zkcli#setACL api, internally ZK server will increase the
> 'aversion' by one. If the given 'aversion' does not match the znode's
> aversion it will throw BadVersionException.
>
> While invoking the #setACL api, you should pass "Stat.aversion".
>
> Rakesh
>
> On Thu, Jun 22, 2017 at 11:34 PM, Arpit Agarwal <aa...@hortonworks.com>
> wrote:
>
> > Greetings,
> >
> > For the ZooKeeper.setACL call:
> >
> > https://github.com/apache/zookeeper/blob/master/src/java/
> > main/org/apache/zookeeper/ZooKeeper.java#L2368
> >
> >      public Stat setACL(final String path, List<ACL> acl, int version)
> >
> > Should version be set to Stat.version or Stat.aversion?
> >
> > Thanks,
> > Arpit
> >
> >
> >
>

RE: Version parameter passed to ZooKeeper.setACL

Posted by Brahma Reddy Battula <br...@huawei.com>.
One suggestion here.

Java doc or argument can be improved which might not mislead..?

i) public Stat setACL(final String path, List<ACL> acl, int aversion or aclVersion)
ii) "should pass aclversion only"..something like this..



--Brahma Reddy Battula

-----Original Message-----
From: Rakesh Radhakrishnan [mailto:rakeshr@apache.org] 
Sent: 23 June 2017 10:47
To: user@zookeeper.apache.org
Subject: Re: Version parameter passed to ZooKeeper.setACL

Hi Arpit,

Stat#aversion represents "the number of changes to the ACL of this znode."
On calling the zkcli#setACL api, internally ZK server will increase the 'aversion' by one. If the given 'aversion' does not match the znode's aversion it will throw BadVersionException.

While invoking the #setACL api, you should pass "Stat.aversion".

Rakesh

On Thu, Jun 22, 2017 at 11:34 PM, Arpit Agarwal <aa...@hortonworks.com>
wrote:

> Greetings,
>
> For the ZooKeeper.setACL call:
>
> https://github.com/apache/zookeeper/blob/master/src/java/
> main/org/apache/zookeeper/ZooKeeper.java#L2368
>
>      public Stat setACL(final String path, List<ACL> acl, int version)
>
> Should version be set to Stat.version or Stat.aversion?
>
> Thanks,
> Arpit
>
>
>

Re: Version parameter passed to ZooKeeper.setACL

Posted by Rakesh Radhakrishnan <ra...@apache.org>.
Hi Arpit,

Stat#aversion represents "the number of changes to the ACL of this znode."
On calling the zkcli#setACL api, internally ZK server will increase the
'aversion' by one. If the given 'aversion' does not match the znode's
aversion it will throw BadVersionException.

While invoking the #setACL api, you should pass "Stat.aversion".

Rakesh

On Thu, Jun 22, 2017 at 11:34 PM, Arpit Agarwal <aa...@hortonworks.com>
wrote:

> Greetings,
>
> For the ZooKeeper.setACL call:
>
> https://github.com/apache/zookeeper/blob/master/src/java/
> main/org/apache/zookeeper/ZooKeeper.java#L2368
>
>      public Stat setACL(final String path, List<ACL> acl, int version)
>
> Should version be set to Stat.version or Stat.aversion?
>
> Thanks,
> Arpit
>
>
>

Re: Version parameter passed to ZooKeeper.setACL

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
Stat.aversion

> On Jun 22, 2017, at 1:04 PM, Arpit Agarwal <aa...@hortonworks.com> wrote:
> 
> Greetings,
> 
> For the ZooKeeper.setACL call:
> 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/ZooKeeper.java#L2368
> 
>     public Stat setACL(final String path, List<ACL> acl, int version)
> 
> Should version be set to Stat.version or Stat.aversion?
> 
> Thanks,
> Arpit
> 
>