Zookeeper中几种数据事件的触发、设置条件

本文小结下Zookeeper中4种数据事件(ZOO_CHANGED_EVENT, ZOO_CHILD_EVENT, ZOO_CREATED_EVENT, ZOO_DELETED_EVENT)的触发条件。

如下表所示:

 事件 触发条件  Watcher设置函数
ZOO_CHANGED_EVENT only generated by watches on nodes zoo_exists / zoo_get
ZOO_CHILD_EVENT only generated by watches on the child list of a node zoo_get_children / zoo_get_children2
ZOO_CREATED_EVENT only generated by watches on the child list of a node zoo_exists
ZOO_DELETED_EVENT only generated by watches on nodes zoo_exists / zoo_get

Leave a Reply

Your email address will not be published. Required fields are marked *