In the previous chapter, you learned about the ZooKeeper client API and programming using the APIs. You saw how to write a client to connect to the ZooKeeper server instance and execute methods to carry out operations in the ZooKeeper namespace. You also learned how to implement watchers in a client so as to register for specific events and get notifications when such events occur, all in real time.
The simple yet powerful and elegant programming model of ZooKeeper enables us to implement high-level primitives for distributed systems. For example, we used the concept of ephemeral znodes to build an emulation of a cluster monitor in the previous chapter.
In this chapter, you will learn:
How to carry out common distributed system tasks such as leader election, group memberships, and two-phase commit protocol
How to implement a few distributed data structures such as barriers, locks, and queues
The high-level constructs outlined in this chapter...