Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

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


Copy link to this message
-
RE: Some questions about Watches
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?
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB