Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Operation type limitation in the Multi. #46

Closed
sn00011 opened this issue Dec 22, 2014 · 2 comments
Closed

Operation type limitation in the Multi. #46

sn00011 opened this issue Dec 22, 2014 · 2 comments

Comments

@sn00011
Copy link

sn00011 commented Dec 22, 2014

First thanks for you fixes on the Multi, now I am using the new Multi and it works well. I have a little question though as I noticed the Multi only accepts four kinds of operations:

  • CreateRequest
  • SetDataRequest
  • DeleteRequest
  • CheckVersionRequest

Are there any special reason for this limitation?

I think in some cases, It would be nice to get a znode's stat change within a transaction. So if the Multi could accepts operations like GetData, Exists this could be easily done.

@samuel
Copy link
Owner

samuel commented Dec 22, 2014

From what I understand of multi those are the only possible operations. Although, it's quite possible the set has been extended in later versions (3.5.x).

The java doc for multi: https://zookeeper.apache.org/doc/r3.4.3/api/org/apache/zookeeper/ZooKeeper.html#multi(java.lang.Iterable)

Possible zookeeper.Op classes: http://people.apache.org/~larsgeorge/zookeeper-1215258/build/docs/dev-api/org/apache/zookeeper/class-use/Op.html

@sn00011
Copy link
Author

sn00011 commented Dec 23, 2014

Then the operation types are restricted by the zookeeper itself. I found this line in the class org.apache.zookeeper.Op:

Represents a single operation in a multi-operation transaction. Each operation can be a create, update or delete or can just be a version check.

I found no other operation type support in later versions(> 3.4.3 && 3.5) as well. Thanks for pointing me a right direction.

@sn00011 sn00011 closed this as completed Dec 23, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants