Class LocalPeerBean
- java.lang.Object
-
- org.apache.zookeeper.server.quorum.ServerBean
-
- org.apache.zookeeper.server.quorum.LocalPeerBean
-
- All Implemented Interfaces:
ZKMBeanInfo,LocalPeerMXBean,ServerMXBean
public class LocalPeerBean extends ServerBean implements LocalPeerMXBean
Implementation of the local peer MBean interface.
-
-
Constructor Summary
Constructors Constructor Description LocalPeerBean(QuorumPeer peer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetClientAddress()longgetConfigVersion()StringgetElectionAddress()intgetElectionType()intgetInitLimit()StringgetLearnerType()intgetMaxClientCnxnsPerHost()Current maxClientCnxns allowed from a particular hostintgetMaxCnxns()intgetMaxSessionTimeout()intgetMinSessionTimeout()StringgetName()StringgetQuorumAddress()StringgetQuorumSystemInfo()StringgetState()intgetSyncLimit()intgetTick()intgetTickTime()booleanisHidden()If isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools.booleanisLeader()booleanisPartOfEnsemble()voidsetInitLimit(int initLimit)Set the number of ticks that the initial sync phase can takevoidsetSyncLimit(int syncLimit)Set the number of ticks that can pass between sending a request and getting a acknowledgment-
Methods inherited from class org.apache.zookeeper.server.quorum.ServerBean
getStartTime
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.zookeeper.server.quorum.ServerMXBean
getStartTime
-
-
-
-
Constructor Detail
-
LocalPeerBean
public LocalPeerBean(QuorumPeer peer)
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceServerMXBean- Specified by:
getNamein interfaceZKMBeanInfo- Returns:
- name of the server MBean
-
isHidden
public boolean isHidden()
Description copied from interface:ZKMBeanInfoIf 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:
isHiddenin interfaceZKMBeanInfo- Overrides:
isHiddenin classServerBean- Returns:
- true if the MBean is hidden.
-
getTickTime
public int getTickTime()
- Specified by:
getTickTimein interfaceLocalPeerMXBean- Returns:
- the number of milliseconds of each tick
-
getMaxClientCnxnsPerHost
public int getMaxClientCnxnsPerHost()
Description copied from interface:LocalPeerMXBeanCurrent maxClientCnxns allowed from a particular host- Specified by:
getMaxClientCnxnsPerHostin interfaceLocalPeerMXBean
-
getMinSessionTimeout
public int getMinSessionTimeout()
- Specified by:
getMinSessionTimeoutin interfaceLocalPeerMXBean- Returns:
- the minimum number of milliseconds allowed for a session timeout
-
getMaxSessionTimeout
public int getMaxSessionTimeout()
- Specified by:
getMaxSessionTimeoutin interfaceLocalPeerMXBean- Returns:
- the maximum number of milliseconds allowed for a session timeout
-
getInitLimit
public int getInitLimit()
- Specified by:
getInitLimitin interfaceLocalPeerMXBean- Returns:
- the number of ticks that the initial sync phase can take
-
getSyncLimit
public int getSyncLimit()
- Specified by:
getSyncLimitin interfaceLocalPeerMXBean- Returns:
- the number of ticks that can pass between sending a request and getting a acknowledgment
-
setInitLimit
public void setInitLimit(int initLimit)
Description copied from interface:LocalPeerMXBeanSet the number of ticks that the initial sync phase can take- Specified by:
setInitLimitin interfaceLocalPeerMXBean
-
setSyncLimit
public void setSyncLimit(int syncLimit)
Description copied from interface:LocalPeerMXBeanSet the number of ticks that can pass between sending a request and getting a acknowledgment- Specified by:
setSyncLimitin interfaceLocalPeerMXBean
-
getTick
public int getTick()
- Specified by:
getTickin interfaceLocalPeerMXBean- Returns:
- the current tick
-
getState
public String getState()
- Specified by:
getStatein interfaceLocalPeerMXBean- Returns:
- the current server state
-
getQuorumAddress
public String getQuorumAddress()
- Specified by:
getQuorumAddressin interfaceLocalPeerMXBean- Returns:
- the quorum address
-
getElectionType
public int getElectionType()
- Specified by:
getElectionTypein interfaceLocalPeerMXBean- Returns:
- the election type
-
getElectionAddress
public String getElectionAddress()
- Specified by:
getElectionAddressin interfaceLocalPeerMXBean- Returns:
- the election address
-
getClientAddress
public String getClientAddress()
- Specified by:
getClientAddressin interfaceLocalPeerMXBean- Returns:
- the client address
-
getLearnerType
public String getLearnerType()
- Specified by:
getLearnerTypein interfaceLocalPeerMXBean- Returns:
- the learner type
-
getConfigVersion
public long getConfigVersion()
- Specified by:
getConfigVersionin interfaceLocalPeerMXBean- Returns:
- the config version
-
getQuorumSystemInfo
public String getQuorumSystemInfo()
- Specified by:
getQuorumSystemInfoin interfaceLocalPeerMXBean- Returns:
- the quorum system information
-
isPartOfEnsemble
public boolean isPartOfEnsemble()
- Specified by:
isPartOfEnsemblein interfaceLocalPeerMXBean- Returns:
- true if quorum peer is part of the ensemble, false otherwise
-
isLeader
public boolean isLeader()
- Specified by:
isLeaderin interfaceLocalPeerMXBean- Returns:
- true if the peer is the current leader
-
getMaxCnxns
public int getMaxCnxns()
- Specified by:
getMaxCnxnsin interfaceLocalPeerMXBean- Returns:
- Current maxCnxns allowed to a single ZooKeeper server
-
-