org.apache.zookeeper.server.quorum
Class ObserverZooKeeperServer

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.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.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 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()
           
 String getState()
           
protected  void setupRequestProcessors()
          Set up the request processors for an Observer: firstProcesor->commitProcessor->finalProcessor
 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, getGlobalOutstandingLimit, 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, shutdown, 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

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