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:

  1. Create a znode zcz_c with 8090 as the port value.
newZnode = create("/config/port", 8090, EPHEMERAL)
  1. Each process is called with the full path of its zcz_c and gets its configuration from zcz_c
...
Access this course and 1400+ top-rated courses and projects.