Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Zookeeper >> mail # user >> Some questions about Watches


+
Rohan Desai 2012-10-12, 20:19
+
Rakesh R 2012-10-13, 08:39
Copy link to this message
-
Re: Some questions about Watches
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 <[EMAIL PROTECTED]>

> 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 [[EMAIL PROTECTED]]
> Sent: Saturday, October 13, 2012 1:49 AM
> To: [EMAIL PROTECTED]
> 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