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 <
[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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
>>
>>
>>
>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Zookeeper-user mailing list
Zookeeper-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/zookeeper-user

Reply via email to