Class LeaderZooKeeperServer
- java.lang.Object
-
- org.apache.zookeeper.server.ZooKeeperServer
-
- org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
-
- org.apache.zookeeper.server.quorum.LeaderZooKeeperServer
-
- All Implemented Interfaces:
ServerStats.Provider,SessionTracker.SessionExpirer
public class LeaderZooKeeperServer extends QuorumZooKeeperServer
Just like the standard ZooKeeperServer. We just replace the request processors: PrepRequestProcessor -> ProposalRequestProcessor -> CommitProcessor -> Leader.ToBeAppliedRequestProcessor -> FinalRequestProcessor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.zookeeper.server.ZooKeeperServer
ZooKeeperServer.BasicDataTreeBuilder, ZooKeeperServer.DataTreeBuilder, ZooKeeperServer.MissingSessionException, ZooKeeperServer.State
-
-
Field Summary
-
Fields inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
self
-
Fields inherited from class org.apache.zookeeper.server.ZooKeeperServer
DEFAULT_TICK_TIME, firstProcessor, jmxDataTreeBean, jmxServerBean, LOG, maxSessionTimeout, minSessionTimeout, ok, sessionTracker, state, tickTime
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateSessionTracker()intgetGlobalOutstandingLimit()LeadergetLeader()longgetServerId()Returns the id of the associated QuorumPeer, which will do for a unique id of this server.java.lang.StringgetState()protected voidregisterJMX()voidregisterJMX(LeaderBean leaderBean, LocalPeerBean localPeerBean)protected voidrevalidateSession(ServerCnxn cnxn, long sessionId, int sessionTimeout)protected voidsetupRequestProcessors()protected voidstartSessionTracker()booleantouch(long sess, int to)protected voidunregisterJMX()protected voidunregisterJMX(Leader leader)-
Methods inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
dumpConf, setState
-
Methods inherited from class org.apache.zookeeper.server.ZooKeeperServer
canShutdown, checkPasswd, closeSession, closeSession, decInProcess, dumpEphemerals, expire, finishSessionInit, getClientPort, getInProcess, getLastProcessedZxid, getMaxSessionTimeout, getMinSessionTimeout, getNumAliveConnections, getOutstandingRequests, getServerCnxnFactory, getSnapCount, getTickTime, getTxnLogFactory, getZKDatabase, getZooKeeperServerListener, getZxid, incInProcess, isRunning, killSession, loadData, processConnectRequest, processPacket, processTxn, reopenSession, serverStats, setMaxSessionTimeout, setMinSessionTimeout, setOwner, setServerCnxnFactory, setTickTime, setTxnLogFactory, setZKDatabase, setZxid, shouldThrottle, shutdown, shutdown, startdata, startup, submitRequest, takeSnapshot, truncateLog
-
-
-
-
Method Detail
-
getLeader
public Leader getLeader()
-
setupRequestProcessors
protected void setupRequestProcessors()
- Overrides:
setupRequestProcessorsin classZooKeeperServer
-
getGlobalOutstandingLimit
public int getGlobalOutstandingLimit()
- Overrides:
getGlobalOutstandingLimitin classZooKeeperServer
-
createSessionTracker
public void createSessionTracker()
- Overrides:
createSessionTrackerin classZooKeeperServer
-
startSessionTracker
protected void startSessionTracker()
- Overrides:
startSessionTrackerin classZooKeeperServer
-
touch
public boolean touch(long sess, int to)
-
registerJMX
protected void registerJMX()
- Overrides:
registerJMXin classZooKeeperServer
-
registerJMX
public void registerJMX(LeaderBean leaderBean, LocalPeerBean localPeerBean)
-
unregisterJMX
protected void unregisterJMX()
- Overrides:
unregisterJMXin classZooKeeperServer
-
unregisterJMX
protected void unregisterJMX(Leader leader)
-
getState
public java.lang.String getState()
- Specified by:
getStatein interfaceServerStats.Provider- Overrides:
getStatein classZooKeeperServer
-
getServerId
public long getServerId()
Returns the id of the associated QuorumPeer, which will do for a unique id of this server.- Specified by:
getServerIdin interfaceSessionTracker.SessionExpirer- Overrides:
getServerIdin classZooKeeperServer
-
revalidateSession
protected void revalidateSession(ServerCnxn cnxn, long sessionId, int sessionTimeout) throws java.io.IOException
- Overrides:
revalidateSessionin classZooKeeperServer- Throws:
java.io.IOException
-
-