Re: zookeeper.getChildren asynchronous callback

2009-06-12 Thread Satish
I guess I was talking about removing the trigger. Personally I don't think there's a need to bend over backwards to remove "in-flight" notifications! :) Satish On Jun 12, 2009, at 9:59 AM, Patrick Hunt wrote: We probably want to allow the caller to specify which type of watch they want

Re: zookeeper.getChildren asynchronous callback

2009-06-12 Thread Patrick Hunt
We probably want to allow the caller to specify which type of watch they want to remove - a watch on the znode itself, on children of the znode, or both. zk.removeWatch(path, watcher, wtype) where: path is path to the znode watcher may be a specific watcher or null matching all watchers wtype i

Re: zookeeper.getChildren asynchronous callback

2009-06-11 Thread Ted Dunning
One way to deal with this is to wrap the getchildren call with an object that maintains a list of watchers. Then you can have just one watch set which notifies all of the listener. This single object can keep resetting the watch each time there is a change unless you tell it otherwise. Keeping a

Re: zookeeper.getChildren asynchronous callback

2009-06-11 Thread Mahadev Konar
Agreed... It is a nice api to have and also reduces our memory footprint for unwanted watches (as Ben suggested earlier). mahadev On 6/11/09 10:14 AM, "Satish Bhatti" wrote: > That's right Ben. Basically, I would like to use it something like this: > public boolean waitForChildrenChanged( Str

Re: zookeeper.getChildren asynchronous callback

2009-06-11 Thread Satish Bhatti
Actually I guess that would be zookeeper.removeWatch( rootPath, tempWatcher ) !! On Thu, Jun 11, 2009 at 10:14 AM, Satish Bhatti wrote: > That's right Ben. Basically, I would like to use it something like this: > public boolean waitForChildrenChanged( String rootPath, >

Re: zookeeper.getChildren asynchronous callback

2009-06-11 Thread Satish Bhatti
That's right Ben. Basically, I would like to use it something like this: public boolean waitForChildrenChanged( String rootPath, long timeout ) { BooleanLock blChildrenChanged = new BooleanLock(); Watcher tempWatcher = new

Re: zookeeper.getChildren asynchronous callback

2009-06-11 Thread Benjamin Reed
just to clarify i believe you are talking about callbacks on the watch object you are passing in the asynchronous call rather than the asynchronous completion callback. (Henry is making the same assumption.) when you say you are getting the callback 10 times, i believe your are talking about 10

Re: zookeeper.getChildren asynchronous callback

2009-06-10 Thread Henry Robinson
Hi Satish - As you've found out, you can set multiple identical watches per znode - the zookeeper client will not detect identical watches in case you really meant to call them several times. There's no way currently, as far as I know, to clear the watches once they've been set. So your options ar

zookeeper.getChildren asynchronous callback

2009-06-10 Thread Satish Bhatti
I am using the asynchronous (callback) version of zookeeper.getChildren(). That call returns immediately, I then wait for a certain time interval for nodes to appear, and if not I exit the method that made the zookeeper.getChildren() call. Later on, a node gets added under that node and I see in