zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Camille Fournier <cami...@apache.org>
Subject Re: renaming a znode
Date Mon, 16 Jun 2014 13:41:46 GMT
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