hadoop-zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: NodeChildrenChanged WatchedEvent
Date Fri, 08 May 2009 21:12:24 GMT
On Fri, May 8, 2009 at 1:31 PM, Javier Vegas <javier@beboinc.com> wrote:

> Sorry, what I meant is issuing the new method watchChildren() on the
> parent node (basically the same as getChildren() but returning just a
> boolean instead of a list of children, because I already know the
> paths of the original children and the ones that were added/deleted so
> I dont need the list again).


You need to analyze this very much more carefully in light of Ben's comment.


> I wasnt thinking (yet) about
> grandchildren, but If I want to watch for them, I will need to do a
> initial getChildren() on the new child that NodeChildrenChanged told
> me about, followed by a watchChildren() after each event. Does this
> make sense?


That is close.

The watch has to be set when you do the getChildren to avoid having a crack
that a change could fall into between the getChildren and setting the watch.

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