zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mudit Verma <mudit.f2004...@gmail.com>
Subject Re: renaming a znode
Date Mon, 16 Jun 2014 13:43:43 GMT
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 <jordan@jordanzimmerman.com> wrote:

> Yeah
> 
> 
> From: Camille Fournier camille@apache.org
> Reply: user@zookeeper.apache.org user@zookeeper.apache.org
> Date: June 16, 2014 at 8:42:19 AM
> To: bookkeeper-user@zookeeper.apache.org user@zookeeper.apache.org
> Cc: Mudit Verma mudit.f2004912@gmail.com
> Subject:  Re: renaming a znode 
> 
>> Just to clarify you mean the multi API? 
>> C 
>> On Jun 16, 2014 9:40 AM, "Jordan Zimmerman" <jordan@jordanzimmerman.com> 
>> wrote: 
>> 
>> > You could use the transaction api to create a new node and delete the old 
>> > node. 
>> > 
>> > -JZ 
>> > 
>> > 
>> > From: Mudit Verma mudit.f2004912@gmail.com 
>> > Reply: user@zookeeper.apache.org user@zookeeper.apache.org 
>> > Date: June 16, 2014 at 8:38:11 AM 
>> > To: user@zookeeper.apache.org user@zookeeper.apache.org 
>> > 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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message