|
|
-
Some questions about Watches
Rohan Desai 2012-10-12, 20:19
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?
+
Rohan Desai 2012-10-12, 20:19
-
RE: Some questions about Watches
Rakesh R 2012-10-13, 08:39
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?
+
Rakesh R 2012-10-13, 08:39
-
Re: Some questions about Watches
Apostolis Xekoukoulotakis... 2012-10-13, 09:51
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
+
Apostolis Xekoukoulotakis... 2012-10-13, 09:51
|
|