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 void
createSessionTracker()
int
getGlobalOutstandingLimit()
Leader
getLeader()
long
getServerId()
Returns the id of the associated QuorumPeer, which will do for a unique id of this server.java.lang.String
getState()
protected void
registerJMX()
void
registerJMX(LeaderBean leaderBean, LocalPeerBean localPeerBean)
protected void
revalidateSession(ServerCnxn cnxn, long sessionId, int sessionTimeout)
protected void
setupRequestProcessors()
protected void
startSessionTracker()
boolean
touch(long sess, int to)
protected void
unregisterJMX()
protected void
unregisterJMX(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:
setupRequestProcessors
in classZooKeeperServer
-
getGlobalOutstandingLimit
public int getGlobalOutstandingLimit()
- Overrides:
getGlobalOutstandingLimit
in classZooKeeperServer
-
createSessionTracker
public void createSessionTracker()
- Overrides:
createSessionTracker
in classZooKeeperServer
-
startSessionTracker
protected void startSessionTracker()
- Overrides:
startSessionTracker
in classZooKeeperServer
-
touch
public boolean touch(long sess, int to)
-
registerJMX
protected void registerJMX()
- Overrides:
registerJMX
in classZooKeeperServer
-
registerJMX
public void registerJMX(LeaderBean leaderBean, LocalPeerBean localPeerBean)
-
unregisterJMX
protected void unregisterJMX()
- Overrides:
unregisterJMX
in classZooKeeperServer
-
unregisterJMX
protected void unregisterJMX(Leader leader)
-
getState
public java.lang.String getState()
- Specified by:
getState
in interfaceServerStats.Provider
- Overrides:
getState
in classZooKeeperServer
-
getServerId
public long getServerId()
Returns the id of the associated QuorumPeer, which will do for a unique id of this server.- Specified by:
getServerId
in interfaceSessionTracker.SessionExpirer
- Overrides:
getServerId
in classZooKeeperServer
-
revalidateSession
protected void revalidateSession(ServerCnxn cnxn, long sessionId, int sessionTimeout) throws java.io.IOException
- Overrides:
revalidateSession
in classZooKeeperServer
- Throws:
java.io.IOException
-
-