Zookeeper watch reference table

Source: Internet
Author: User

Watcher settings are the most common in development. You need to understand some basic features of watcher. Different watcher information is received for different operations on nodes of exists, getdata, and getchild. The change of the parent node and the sun node will not trigger watcher, but the change of the watcher node and the child node will trigger watcher. For details, refer to the table below.

Operation Method Trigger watcher Watcher state Watcher type Watcher path
Create current node Getdata × × × ×
Getchildren 3 4
Exists × × × ×
Set current node Getdata 3 3
Getchildren × × × ×
Exists 3 3
Delete current node Getdata 3 2
Getchildren 3 2
Exists 3 2
Create subnode Getdata × × × ×
Getchildren 3 4
Exists × × × ×
Set subnode Getdata × × × ×
Getchildren × × × ×
Exists × × × ×
Delete subnode Getdata × × × ×
Getchildren 3 4
Exists × × × ×
Restore connection Getdata 1 -1 ×
Getchildren 1 -1 ×
Exists 1 -1 ×
Session restoration has not timed out. Getdata -112 -1 ×
Getchildren -112 -1 ×
Exists -112 -1 ×
Session restoration timeout Getdata 3 -1 ×
Getchildren 3 -1 ×
Exists 3 -1 ×
Note: State = 2 indicates the deletion event; State = 3 indicates the node data change; State = 4 indicates the subnode event; State =-1 indicates the session event. Type =-112 indicates that the session is invalid; type = 1 indicates that the session is being established; tpye = 3 indicates that the session is successfully established. * Indicates no, and √ indicates yes.

Zookeeper watch reference table

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.