RE: NodeChildrenChanged WatchedEvent

2009-05-11 Thread Benjamin Reed
@hadoop.apache.org Subject: Re: NodeChildrenChanged WatchedEvent Making things better is always good. I have found that in practice, most wrappers of ZK lead to serious errors and should be avoided like the plague. This particular use case is not a big deal for me to code correctly (in Java, anyway

Re: NodeChildrenChanged WatchedEvent

2009-05-09 Thread Ted Dunning
Making things better is always good. I have found that in practice, most wrappers of ZK lead to serious errors and should be avoided like the plague. This particular use case is not a big deal for me to code correctly (in Java, anyway) and I do it all the time. It may be that the

NodeChildrenChanged WatchedEvent

2009-05-08 Thread Javier Vegas
Hi, I am starting to implement Zookeeper as an arbiter for a high performance client-server service, it is working really well but I have a question. When my Watcher receives an event of NodeChildrenChanged event, is there any way of getting from the event the path for the child that changed? The

Re: NodeChildrenChanged WatchedEvent

2009-05-08 Thread Patrick Hunt
Javier, also note that the subsequent getChildren you mention in your original email is usually not entirely superfluous given that you generally want to watch the parent node for further changes, and a getChildren is required to set that watch. Patrick Benjamin Reed wrote: i'm adding a faq

Re: NodeChildrenChanged WatchedEvent

2009-05-08 Thread Javier Vegas
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

Re: NodeChildrenChanged WatchedEvent

2009-05-08 Thread Javier Vegas
Maybe the name I selected is confusing, watchForChildrenChanges() is more descriptive than watchChildren(). The first indicates that I am setting a watch for children changes, the old name kinds of implies I am watching for changes on the children of the node, which is not what I want. Javier On

Re: NodeChildrenChanged WatchedEvent

2009-05-08 Thread Scott Carey
It won't work, because when you call watchChildren() you don't actually know the list of children from the previous getChildren() if the initial watch fired. The initial watch may have fired because child X was added, but by the time you get that message and call your watchChildren(), child Y and

Re: NodeChildrenChanged WatchedEvent

2009-05-08 Thread Scott Carey
This reminds me of a feature request: Persistent watch -- This type of watch would stick around, and doesn't have the gap-in-time problem that the other watchers do. This is particularly useful for exists and children -- less so for data. Such an event could delay, and merge certain changes

Re: NodeChildrenChanged WatchedEvent

2009-05-08 Thread Javier Vegas
Ok, thanks for convincing me that I need to do another getChildren() after each event. My initial plan was to put thousands of children under the same node, but it seems I will need to organize them on some kind of hierarchical structure. I will need to watch lots of nodes not just one, but each

Re: NodeChildrenChanged WatchedEvent

2009-05-08 Thread Ted Dunning
On Fri, May 8, 2009 at 1:31 PM, Javier Vegas jav...@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