zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Reed <br...@yahoo-inc.com>
Subject Re: Regarding the process method of Watcher Interface
Date Mon, 19 Jul 2010 22:03:36 GMT
yes, you (and dave) are correct. watches are invoked sequentially in 
order. the only time you can run into trouble is if you register the 
same watcher object with different zookeeper handles since there is a 
dispatch thread per zookeeper handle.


On 07/19/2010 02:50 PM, Srikanth Bondalapati: wrote:
> Does this mean that, when I am processing one event, then the zookeeper
> won't be firing another event. It does so only when the first event is
> completely processed&  returned by the callback object. Am I correct in my
> interpretation??
> Thanks&  Regards,
> Srikanth.
> On Mon, Jul 19, 2010 at 2:40 PM, Dave Wright<wrightd@gmail.com>  wrote:
>> There is a single thread used to fire notification callbacks, your
>> callbacks will be called in order one at a time and you only need to
>> worry about synchronizing state with the rest of your code.
>> -Dave Wright
>> On Mon, Jul 19, 2010 at 5:37 PM, Srikanth Bondalapati:
>> <sbondalapati@tagged.com>  wrote:
>>> Hi,
>>> I have a class (X) that implements the Watcher Interface. Consider, an
>>> instance of 'X' is registered as a callback object for different Znode
>>> changes. Now, If there are several simultaneous changes that happen on
>> these
>>> registered znodes, then will these events be fired by the zookeeper to
>>> callback object sequentially or should I have to synchronize the
>> process()
>>> method of Watcher interface in order to handle these events sequentially?
>>> Suppose, I have synchronized the process method(), then will the events
>>> fired by zookeeper be missed by the callback object when some other event
>> is
>>> being processed? Or, does the zookeeper ensures that all the events are
>>> finally reached and handled by the callback object?
>>> Thanks&  Regards,
>>> Srikanth.

View raw message