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, ObserverBean, ReadOnlyBean

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()
           
 int getMaxClientCnxnsPerHost()
          Current maxClientCnxns allowed from a particular host
 long getMaxRequestLatency()
           
 int getMaxSessionTimeout()
          Current maxSessionTimeout of the server in milliseconds
 long getMinRequestLatency()
           
 int getMinSessionTimeout()
          Current minSessionTimeout of the server in milliseconds
 String getName()
           
 long getOutstandingRequests()
           
 long getPacketsReceived()
           
 long getPacketsSent()
           
 String getStartTime()
           
 int getTickTime()
          Current TickTime of server in milliseconds
 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 setMaxClientCnxnsPerHost(int max)
          Set maxClientCnxns allowed from a particular host
 void setMaxSessionTimeout(int max)
          Set maxSessionTimeout of server in milliseconds
 void setMinSessionTimeout(int min)
          Set minSessionTimeout of server in milliseconds
 void setTickTime(int tickTime)
          Set TickTime of server in milliseconds
 
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 in milliseconds

Specified by:
getTickTime in interface ZooKeeperServerMXBean

setTickTime

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

Specified by:
setTickTime in interface ZooKeeperServerMXBean

getMaxClientCnxnsPerHost

public int getMaxClientCnxnsPerHost()
Description copied from interface: ZooKeeperServerMXBean
Current maxClientCnxns allowed from a particular host

Specified by:
getMaxClientCnxnsPerHost in interface ZooKeeperServerMXBean

setMaxClientCnxnsPerHost

public void setMaxClientCnxnsPerHost(int max)
Description copied from interface: ZooKeeperServerMXBean
Set maxClientCnxns allowed from a particular host

Specified by:
setMaxClientCnxnsPerHost in interface ZooKeeperServerMXBean

getMinSessionTimeout

public int getMinSessionTimeout()
Description copied from interface: ZooKeeperServerMXBean
Current minSessionTimeout of the server in milliseconds

Specified by:
getMinSessionTimeout in interface ZooKeeperServerMXBean

setMinSessionTimeout

public void setMinSessionTimeout(int min)
Description copied from interface: ZooKeeperServerMXBean
Set minSessionTimeout of server in milliseconds

Specified by:
setMinSessionTimeout in interface ZooKeeperServerMXBean

getMaxSessionTimeout

public int getMaxSessionTimeout()
Description copied from interface: ZooKeeperServerMXBean
Current maxSessionTimeout of the server in milliseconds

Specified by:
getMaxSessionTimeout in interface ZooKeeperServerMXBean

setMaxSessionTimeout

public void setMaxSessionTimeout(int max)
Description copied from interface: ZooKeeperServerMXBean
Set maxSessionTimeout of server in milliseconds

Specified by:
setMaxSessionTimeout 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


Copyright © 2011 The Apache Software Foundation