From: Avinash L. <avi...@gm...> - 2008-06-05 18:05:12
|
I have the following two of code: ZooKeeper zk = new ZooKeeper("cassandra001.snc1.facebook.com:5001", 5000, new WatcherImpl()); Stat stat = zk.exists("/", false); I set my breakpoint at the second line and I see output from the invocation of the process() implemented in the WatcherImpl class. My question is why is the process() being invoked on creation of the ZooKeeper object? Also what is the purpose of the second parameter in the ZooKeeper ctor? Does it have anything to for failure detection ofthe client connected to the ZooKeeper server? Thanks in advance Avinash On Thu, Jun 5, 2008 at 10:49 AM, Avinash Lakshman < avi...@gm...> wrote: > That would be awesome. This allows IMHO a cleaner design with respect to > handling of events. I must add that this is a great piece of software > though. Tremendous job in putting this together. > > Regards > A > > > On Thu, Jun 5, 2008 at 8:44 AM, Benjamin Reed <br...@ya...> wrote: > >> As of the latest release the same watcher will be called for all events. >> The >> event callback includes the path of the znode that changed, which is how >> you >> can distinguish events. >> >> In the next major release, we will be allowing a watch object to be passed >> to >> the requests to make it easier for programmers to control what is going to >> be >> invoked with the watch event arrives. >> >> ben >> >> On Thursday 05 June 2008 00:15:54 Avinash Lakshman wrote: >> > Hi All >> > >> > I am trying to get my feet wet with Zookeeper. I am trying to set up >> watch >> > events for a call to getChildren() for a particular znode. My question >> is >> > whether the same watcher that the ZooKeeper instance was constructed >> with >> > going to be called for all watch events. If so how do I know for what >> event >> > it is being called. >> > >> > Thanks >> > A >> >> >> > |