zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shelley, Ryan" <Ryan.Shel...@disney.com>
Subject Re: Create nested paths
Date Thu, 01 Mar 2012 00:52:11 GMT
Thanks for that. Out of curiosity, in my prior example of creating a node
at /lorem/ipsum/foo/bar, if I'm building the multi operation list and at
the same time some other client creates /lorem before I execute the multi
operation, will the entire multi fail because /lorem already exists?

On 2/29/12 4:46 PM, "Ted Dunning" <ted.dunning@gmail.com> wrote:

>http://zookeeper.apache.org/doc/r3.4.2/api/org/apache/zookeeper/ZooKeeper.
>html#multi(java.lang.Iterable)
>
>The javadoc for Op does not appear for an unknown (to me) reason.  Here it
>is from 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.
> *
> * Sub-classes of Op each represent each detailed type but should not
>normally be referenced except via
> * the provided factory methods.
> *
> * @see ZooKeeper#create(String, byte[], java.util.List, CreateMode)
> * @see ZooKeeper#create(String, byte[], java.util.List, CreateMode,
>org.apache.zookeeper.AsyncCallback.StringCallback, Object)
> * @see ZooKeeper#delete(String, int)
> * @see ZooKeeper#setData(String, byte[], int)
> */
>
>Sample usage can be found in
>org.apache.zookeeper.test.MultiTransactionTest
>
>On Wed, Feb 29, 2012 at 4:26 PM, Shelley, Ryan
><Ryan.Shelley@disney.com>wrote:
>
>> Can you reference some docs? I looked but couldn't find anything
>>regarding
>> multi.
>>
>> On 2/29/12 4:23 PM, "Ted Dunning" <ted.dunning@gmail.com> wrote:
>>
>> >Well, in 3.4, you can use multi to do this.
>> >
>> >On Wed, Feb 29, 2012 at 4:08 PM, Shelley, Ryan
>> ><Ryan.Shelley@disney.com>wrote:
>> >
>> >> Is it possible to create all nodes in a path in one step?
>> >>
>> >> For example, my ZK is empty of any nodes. I want to create:
>> >> /lorem/ipsum/foo/bar
>> >>
>> >> Do I have to create each segment with iterative calls to ZK, or is
>>there
>> >> an easier way to build this?
>> >>
>>
>>


Mime
View raw message