org.apache.zookeeper.server.quorum
Class ReadOnlyZooKeeperServer

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.ReadOnlyZooKeeperServer
All Implemented Interfaces:
ServerStats.Provider, SessionTracker.SessionExpirer

public class ReadOnlyZooKeeperServer
extends QuorumZooKeeperServer

A ZooKeeperServer which comes into play when peer is partitioned from the majority. Handles read-only clients, but drops connections from not-read-only ones.

The very first processor in the chain of request processors is a ReadOnlyRequestProcessor which drops state-changing requests.


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, LOG, maxSessionTimeout, minSessionTimeout, ok, running, sessionTracker, tickTime
 
Method Summary
 long getServerId()
          Returns the id of the associated QuorumPeer, which will do for a unique id of this server.
 String getState()
           
protected  void registerJMX()
           
 void registerJMX(ZooKeeperServerBean serverBean, LocalPeerBean localPeerBean)
           
protected  void setupRequestProcessors()
           
 void shutdown()
           
 void startup()
           
protected  void unregisterJMX()
           
protected  void unregisterJMX(ZooKeeperServer zks)
           
 
Methods inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
dumpConf
 
Methods inherited from class org.apache.zookeeper.server.ZooKeeperServer
checkPasswd, closeSession, closeSession, createSessionTracker, decInProcess, dumpEphemerals, expire, finishSessionInit, getClientPort, getGlobalOutstandingLimit, getInProcess, getLastProcessedZxid, getMaxSessionTimeout, getMinSessionTimeout, getOutstandingRequests, getServerCnxnFactory, getSnapCount, getTickTime, getTxnLogFactory, getZKDatabase, getZxid, incInProcess, isRunning, killSession, loadData, processConnectRequest, processPacket, reopenSession, revalidateSession, serverStats, setMaxSessionTimeout, setMinSessionTimeout, setOwner, setServerCnxnFactory, setTickTime, setTxnLogFactory, setZKDatabase, setZxid, shouldThrottle, startdata, submitRequest, takeSnapshot, truncateLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setupRequestProcessors

protected void setupRequestProcessors()
Overrides:
setupRequestProcessors in class ZooKeeperServer

startup

public void startup()
Overrides:
startup in class ZooKeeperServer

registerJMX

protected void registerJMX()
Overrides:
registerJMX in class ZooKeeperServer

registerJMX

public void registerJMX(ZooKeeperServerBean serverBean,
                        LocalPeerBean localPeerBean)

unregisterJMX

protected void unregisterJMX()
Overrides:
unregisterJMX in class ZooKeeperServer

unregisterJMX

protected void unregisterJMX(ZooKeeperServer zks)

getState

public String getState()
Specified by:
getState in interface ServerStats.Provider
Overrides:
getState in class ZooKeeperServer

getServerId

public long getServerId()
Returns the id of the associated QuorumPeer, which will do for a unique id of this server.

Specified by:
getServerId in interface SessionTracker.SessionExpirer
Overrides:
getServerId in class ZooKeeperServer

shutdown

public void shutdown()
Overrides:
shutdown in class ZooKeeperServer


Copyright © 2011 The Apache Software Foundation