Version parameter passed to ZooKeeper.setACL

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Version parameter passed to ZooKeeper.setACL

Arpit Agarwal
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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Version parameter passed to ZooKeeper.setACL

Jordan Zimmerman-3
Stat.aversion

> On Jun 22, 2017, at 1:04 PM, Arpit Agarwal <[hidden email]> 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
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Version parameter passed to ZooKeeper.setACL

Rakesh Radhakrishnan-2
In reply to this post by Arpit Agarwal
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 <[hidden email]>
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
>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Version parameter passed to ZooKeeper.setACL

Brahma Reddy Battula
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:[hidden email]]
Sent: 23 June 2017 10:47
To: [hidden email]
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 <[hidden email]>
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
>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Version parameter passed to ZooKeeper.setACL

Rakesh Radhakrishnan-2
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 <
[hidden email]> 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:[hidden email]]
> Sent: 23 June 2017 10:47
> To: [hidden email]
> 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 <[hidden email]>
> 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
> >
> >
> >
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Version parameter passed to ZooKeeper.setACL

Brahma Reddy Battula
Done. https://issues.apache.org/jira/browse/ZOOKEEPER-2818

Thanks.

--Brahma Reddy Battula

-----Original Message-----
From: Rakesh Radhakrishnan [mailto:[hidden email]]
Sent: 23 June 2017 11:10
To: [hidden email]
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 < [hidden email]> 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:[hidden email]]
> Sent: 23 June 2017 10:47
> To: [hidden email]
> 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
> <[hidden email]>
> 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
> >
> >
> >
>
Loading...