Returns a view of this client in which operations are performed asynchronously.
Returns a view of this client in which operations are performed asynchronously.
an asynchronous view of this client
Asynchronously gets the children of the node specified by the given path and additionally sets a watch for any changes.
Asynchronously gets the children of the node specified by the given path and additionally sets a watch for any changes.
The watch is triggered when one of the following conditions occur:
the path of the node
a future, which upon success, yields an unordered sequence containing the names of each child node, otherwise one of the following exceptions:
Closes the client connection to the ZooKeeper cluster.
Closes the client connection to the ZooKeeper cluster.
A consequence of closing the connection is that ZooKeeper will expire the corresponding session, which further implies that all ephemeral nodes created by this client will be deleted.
Ensures that the value of a node, specified by the given path, is synchronized across the ZooKeeper cluster.
Ensures that the value of a node, specified by the given path, is synchronized across the ZooKeeper cluster.
An important note on consistency: ZooKeeper does not guarantee, for any given point in time, that all clients will have a consistent view of the cluster. Since reads can be served by any node in the cluster, whereas writes are serialized through the leader, there exists the possibility in which two separate clients may have inconsistent views. This scenario occurs when the leader commits a change once consensus is reached, but the change has not yet propagated across the cluster. Therefore, reads occurring before the commit has propagated will be globally inconsistent. This behavior is normally acceptable, but for some use cases, writes may need to be globally visible before subsequent reads occur.
This method is particularly useful when a write occurring in one process is followed by a read in another process. For example, consider the following sequence of operations:
The assumption is that process B expects to see the value written by process A, but as mentioned, ZooKeeper does not make this guarantee. A call to this method before process B attempts to read the value ensures that all prior writes are consistently applied across the cluster, thus observing the write in process A.
a future that completes when the node is synchronized across the cluster
Asynchronously determines the status of the node specified by the given path if it exists and additionally sets a watch for any changes.
Asynchronously determines the status of the node specified by the given path if it exists and additionally sets a watch for any changes.
The watch is triggered when one of the following conditions occur:
the path of the node
a future yielding a Some
containing the node status or None
if the node does not exist
Asynchronously gets the data and status of the node specified by the given path and additionally sets a watch for any changes.
Asynchronously gets the data and status of the node specified by the given path and additionally sets a watch for any changes.
The watch is triggered when one of the following conditions occur:
the path of the node
a future, which upon success, yields a tuple containing the data and status of the node, otherwise one of the following exceptions:
Returns a view of this client in which operations are performed synchronously.
Returns a view of this client in which operations are performed synchronously.
a synchronous view of this client
A ZooKeeper client with asynchronous and watchable operations.