org.apache.zookeeper.server.quorum
Class ObserverZooKeeperServer
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.ObserverZooKeeperServer
- All Implemented Interfaces:
- ServerStats.Provider, SessionTracker.SessionExpirer
public class ObserverZooKeeperServer
- extends LearnerZooKeeperServer
A ZooKeeperServer for the Observer node type. Not much is different, but
we anticipate specializing the request processors in the future.
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, getGlobalOutstandingLimit, 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, shutdown, startdata, startup, submitRequest, takeSnapshot, truncateLog |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getObserver
public Observer getObserver()
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
commitRequest
public void commitRequest(Request request)
- Unlike a Follower, which sees a full request only during the PROPOSAL
phase, Observers get all the data required with the INFORM packet.
This method commits a request that has been unpacked by from an INFORM
received from the Leader.
- Parameters:
request
-
setupRequestProcessors
protected void setupRequestProcessors()
- Set up the request processors for an Observer:
firstProcesor->commitProcessor->finalProcessor
- Overrides:
setupRequestProcessors
in class ZooKeeperServer
sync
public void sync()
getState
public String getState()
- Specified by:
getState
in interface ServerStats.Provider
- Overrides:
getState
in class ZooKeeperServer
Copyright © 2012 The Apache Software Foundation