org.apache.zookeeper.server.quorum
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.
Fields inherited from class org.apache.zookeeper.server.ZooKeeperServer |
DEFAULT_TICK_TIME, firstProcessor, hzxid, jmxDataTreeBean, jmxServerBean, maxSessionTimeout, minSessionTimeout, ok, running, sessionTracker, tickTime |
Methods inherited from class org.apache.zookeeper.server.ZooKeeperServer |
byteBuffer2Record, checkPasswd, closeSession, closeSession, decInProcess, dumpEphemerals, expire, getClientPort, getInProcess, getLastProcessedZxid, getMaxSessionTimeout, getMinSessionTimeout, getOutstandingRequests, getServerCnxnFactory, getSnapCount, getTickTime, getTxnLogFactory, getZKDatabase, getZxid, incInProcess, isRunning, killSession, loadData, processTxn, reopenSession, serverStats, setMaxSessionTimeout, setMinSessionTimeout, setOwner, setServerCnxnFactory, setTickTime, setTxnLogFactory, setZKDatabase, setZxid, startdata, startup, submitRequest, takeSnapshot, truncateLog |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getFollower
public Follower getFollower()
setupRequestProcessors
protected void setupRequestProcessors()
- Overrides:
setupRequestProcessors
in class ZooKeeperServer
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 class ZooKeeperServer
shutdown
public void shutdown()
- Overrides:
shutdown
in class ZooKeeperServer
getState
public java.lang.String getState()
- Specified by:
getState
in interface ServerStats.Provider
- Overrides:
getState
in class ZooKeeperServer
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 class LearnerZooKeeperServer
Copyright © 2012 The Apache Software Foundation