FollowerZooKeeperServer (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.server.quorum

## Class FollowerZooKeeperServer

- java.lang.Object
- - org.apache.zookeeper.server.ZooKeeperServer
  - - org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
    - - org.apache.zookeeper.server.quorum.LearnerZooKeeperServer
      - - org.apache.zookeeper.server.quorum.FollowerZooKeeperServer

- All Implemented Interfaces:
    ServerStats.Provider, SessionTracker.SessionExpirer

      public class FollowerZooKeeperServer
      extends LearnerZooKeeperServer

  Just like the standard ZooKeeperServer. We just replace the request processors: FollowerRequestProcessor -> CommitProcessor -> FinalRequestProcessor A SyncRequestProcessor is also spawned off to log proposals from the leader.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.zookeeper.server.ZooKeeperServer

      `ZooKeeperServer.MissingSessionException, ZooKeeperServer.State`

  - ### Field Summary

    - ### Fields inherited from class org.apache.zookeeper.server.quorum.LearnerZooKeeperServer

      `commitProcessor, syncProcessor`

    - ### Fields inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServer

      `self, upgradeableSessionTracker`

    - ### Fields inherited from class org.apache.zookeeper.server.ZooKeeperServer

      `ALLOW_SASL_FAILED_CLIENTS, CLOSE_SESSION_TXN_ENABLED, DEFAULT_STARTING_BUFFER_SIZE, DEFAULT_THROTTLED_OP_WAIT_TIME, DEFAULT_TICK_TIME, ENABLE_EAGER_ACL_CHECK, ENFORCE_QUOTA, enforceQuota, firstProcessor, GET_CHILDREN_RESPONSE_CACHE_SIZE, GET_DATA_RESPONSE_CACHE_SIZE, GLOBAL_OUTSTANDING_LIMIT, initialConfig, INT_BUFFER_STARTING_SIZE_BYTES, intBufferStartingSizeBytes, jmxDataTreeBean, jmxServerBean, jvmPauseMonitor, listenBacklog, maxSessionTimeout, minSessionTimeout, ok, reconfigEnabled, SASL_SUPER_USER, secureServerCnxnFactory, serverCnxnFactory, sessionTracker, SKIP_ACL, SNAP_COUNT, state, throttledOpWaitTime, tickTime, ZOOKEEPER_DIGEST_ENABLED`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `commit(long zxid)` When a COMMIT message is received, eventually this method is called, which matches up the zxid from the COMMIT with (hopefully) the head of the pendingTxns queue and hands it to the commitProcessor to commit.
    `Follower` | `getFollower()`
    `int` | `getGlobalOutstandingLimit()`
    `Learner` | `getLearner()` Abstract method to return the learner associated with this server.
    `String` | `getState()`
    `void` | `logRequest(TxnHeader hdr, Record txn, TxnDigest digest)`
    `protected void` | `registerMetrics()`
    `protected void` | `setupRequestProcessors()`
    `void` | `sync()`
    `protected void` | `unregisterMetrics()`

    - ### Methods inherited from class org.apache.zookeeper.server.quorum.LearnerZooKeeperServer

      `createSessionTracker, getServerId, getTouchSnapshot, registerJMX, registerJMX, revalidateSession, shutdown, unregisterJMX, unregisterJMX`

    - ### Methods inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServer

      `checkUpgradeSession, dumpConf, dumpMonitorValues, setLocalSessionFlag, setState, startSessionTracker, upgrade`

    - ### Methods inherited from class org.apache.zookeeper.server.ZooKeeperServer

      `authWriteRequest, canShutdown, checkACL, checkPasswd, checkQuota, checkRequestSizeWhenReceivingMessage, closeSession, closeSession, connThrottle, decInProcess, dumpEphemerals, enqueueRequest, expire, finishSessionInit, getClientPort, getClientPortListenBacklog, getConf, getConnectionDropChance, getDataDirSize, getEphemerals, getGetChildrenResponseCache, getInflight, getInitialConfig, getInProcess, getLargeRequestBytes, getLargeRequestMaxBytes, getLargeRequestThreshold, getLastProcessedZxid, getLogDirSize, getMaxClientCnxnsPerHost, getMaxSessionTimeout, getMinSessionTimeout, getNumAliveConnections, getOutstandingHandshakeNum, getOutstandingRequests, getReadResponseCache, getRequestPathMetricsCollector, getSecureClientPort, getSecureServerCnxnFactory, getServerCnxnFactory, getSessionExpiryMap, getSessionTracker, getSnapCount, getSnapSizeInBytes, getThrottledOpWaitTime, getTickTime, getTxnLogElapsedSyncTime, getTxnLogFactory, getZKDatabase, getZkShutdownHandler, getZooKeeperServerListener, getZxid, incInProcess, isCloseSessionTxnEnabled, isDigestEnabled, isReconfigEnabled, isResponseCachingEnabled, isRunning, killSession, loadData, processConnectRequest, processPacket, processTxn, processTxn, reopenSession, requestFinished, serverStats, setClientPortListenBacklog, setCloseSessionTxnEnabled, setCreateSessionTrackerServerId, setDigestEnabled, setLargeRequestMaxBytes, setLargeRequestThreshold, setMaxSessionTimeout, setMinSessionTimeout, setOwner, setResponseCachingEnabled, setSecureServerCnxnFactory, setServerCnxnFactory, setThrottledOpWaitTime, setTickTime, setTxnLogFactory, setZKDatabase, setZxid, shouldForceWriteInitialSnapshotAfterLeaderElection, shouldThrottle, shutdown, startdata, startJvmPauseMonitor, startRequestThrottler, startServing, startup, startupWithoutServing, submitRequest, submitRequestNow, takeSnapshot, takeSnapshot, truncateLog, validateSession`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getFollower

          public Follower getFollower()

    - #### setupRequestProcessors

          protected void setupRequestProcessors()

      Overrides:
        `setupRequestProcessors` in class `ZooKeeperServer`

    - #### logRequest

          public void logRequest(TxnHeader hdr,
                                 Record txn,
                                 TxnDigest digest)

    - #### commit

          public void commit(long zxid)

      When a COMMIT message is received, eventually this method is called, which matches up the zxid from the COMMIT with (hopefully) the head of the pendingTxns queue and hands it to the commitProcessor to commit.
      Parameters:
        `zxid` - - must correspond to the head of pendingTxns if it exists

    - #### sync

          public void sync()

    - #### getGlobalOutstandingLimit

          public int getGlobalOutstandingLimit()

      Overrides:
        `getGlobalOutstandingLimit` in class `ZooKeeperServer`

    - #### getState

          public String getState()

      Specified by:
        `getState` in interface `ServerStats.Provider`
      Overrides:
        `getState` in class `ZooKeeperServer`

    - #### 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`

    - #### registerMetrics

          protected void registerMetrics()

      Overrides:
        `registerMetrics` in class `QuorumZooKeeperServer`

    - #### unregisterMetrics

          protected void unregisterMetrics()

      Overrides:
        `unregisterMetrics` in class `QuorumZooKeeperServer`

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.