Database Reference
In-Depth Information
}
);
The Watcher interface implemented in the preceding code is an empty
implementation for this example, but it is usually used to respond to all
notifications sent by ZooKeeper. Sometimes the type field of the event
object is empty, in which case the notification pertains to the connection
state.AtothertimestheWatcherisusedtoreceivewatcheventsforrequests
that set a watch without specifying a specific Watcher object.
The commands used by the ZooKeeper client are the same as the commands
described in the previous section: create , delete , exists , getData ,
setData , and getChildren . Each of these commands returns results
immediately. The commands optionally set a watch on the specified path,
either returning the event to the client-level watch specified earlier or to
another Watcher object that is passed into the command. The easiest way to
see this in action is through an example.
Search WWH ::




Custom Search