org.apache.zookeeper.server.quorum
Class LeaderZooKeeperServer
java.lang.Object
org.apache.zookeeper.server.ZooKeeperServer
org.apache.zookeeper.server.quorum.LeaderZooKeeperServer
- All Implemented Interfaces:
- ServerStats.Provider, SessionTracker.SessionExpirer
public class LeaderZooKeeperServer
- extends ZooKeeperServer
Just like the standard ZooKeeperServer. We just replace the request
processors: PrepRequestProcessor -> ProposalRequestProcessor ->
CommitProcessor -> Leader.ToBeAppliedRequestProcessor ->
FinalRequestProcessor
Fields inherited from class org.apache.zookeeper.server.ZooKeeperServer |
commitLogBuffer, commitLogCount, committedLog, dataTree, DEFAULT_TICK_TIME, firstProcessor, hzxid, jmxDataTreeBean, jmxServerBean, LOG, maxCommittedLog, minCommittedLog, ok, running, sessionsWithTimeouts, sessionTracker, tickTime |
Methods inherited from class org.apache.zookeeper.server.ZooKeeperServer |
addCommittedProposal, byteBuffer2Record, checkPasswd, closeSession, closeSession, decInProcess, deserializeSnapshot, expire, getClientPort, getInProcess, getLastProcessedZxid, getLogWriter, getOutstandingRequests, getServerCnxnFactory, getServerId, getSnapCount, getTickTime, getTreeBuilder, getTxnLogFactory, getZxid, incInProcess, isRunning, killSession, loadData, reopenSession, serializeSnapshot, serverStats, setOwner, setServerCnxnFactory, setTickTime, setTreeBuilder, setTxnLogFactory, setZxid, shutdown, startup, submitRequest, takeSnapshot, truncateLog |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getLeader
public Leader getLeader()
setupRequestProcessors
protected void setupRequestProcessors()
- Overrides:
setupRequestProcessors
in class ZooKeeperServer
getGlobalOutstandingLimit
public int getGlobalOutstandingLimit()
- Overrides:
getGlobalOutstandingLimit
in class ZooKeeperServer
createSessionTracker
protected void createSessionTracker()
- Overrides:
createSessionTracker
in class ZooKeeperServer
touch
public boolean touch(long sess,
int to)
registerJMX
protected void registerJMX()
- Overrides:
registerJMX
in class ZooKeeperServer
registerJMX
public void registerJMX(LeaderBean leaderBean,
LocalPeerBean localPeerBean)
unregisterJMX
protected void unregisterJMX()
- Overrides:
unregisterJMX
in class ZooKeeperServer
unregisterJMX
protected void unregisterJMX(Leader leader)
getState
public String getState()
- Specified by:
getState
in interface ServerStats.Provider
- Overrides:
getState
in class ZooKeeperServer
revalidateSession
protected void revalidateSession(ServerCnxn cnxn,
long sessionId,
int sessionTimeout)
throws IOException,
InterruptedException
- Overrides:
revalidateSession
in class ZooKeeperServer
- Throws:
IOException
InterruptedException