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 Plain View
Zookeeper >> mail # user >> zookeeper discussion on watches.


+
sunil singh 2012-08-21, 07:49
Copy link to this message
-
Re: zookeeper discussion on watches.
Hi Sunil,

Have you gone over the developer's guide docs on the website:
http://zookeeper.apache.org/doc/trunk/zookeeperProgrammers.html#ch_zkWatches?
It is pretty simple to use watches and the text on that page should
almost be all you need to use it.

Also, the zkCli.sh CLI program does show how to set a watch when you
type "help" on it:

> get path [watch]

So for example, if you want to set a watch from the CLI on the znode
/hbase/master, you may do:

> get /hbase/master true

(The new CLI format on trunk is to do as "get -w /hbase/master"
instead. But the above should work and warn even if you are on trunk
today.)

Then if "printwatches" is on (it is on by default), you should be able
to see any changes made to that znode by other processes.

For instance, if I deleted the node via a "delete /hbase/master", I'd
see this on the shell:

WATCHER::

WatchedEvent state:SyncConnected type:NodeDeleted path:/hbase/hbaseid

Hope this helps!

On Tue, Aug 21, 2012 at 1:19 PM, sunil singh <[EMAIL PROTECTED]> wrote:
> Hi guys... m working on zookeeper and its really difficult to find something
> precise on watches.
> So lets start on discussion on watches from beginning so that all the
> developer around the world get help and share their experience.
> Q.1) how to set watch on a znode so that clients are notified when the data
> of the znode changes.
>
>
>
> --
> View this message in context: http://zookeeper-user.578899.n2.nabble.com/zookeeper-discussion-on-watches-tp7577815.html
> Sent from the zookeeper-user mailing list archive at Nabble.com.

--
Harsh J
+
sunil singh 2012-08-22, 05:07
+
Harsh J 2012-08-23, 13:52
+
Ankur C. Goel 2012-08-21, 20:22
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