org.apache.zookeeper.server
Class ZooKeeperServerBean

java.lang.Object
  extended by org.apache.zookeeper.server.ZooKeeperServerBean
All Implemented Interfaces:
ZKMBeanInfo, ZooKeeperServerMXBean
Direct Known Subclasses:
FollowerBean, LeaderBean

public class ZooKeeperServerBean
extends Object
implements ZooKeeperServerMXBean, ZKMBeanInfo

This class implements the ZooKeeper server MBean interface.


Field Summary
protected  ZooKeeperServer zks
           
 
Constructor Summary
ZooKeeperServerBean(ZooKeeperServer zks)
           
 
Method Summary
 long getAvgRequestLatency()
           
 String getClientPort()
           
 long getMaxRequestLatency()
           
 long getMinRequestLatency()
           
 String getName()
           
 long getOutstandingRequests()
           
 long getPacketsReceived()
           
 long getPacketsSent()
           
 String getStartTime()
           
 int getTickTime()
          Current TickTime of server
 String getVersion()
           
 boolean isHidden()
          If isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools.
 void resetLatency()
          Reset min/avg/max latency statistics
 void resetMaxLatency()
          Reset max latency statistics only.
 void resetStatistics()
          Reset packet and latency statistics
 void setTickTime(int tickTime)
          Set TickTime of server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

zks

protected final ZooKeeperServer zks
Constructor Detail

ZooKeeperServerBean

public ZooKeeperServerBean(ZooKeeperServer zks)
Method Detail

getClientPort

public String getClientPort()
Specified by:
getClientPort in interface ZooKeeperServerMXBean
Returns:
the server socket port number

getName

public String getName()
Specified by:
getName in interface ZKMBeanInfo
Returns:
a string identifying the MBean

isHidden

public boolean isHidden()
Description copied from interface: ZKMBeanInfo
If isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools. Used for grouping MBeans.

Specified by:
isHidden in interface ZKMBeanInfo
Returns:
true if the MBean is hidden.

getStartTime

public String getStartTime()
Specified by:
getStartTime in interface ZooKeeperServerMXBean
Returns:
time the server was started

getVersion

public String getVersion()
Specified by:
getVersion in interface ZooKeeperServerMXBean
Returns:
the zookeeper server version

getAvgRequestLatency

public long getAvgRequestLatency()
Specified by:
getAvgRequestLatency in interface ZooKeeperServerMXBean
Returns:
average request latency in ms

getMaxRequestLatency

public long getMaxRequestLatency()
Specified by:
getMaxRequestLatency in interface ZooKeeperServerMXBean
Returns:
max request latency in ms

getMinRequestLatency

public long getMinRequestLatency()
Specified by:
getMinRequestLatency in interface ZooKeeperServerMXBean
Returns:
min request latency in ms

getOutstandingRequests

public long getOutstandingRequests()
Specified by:
getOutstandingRequests in interface ZooKeeperServerMXBean
Returns:
number of outstanding requests.

getTickTime

public int getTickTime()
Description copied from interface: ZooKeeperServerMXBean
Current TickTime of server

Specified by:
getTickTime in interface ZooKeeperServerMXBean

setTickTime

public void setTickTime(int tickTime)
Description copied from interface: ZooKeeperServerMXBean
Set TickTime of server

Specified by:
setTickTime in interface ZooKeeperServerMXBean

getPacketsReceived

public long getPacketsReceived()
Specified by:
getPacketsReceived in interface ZooKeeperServerMXBean
Returns:
number of packets received so far

getPacketsSent

public long getPacketsSent()
Specified by:
getPacketsSent in interface ZooKeeperServerMXBean
Returns:
number of packets sent so far

resetLatency

public void resetLatency()
Description copied from interface: ZooKeeperServerMXBean
Reset min/avg/max latency statistics

Specified by:
resetLatency in interface ZooKeeperServerMXBean

resetMaxLatency

public void resetMaxLatency()
Description copied from interface: ZooKeeperServerMXBean
Reset max latency statistics only.

Specified by:
resetMaxLatency in interface ZooKeeperServerMXBean

resetStatistics

public void resetStatistics()
Description copied from interface: ZooKeeperServerMXBean
Reset packet and latency statistics

Specified by:
resetStatistics in interface ZooKeeperServerMXBean