org.apache.zookeeper.server.quorum
Class FollowerZooKeeperServer

java.lang.Object
  extended by org.apache.zookeeper.server.ZooKeeperServer
      extended by org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
          extended by org.apache.zookeeper.server.quorum.LearnerZooKeeperServer
              extended by 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.MissingSessionException
 
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, hzxid, jmxDataTreeBean, jmxServerBean, maxSessionTimeout, minSessionTimeout, ok, running, sessionTracker, tickTime
 
Method Summary
 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.
 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, unregisterJMX, unregisterJMX
 
Methods inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
dumpConf
 
Methods inherited from class org.apache.zookeeper.server.ZooKeeperServer
checkPasswd, closeSession, closeSession, decInProcess, dumpEphemerals, expire, finishSessionInit, getClientPort, getInProcess, getLastProcessedZxid, getMaxSessionTimeout, getMinSessionTimeout, getOutstandingRequests, getServerCnxnFactory, getSnapCount, getTickTime, getTxnLogFactory, getZKDatabase, getZxid, incInProcess, isRunning, killSession, loadData, processConnectRequest, processPacket, reopenSession, serverStats, setMaxSessionTimeout, setMinSessionTimeout, setOwner, setServerCnxnFactory, setTickTime, setTxnLogFactory, setZKDatabase, setZxid, shouldThrottle, startdata, startup, submitRequest, takeSnapshot, truncateLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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 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 © 2011 The Apache Software Foundation