problem is, it is going to be a very very costly operation (using multi 
transactions). A map may contain millions of entries. I first need to get the 
data of all these entries, delete them and create them again under different 
parent name. 

If we have a rename option, all I need to do is just rename the parent znode. 

Thanks
Mudit
On 16 Jun 2014, at 03:42 pm, Jordan Zimmerman <[email protected]> 
wrote:

> Yeah
> 
> 
> From: Camille Fournier [email protected]
> Reply: [email protected] [email protected]
> Date: June 16, 2014 at 8:42:19 AM
> To: [email protected] [email protected]
> Cc: Mudit Verma [email protected]
> Subject:  Re: renaming a znode 
> 
>> Just to clarify you mean the multi API? 
>> C 
>> On Jun 16, 2014 9:40 AM, "Jordan Zimmerman" <[email protected]> 
>> wrote: 
>> 
>> > You could use the transaction api to create a new node and delete the old 
>> > node. 
>> > 
>> > -JZ 
>> > 
>> > 
>> > From: Mudit Verma [email protected] 
>> > Reply: [email protected] [email protected] 
>> > Date: June 16, 2014 at 8:38:11 AM 
>> > To: [email protected] [email protected] 
>> > Subject: renaming a znode 
>> > 
>> > Hello People, 
>> > 
>> > Sorry for asking many questions these days. :) 
>> > 
>> > I am wondering if it is possible to rename a znode? I am building a 
>> > distributed map on top of zookeeper for special needs. From time to time, 
>> > I 
>> > need to freeze the map without restricting write access to the map. 
>> > 
>> > I plan to do it by maintaining two maps: 
>> > 
>> > map_current 
>> > map_frozen 
>> > 
>> > all the map entries are maintained as separate children znodes where key 
>> > is the name of the child node and value is the value stored on the child 
>> > node .. 
>> > for example /map_current/entry1(kv) 
>> > /map_current/entry2(kv) 
>> > 
>> > 
>> > Now at some point of time, I need to iterate the map while still allowing 
>> > write access by other clients. While I iterate, I don’t want other clients 
>> > to see these entries. Once I process map_frozen entries I will delete them 
>> > (I don’t need them anymore) by just deleting the parent node. 
>> > 
>> > I plan to rename existing map from map_current to map_frozen and create 
>> > new map as map_current with empty data for further writes. Other clients 
>> > will continue to write new entries in map_current .. so on so forth .. 
>> > 
>> > Any suggestions on how can I do it efficiently. 
>> > 
>> > Thanks 
>> > Mudit

Reply via email to