Database Reference
In-Depth Information
may write to which part of a hierarchy. This allows for the implementation
of multi-tenant Zookeeper clusters.
Ephemeral Nodes
A znode may be either persistent or ephemeral. With a persistent znode ,
the znode is only destroyed when the delete operation is used to explicitly
remove the znode from ZooKeeper.
Ephemeral nodes, on the other hand, are also destroyed when the client
session that created the node loses contact with the ZooKeeper cluster or
otherwise ends its session. In the former case, the time required for the loss
of contact to cause the destruction of an ephemeral node is controlled by a
heartbeat timeout.
Because they may be destroyed at any time, ephemeral nodes may not
contain children. This may change in future releases of ZooKeeper, but as of
the 3.4 series of releases, ephemeral nodes may be files, but they may not be
directories.
Sequential Nodes
A znode may also be declared as sequential. When a sequential znode is
created, itisassigned amonotonically increasing integer thatisappended to
the node's path.
This serves two useful purposes in many algorithms. First, it provides a
mechanism for creating unique nodes. The counter ensures that a node
name will never be repeated. Secondly, it provides a sorting mechanism
when requesting the children of a parent node. This is used to implement,
among other things, leader elections.
Versions
All znodes ,whentheyarecreated,aregivenaversionnumber.Thisversion
number is incremented whenever the data associated with a node changes.
This version number can be optionally passed to the delete and setData
operations, which allows clients to ensure that they do not accidentally
overwrite changes to a node.
Search WWH ::




Custom Search