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.
-
-
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
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.Learner
getLearner()
Abstract method to return the learner associated with this server.Observer
getObserver()
java.lang.String
getState()
protected void
setupRequestProcessors()
Set up the request processors for an Observer: firstProcesor->commitProcessor->finalProcessorvoid
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, getGlobalOutstandingLimit, 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
-
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 classLearnerZooKeeperServer
-
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 classZooKeeperServer
-
sync
public void sync()
-
getState
public java.lang.String getState()
- Specified by:
getState
in interfaceServerStats.Provider
- Overrides:
getState
in classZooKeeperServer
-
shutdown
public void shutdown()
- Overrides:
shutdown
in classZooKeeperServer
-
-