Watches and ZooKeeper operations

The write operations in ZooKeeper are atomic and durable. There is the guarantee of a successful write operation if it has been written to persistent storage on a majority of ZooKeeper's servers. However, the eventual consistency model of ZooKeeper permits reads to log the latest state of the ZooKeeper service, and the sync operation allows a client to be up-to-date with the most recent state of the ZooKeeper service.

The read operations in znodes, such as exists, getChildren, and getData, allow watches to be set on them. On the other hand, the watches triggered by znode's write operations, such as create, delete, and setData ACL operations do not participate in watches.

The following are the types of watch events ...

Get Apache ZooKeeper Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.