. victimisation ZooKeeper API, an application will connect, interact, manipulate data, coordinate, and at last disconnect from a ZooKeeper ensemble.
Application interacting with ZooKeeper ensemble is referred as ZooKeeper consumer or just consumer.
Znode is that the core element of ZooKeeper ensemble and ZooKeeper API provides alittle set of strategies to manipulate all the small print of znode with ZooKeeper ensemble.
A client should follow the steps given below to have a transparent and clean interaction with ZooKeeper ensemble.
Connect to the ZooKeeper ensemble. ZooKeeper ensemble assign a Session ID for the client.
Send heartbeats to the server sporadically. Otherwise, the ZooKeeper ensemble expires the Session ID and therefore the client has to reconnect.
Get / Set the znodes as long as a session ID is active.
Disconnect from the ZooKeeper ensemble, once all the tasks area unit completed. If the client is inactive for a chronic time, then the ZooKeeper ensemble can automatically disconnect the client.