Package org.apache.zookeeper.server
Class ZooKeeperServerBean
- java.lang.Object
-
- org.apache.zookeeper.server.ZooKeeperServerBean
-
- All Implemented Interfaces:
ZKMBeanInfo
,ZooKeeperServerMXBean
- Direct Known Subclasses:
FollowerBean
,LeaderBean
,ObserverBean
,ReadOnlyBean
public class ZooKeeperServerBean extends java.lang.Object implements ZooKeeperServerMXBean, ZKMBeanInfo
This class implements the ZooKeeper server MBean interface.
-
-
Field Summary
Fields Modifier and Type Field Description protected ZooKeeperServer
zks
-
Constructor Summary
Constructors Constructor Description ZooKeeperServerBean(ZooKeeperServer zks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getAvgRequestLatency()
java.lang.String
getClientPort()
long
getDataDirSize()
long
getFsyncThresholdExceedCount()
int
getJuteMaxBufferSize()
int
getLastClientResponseSize()
long
getLogDirSize()
int
getMaxClientCnxnsPerHost()
Current maxClientCnxns allowed from a particular hostint
getMaxClientResponseSize()
long
getMaxRequestLatency()
int
getMaxSessionTimeout()
Current maxSessionTimeout of the server in millisecondsint
getMinClientResponseSize()
long
getMinRequestLatency()
int
getMinSessionTimeout()
Current minSessionTimeout of the server in millisecondsjava.lang.String
getName()
long
getNumAliveConnections()
long
getOutstandingRequests()
long
getPacketsReceived()
long
getPacketsSent()
java.lang.String
getSecureClientAddress()
java.lang.String
getSecureClientPort()
java.lang.String
getStartTime()
int
getTickTime()
Current TickTime of server in millisecondslong
getTxnLogElapsedSyncTime()
Returns the elapsed sync of time of transaction log in milliseconds.java.lang.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
resetFsyncThresholdExceedCount()
Reset Fsync Threshold Exceed Count statistics only.void
resetLatency()
Reset min/avg/max latency statisticsvoid
resetMaxLatency()
Reset max latency statistics only.void
resetStatistics()
Reset packet and latency statisticsvoid
setMaxClientCnxnsPerHost(int max)
Set maxClientCnxns allowed from a particular hostvoid
setMaxSessionTimeout(int max)
Set maxSessionTimeout of server in millisecondsvoid
setMinSessionTimeout(int min)
Set minSessionTimeout of server in millisecondsvoid
setTickTime(int tickTime)
Set TickTime of server in milliseconds
-
-
-
Field Detail
-
zks
protected final ZooKeeperServer zks
-
-
Constructor Detail
-
ZooKeeperServerBean
public ZooKeeperServerBean(ZooKeeperServer zks)
-
-
Method Detail
-
getClientPort
public java.lang.String getClientPort()
- Specified by:
getClientPort
in interfaceZooKeeperServerMXBean
- Returns:
- the server socket port number
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceZKMBeanInfo
- 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 interfaceZKMBeanInfo
- Returns:
- true if the MBean is hidden.
-
getStartTime
public java.lang.String getStartTime()
- Specified by:
getStartTime
in interfaceZooKeeperServerMXBean
- Returns:
- time the server was started
-
getVersion
public java.lang.String getVersion()
- Specified by:
getVersion
in interfaceZooKeeperServerMXBean
- Returns:
- the zookeeper server version
-
getAvgRequestLatency
public long getAvgRequestLatency()
- Specified by:
getAvgRequestLatency
in interfaceZooKeeperServerMXBean
- Returns:
- average request latency in ms
-
getMaxRequestLatency
public long getMaxRequestLatency()
- Specified by:
getMaxRequestLatency
in interfaceZooKeeperServerMXBean
- Returns:
- max request latency in ms
-
getMinRequestLatency
public long getMinRequestLatency()
- Specified by:
getMinRequestLatency
in interfaceZooKeeperServerMXBean
- Returns:
- min request latency in ms
-
getOutstandingRequests
public long getOutstandingRequests()
- Specified by:
getOutstandingRequests
in interfaceZooKeeperServerMXBean
- Returns:
- number of outstanding requests.
-
getTickTime
public int getTickTime()
Description copied from interface:ZooKeeperServerMXBean
Current TickTime of server in milliseconds- Specified by:
getTickTime
in interfaceZooKeeperServerMXBean
-
setTickTime
public void setTickTime(int tickTime)
Description copied from interface:ZooKeeperServerMXBean
Set TickTime of server in milliseconds- Specified by:
setTickTime
in interfaceZooKeeperServerMXBean
-
getMaxClientCnxnsPerHost
public int getMaxClientCnxnsPerHost()
Description copied from interface:ZooKeeperServerMXBean
Current maxClientCnxns allowed from a particular host- Specified by:
getMaxClientCnxnsPerHost
in interfaceZooKeeperServerMXBean
-
setMaxClientCnxnsPerHost
public void setMaxClientCnxnsPerHost(int max)
Description copied from interface:ZooKeeperServerMXBean
Set maxClientCnxns allowed from a particular host- Specified by:
setMaxClientCnxnsPerHost
in interfaceZooKeeperServerMXBean
-
getMinSessionTimeout
public int getMinSessionTimeout()
Description copied from interface:ZooKeeperServerMXBean
Current minSessionTimeout of the server in milliseconds- Specified by:
getMinSessionTimeout
in interfaceZooKeeperServerMXBean
-
setMinSessionTimeout
public void setMinSessionTimeout(int min)
Description copied from interface:ZooKeeperServerMXBean
Set minSessionTimeout of server in milliseconds- Specified by:
setMinSessionTimeout
in interfaceZooKeeperServerMXBean
-
getMaxSessionTimeout
public int getMaxSessionTimeout()
Description copied from interface:ZooKeeperServerMXBean
Current maxSessionTimeout of the server in milliseconds- Specified by:
getMaxSessionTimeout
in interfaceZooKeeperServerMXBean
-
setMaxSessionTimeout
public void setMaxSessionTimeout(int max)
Description copied from interface:ZooKeeperServerMXBean
Set maxSessionTimeout of server in milliseconds- Specified by:
setMaxSessionTimeout
in interfaceZooKeeperServerMXBean
-
getDataDirSize
public long getDataDirSize()
- Specified by:
getDataDirSize
in interfaceZooKeeperServerMXBean
- Returns:
- estimated size of data directory in bytes
-
getLogDirSize
public long getLogDirSize()
- Specified by:
getLogDirSize
in interfaceZooKeeperServerMXBean
- Returns:
- estimated size of log directory in bytes
-
getPacketsReceived
public long getPacketsReceived()
- Specified by:
getPacketsReceived
in interfaceZooKeeperServerMXBean
- Returns:
- number of packets received so far
-
getPacketsSent
public long getPacketsSent()
- Specified by:
getPacketsSent
in interfaceZooKeeperServerMXBean
- Returns:
- number of packets sent so far
-
getFsyncThresholdExceedCount
public long getFsyncThresholdExceedCount()
- Specified by:
getFsyncThresholdExceedCount
in interfaceZooKeeperServerMXBean
- Returns:
- number of fsync threshold exceeds so far
-
resetLatency
public void resetLatency()
Description copied from interface:ZooKeeperServerMXBean
Reset min/avg/max latency statistics- Specified by:
resetLatency
in interfaceZooKeeperServerMXBean
-
resetMaxLatency
public void resetMaxLatency()
Description copied from interface:ZooKeeperServerMXBean
Reset max latency statistics only.- Specified by:
resetMaxLatency
in interfaceZooKeeperServerMXBean
-
resetFsyncThresholdExceedCount
public void resetFsyncThresholdExceedCount()
Description copied from interface:ZooKeeperServerMXBean
Reset Fsync Threshold Exceed Count statistics only.- Specified by:
resetFsyncThresholdExceedCount
in interfaceZooKeeperServerMXBean
-
resetStatistics
public void resetStatistics()
Description copied from interface:ZooKeeperServerMXBean
Reset packet and latency statistics- Specified by:
resetStatistics
in interfaceZooKeeperServerMXBean
-
getNumAliveConnections
public long getNumAliveConnections()
- Specified by:
getNumAliveConnections
in interfaceZooKeeperServerMXBean
- Returns:
- number of alive client connections
-
getSecureClientPort
public java.lang.String getSecureClientPort()
- Specified by:
getSecureClientPort
in interfaceZooKeeperServerMXBean
- Returns:
- secure client port
-
getSecureClientAddress
public java.lang.String getSecureClientAddress()
- Specified by:
getSecureClientAddress
in interfaceZooKeeperServerMXBean
- Returns:
- secure client address
-
getTxnLogElapsedSyncTime
public long getTxnLogElapsedSyncTime()
Description copied from interface:ZooKeeperServerMXBean
Returns the elapsed sync of time of transaction log in milliseconds.- Specified by:
getTxnLogElapsedSyncTime
in interfaceZooKeeperServerMXBean
-
getJuteMaxBufferSize
public int getJuteMaxBufferSize()
- Specified by:
getJuteMaxBufferSize
in interfaceZooKeeperServerMXBean
- Returns:
- Returns the value of the following config setting: jute.maxbuffer
-
getLastClientResponseSize
public int getLastClientResponseSize()
- Specified by:
getLastClientResponseSize
in interfaceZooKeeperServerMXBean
- Returns:
- size of latest generated client response
-
getMinClientResponseSize
public int getMinClientResponseSize()
- Specified by:
getMinClientResponseSize
in interfaceZooKeeperServerMXBean
- Returns:
- size of smallest generated client response
-
getMaxClientResponseSize
public int getMaxClientResponseSize()
- Specified by:
getMaxClientResponseSize
in interfaceZooKeeperServerMXBean
- Returns:
- size of largest generated client response
-
-