curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron McKenzie <>
Subject Re: Active Children nodes?
Date Wed, 13 Nov 2013 20:49:52 GMT
You would need to add the 'active' flag to the data in the zNode (v1 or
v2). Then you would place a watch on the data changing in those zNodes
(i.e. curator.getData().watched().forPath("bla")); Then you would get
notified whenever a node become active or inactive.

You're responsible for encoding the active flag into the zNode, as it just
takes a byte[] as the data to be stored.

On Thu, Nov 14, 2013 at 4:44 AM, Techy Teck <> wrote:

> Any suggestion on this?
> On Tue, Nov 12, 2013 at 10:47 PM, Techy Teck <>wrote:
>> Suppose I have this hierarchy in my zookeeper schema. Attached is the
>> diagram.
>> And there will be some children for /v1 and /v2 as well.
>> At some stage, I will be trying to retrieve children of /root parent
>> node. And depending on whether /v1 is active or /v2 is active, we will
>> retrieve its children.
>> Suppose if /v1 is active, then we will retrieve children of v1 and if v2
>> is active, then we will retrieve children of v2.
>> Now I am wondering, how to add this active(ness) as a part of znode?
>> Meaning how to make sure any one node is active at certain point so that
>> when I retrieve the children of root, I can tell which version is active
>> and then get the children of those version (v1 or v2) node
>> Initially, I was thinking to add some data in /v1 and /v2 node which will
>> tell us which node is active from v1 and v2.
>> But is there any other approach that I can use here?

View raw message