Class WatchStats
java.lang.Object
org.apache.zookeeper.server.watch.WatchStats
Statistics for multiple different watches on one node.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddMode
(WatcherMode mode) Compute stats after given mode attached to node.boolean
hasMode
(WatcherMode mode) Check whether given mode is attached to this node.removeMode
(WatcherMode mode) Compute stats after given mode removed from node.
-
Field Details
-
NONE
Stats that have no watchers attached.This could be used as start point to compute new stats using
addMode(WatcherMode)
.
-
-
Method Details
-
addMode
Compute stats after given mode attached to node.- Parameters:
mode
- watcher mode- Returns:
- a new stats if given mode is not attached to this node before, otherwise old stats
-
removeMode
Compute stats after given mode removed from node.- Parameters:
mode
- watcher mode- Returns:
- null if given mode is the last attached mode, otherwise a new stats
-
hasMode
Check whether given mode is attached to this node.- Parameters:
mode
- watcher mode- Returns:
- true if given mode is attached to this node.
-