zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apostolis Xekoukoulotakis <xekou...@gmail.com>
Subject Re: Some questions about Watches
Date Sat, 13 Oct 2012 09:51:15 GMT
I had the exact same questions while reading the programmers guide. The
guide should change to answer them more explicitly.

2012/10/13 Rakesh R <rakeshr@huawei.com>

> Hi Rohan,
>
> >>>>>>>   1. If my session has a default watcher w, and I make a
call that
> sets
> another watcher w' for a specific znode, will both w and w' get called if
> the znode changes?
>
> Default watcher w will only carry the zookeeper session states
> Disconnected, Expired, SyncConnected, AuthFailed etc events. This Watcher
> is notified when any state change occurs in the client for example, when
> you successfully establish a connection, this watcher will receive a
> SyncConnected event or if the client's session expires will trigger Expired
> etc.
>
> w' is specially meant for watching the znode and here the default watcher
> w will not receive notification on znode changes. But he will recieve state
> changes as explained below.
>
>  >>>>>>>2. If my session expires, on reconnect willl both w and
w' be
> notified
> of the session expiry or just w?
>
> Here both w and w'  will be notified and sequence will be first disconnect
> event, then expiry event.
>
>
> -Rakesh
> ________________________________________
> From: Rohan Desai [desai.p.rohan@gmail.com]
> Sent: Saturday, October 13, 2012 1:49 AM
> To: user@zookeeper.apache.org
> Subject: Some questions about Watches
>
> I had a couple questions about ZooKeeper watches that weren't immediately
> clear from the programmer's guide
>    1. If my session has a default watcher w, and I make a call that sets
> another watcher w' for a specific znode, will both w and w' get called if
> the znode changes?
>    2. If my session expires, on reconnect willl both w and w' be notified
> of the session expiry or just w?
>



-- 


Sincerely yours,

     Apostolis Xekoukoulotakis

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message