Primitives of ZooKeeper
Learn to implement some example primitives of ZooKeeper using the clientAPI.
ZooKeeper helps clients to implement a set of primitives using the client API. ZooKeeper servers do not know about these powerful primitives because there isn’t any function for each of them. For the servers, these are just a set of functions from the client API sent by the client. Some of the common primitives are wait-free, which are group membership and configuration management. These primitives are either updated once or very often, and are mostly used for reading which makes it wait-free. Others, like rendezvous and locks, are based on waiting unless an event, such as a watch, are not triggered.
Configuration management
ZooKeeper allows the client to implement dynamic configuration by using the following steps:
- Create a znode with
8090
as the port value.
newZnode = create("/config/port", 8090, EPHEMERAL)
- Each process is called with the full path of its and gets its configuration from