Class FollowerZooKeeperServer
- java.lang.Object
-
- org.apache.zookeeper.server.ZooKeeperServer
-
- org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
-
- org.apache.zookeeper.server.quorum.LearnerZooKeeperServer
-
- org.apache.zookeeper.server.quorum.FollowerZooKeeperServer
-
- All Implemented Interfaces:
ServerStats.Provider
,SessionTracker.SessionExpirer
public class FollowerZooKeeperServer extends LearnerZooKeeperServer
Just like the standard ZooKeeperServer. We just replace the request processors: FollowerRequestProcessor -> CommitProcessor -> FinalRequestProcessor A SyncRequestProcessor is also spawned off to log proposals from the leader.
-
-
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, maxSessionTimeout, minSessionTimeout, ok, sessionTracker, state, tickTime
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit(long zxid)
When a COMMIT message is received, eventually this method is called, which matches up the zxid from the COMMIT with (hopefully) the head of the pendingTxns queue and hands it to the commitProcessor to commit.Follower
getFollower()
int
getGlobalOutstandingLimit()
Learner
getLearner()
Abstract method to return the learner associated with this server.java.lang.String
getState()
void
logRequest(TxnHeader hdr, org.apache.jute.Record txn)
protected void
setupRequestProcessors()
void
shutdown()
void
sync()
-
Methods inherited from class org.apache.zookeeper.server.quorum.LearnerZooKeeperServer
createSessionTracker, getServerId, getTouchSnapshot, registerJMX, registerJMX, revalidateSession, startSessionTracker, unregisterJMX, unregisterJMX
-
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, startdata, startup, submitRequest, takeSnapshot, truncateLog
-
-
-
-
Method Detail
-
getFollower
public Follower getFollower()
-
setupRequestProcessors
protected void setupRequestProcessors()
- Overrides:
setupRequestProcessors
in classZooKeeperServer
-
logRequest
public void logRequest(TxnHeader hdr, org.apache.jute.Record txn)
-
commit
public void commit(long zxid)
When a COMMIT message is received, eventually this method is called, which matches up the zxid from the COMMIT with (hopefully) the head of the pendingTxns queue and hands it to the commitProcessor to commit.- Parameters:
zxid
- - must correspond to the head of pendingTxns if it exists
-
sync
public void sync()
-
getGlobalOutstandingLimit
public int getGlobalOutstandingLimit()
- Overrides:
getGlobalOutstandingLimit
in classZooKeeperServer
-
shutdown
public void shutdown()
- Overrides:
shutdown
in classZooKeeperServer
-
getState
public java.lang.String getState()
- Specified by:
getState
in interfaceServerStats.Provider
- Overrides:
getState
in classZooKeeperServer
-
getLearner
public Learner getLearner()
Description copied from class:LearnerZooKeeperServer
Abstract method to return the learner associated with this server. Since the Learner may change under our feet (when QuorumPeer reassigns it) we can't simply take a reference here. Instead, we need the subclasses to implement this.- Specified by:
getLearner
in classLearnerZooKeeperServer
-
-