Class QuorumZooKeeperServer
- java.lang.Object
-
- org.apache.zookeeper.server.ZooKeeperServer
-
- org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
-
- All Implemented Interfaces:
ServerStats.Provider
,SessionTracker.SessionExpirer
- Direct Known Subclasses:
LeaderZooKeeperServer
,LearnerZooKeeperServer
,ReadOnlyZooKeeperServer
public abstract class QuorumZooKeeperServer extends ZooKeeperServer
Abstract base class for all ZooKeeperServers that participate in a quorum.
-
-
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 Modifier and Type Field Description protected QuorumPeer
self
-
Fields inherited from class org.apache.zookeeper.server.ZooKeeperServer
DEFAULT_TICK_TIME, firstProcessor, jmxDataTreeBean, jmxServerBean, LOG, maxSessionTimeout, minSessionTimeout, ok, sessionTracker, state, tickTime
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
QuorumZooKeeperServer(FileTxnSnapLog logFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, ZooKeeperServer.DataTreeBuilder treeBuilder, ZKDatabase zkDb, QuorumPeer self)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dumpConf(java.io.PrintWriter pwriter)
protected void
setState(ZooKeeperServer.State state)
Sets the state of ZooKeeper server.-
Methods inherited from class org.apache.zookeeper.server.ZooKeeperServer
canShutdown, checkPasswd, closeSession, closeSession, createSessionTracker, decInProcess, dumpEphemerals, expire, finishSessionInit, getClientPort, getGlobalOutstandingLimit, getInProcess, getLastProcessedZxid, getMaxSessionTimeout, getMinSessionTimeout, getNumAliveConnections, getOutstandingRequests, getServerCnxnFactory, getServerId, getSnapCount, getState, getTickTime, getTxnLogFactory, getZKDatabase, getZooKeeperServerListener, getZxid, incInProcess, isRunning, killSession, loadData, processConnectRequest, processPacket, processTxn, registerJMX, reopenSession, revalidateSession, serverStats, setMaxSessionTimeout, setMinSessionTimeout, setOwner, setServerCnxnFactory, setTickTime, setTxnLogFactory, setupRequestProcessors, setZKDatabase, setZxid, shouldThrottle, shutdown, shutdown, startdata, startSessionTracker, startup, submitRequest, takeSnapshot, truncateLog, unregisterJMX
-
-
-
-
Field Detail
-
self
protected final QuorumPeer self
-
-
Constructor Detail
-
QuorumZooKeeperServer
protected QuorumZooKeeperServer(FileTxnSnapLog logFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, ZooKeeperServer.DataTreeBuilder treeBuilder, ZKDatabase zkDb, QuorumPeer self)
-
-
Method Detail
-
dumpConf
public void dumpConf(java.io.PrintWriter pwriter)
- Overrides:
dumpConf
in classZooKeeperServer
-
setState
protected void setState(ZooKeeperServer.State state)
Description copied from class:ZooKeeperServer
Sets the state of ZooKeeper server. After changing the state, it notifies the server state change to a registered shutdown handler, if any.The following are the server state transitions:
- During startup the server will be in the INITIAL state.
- After successfully starting, the server sets the state to RUNNING.
- The server transitions to the ERROR state if it hits an internal error.
ZooKeeperServerListenerImpl
notifies any critical resource error events, e.g., SyncRequestProcessor not being able to write a txn to disk.- During shutdown the server sets the state to SHUTDOWN, which corresponds to the server not running.
- Overrides:
setState
in classZooKeeperServer
- Parameters:
state
- new server state.
-
-