Event monitoring--cache in zookeeper

Source: Internet
Author: User
Tags event listener zookeeper

Recent contact Zookeeper, useful to part of the function, so here is a simple record:

Monitoring of events in curator


The native Zookeeper event listener is implemented with watcher, but watcher monitoring is a one-time, and must be re-registered if the event needs to continue to be monitored.

The cache is used in curator to encapsulate the interception of events, encapsulating 3 types of event snooping in packet Org.apache.curator.framework.recipes.cache.


The cache is divided into three types (in fact, from different dimensions to parse the cache):

1.PathChildrenCache cache listens on a path, a znode child node


2.node cache listens to a node


3.tree Cache listener nodes and the status of child nodes, monitoring nodes in the entire tree

Add event monitoring via AddListener, monitor changes, and provide interfaces to facilitate the implementation of relevant changes.

See for example:

http://colobu.com/2014/12/15/zookeeper-recipes-by-example-5/

http://090508tanjie.iteye.com/blog/2288256

http://my.oschina.net/jiangzhixiong/blog/537706

Event monitoring--cache in zookeeper

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.