org.apache.zookeeper.server.quorum
Class LeaderZooKeeperServer

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

public class LeaderZooKeeperServer
extends QuorumZooKeeperServer

Just like the standard ZooKeeperServer. We just replace the request processors: PrepRequestProcessor -> ProposalRequestProcessor -> CommitProcessor -> Leader.ToBeAppliedRequestProcessor -> FinalRequestProcessor


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
protected  void createSessionTracker()
           
 int getGlobalOutstandingLimit()
           
 Leader getLeader()
           
 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(LeaderBean leaderBean, LocalPeerBean localPeerBean)
           
protected  void revalidateSession(ServerCnxn cnxn, long sessionId, int sessionTimeout)
           
protected  void setupRequestProcessors()
           
 boolean touch(long sess, int to)
           
protected  void unregisterJMX()
           
protected  void unregisterJMX(Leader leader)
           
 
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, 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

getLeader

public Leader getLeader()

setupRequestProcessors

protected void setupRequestProcessors()
Overrides:
setupRequestProcessors in class ZooKeeperServer

getGlobalOutstandingLimit

public int getGlobalOutstandingLimit()
Overrides:
getGlobalOutstandingLimit in class ZooKeeperServer

createSessionTracker

protected void createSessionTracker()
Overrides:
createSessionTracker in class ZooKeeperServer

touch

public boolean touch(long sess,
                     int to)

registerJMX

protected void registerJMX()
Overrides:
registerJMX in class ZooKeeperServer

registerJMX

public void registerJMX(LeaderBean leaderBean,
                        LocalPeerBean localPeerBean)

unregisterJMX

protected void unregisterJMX()
Overrides:
unregisterJMX in class ZooKeeperServer

unregisterJMX

protected void unregisterJMX(Leader leader)

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

revalidateSession

protected void revalidateSession(ServerCnxn cnxn,
                                 long sessionId,
                                 int sessionTimeout)
                          throws IOException
Overrides:
revalidateSession in class ZooKeeperServer
Throws:
IOException


Copyright © 2011 The Apache Software Foundation