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

public abstract class QuorumZooKeeperServer extends ZooKeeperServer
Abstract base class for all ZooKeeperServers that participate in a quorum.
  • Field Details

  • Constructor Details

    • QuorumZooKeeperServer

      protected QuorumZooKeeperServer(FileTxnSnapLog logFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, int listenBacklog, ZKDatabase zkDb, QuorumPeer self)
  • Method Details

    • startSessionTracker

      protected void startSessionTracker()
      Overrides:
      startSessionTracker in class ZooKeeperServer
    • checkUpgradeSession

      public Request checkUpgradeSession(Request request) throws IOException, KeeperException
      Throws:
      IOException
      KeeperException
    • upgrade

      public void upgrade(long sessionId)
      Implements the SessionUpgrader interface,
      Parameters:
      sessionId -
    • setLocalSessionFlag

      protected void setLocalSessionFlag(Request si)
      Description copied from class: ZooKeeperServer
      If the underlying Zookeeper server support local session, this method will set a isLocalSession to true if a request is associated with a local session.
      Overrides:
      setLocalSessionFlag in class ZooKeeperServer
      Parameters:
      si -
    • dumpConf

      public void dumpConf(PrintWriter pwriter)
      Overrides:
      dumpConf in class ZooKeeperServer
    • 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.
    • During maintenance (e.g. restore) the server sets the state to MAINTENANCE