15412s
15412s

Reputation: 3748

Atomic actions with ZooKeeper

How to gather number of action in ZooKeeper into one atomic action with one result (pass/fails)?

I read that ZooKeeper supports this with "multiop", but I haven't found it on version 3.4.6. (was MultiCallback name changed?)

Upvotes: 1

Views: 488

Answers (1)

Serge
Serge

Reputation: 2744

You can use zookeeper transactions. Apache Curator library for ZooKeeper provide nice syntax.

For example, to modify several nodes in a transaction:

client.inTransaction().
.setData().forNode(path1, data1)
.and()
.SetData().forNode(path2, data2)
.and()
.commit();

Upvotes: 1

Related Questions