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
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 ZooKeeperServer
ZooKeeperServer.MissingSessionException, ZooKeeperServer.State -
Field Summary
Fields inherited from class LearnerZooKeeperServer
commitProcessor, syncProcessorFields inherited from class QuorumZooKeeperServer
self, upgradeableSessionTrackerFields inherited from class 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, ZOOKEEPER_SERIALIZE_LAST_PROCESSED_ZXID_ENABLED -
Method Summary
Modifier and TypeMethodDescriptionvoidappendRequest(Request request) Append txn request to the transaction log directly without go through request processors.voidcommit(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.intAbstract method to return the learner associated with this server.getState()voidlogRequest(Request request) protected voidprotected voidvoidsync()protected voidMethods inherited from class LearnerZooKeeperServer
createSessionTracker, getServerId, getTouchSnapshot, registerJMX, registerJMX, revalidateSession, shutdownComponents, unregisterJMX, unregisterJMXMethods inherited from class QuorumZooKeeperServer
checkUpgradeSession, dumpConf, dumpMonitorValues, setLocalSessionFlag, setState, startSessionTracker, upgradeMethods inherited from class ZooKeeperServer
authWriteRequest, checkACL, checkPasswd, checkQuota, checkRequestSizeWhenReceivingMessage, closeSession, closeSession, connThrottle, createRequestThrottler, decInProcess, dumpEphemerals, enqueueRequest, expire, 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, isEnableEagerACLCheck, isReconfigEnabled, isResponseCachingEnabled, isRunning, isSerializeLastProcessedZxidEnabled, killSession, loadData, processConnectRequest, processPacket, processTxn, reopenSession, requestFinished, restoreFromSnapshot, serverStats, setClientPortListenBacklog, setCloseSessionTxnEnabled, setCreateSessionTrackerServerId, setDigestEnabled, setEnableEagerACLCheck, setLargeRequestMaxBytes, setLargeRequestThreshold, setMaxSessionTimeout, setMinSessionTimeout, setOwner, setResponseCachingEnabled, setSecureServerCnxnFactory, setSerializeLastProcessedZxidEnabled, setServerCnxnFactory, setThrottledOpWaitTime, setTickTime, setTxnLogFactory, setZKDatabase, setZxid, shouldForceWriteInitialSnapshotAfterLeaderElection, shouldThrottle, shutdown, shutdown, startdata, startJvmPauseMonitor, startRequestThrottler, startup, submitRequest, submitRequestNow, takeSnapshot, takeSnapshot, takeSnapshot, truncateLog, validateSession
-
Method Details
-
getFollower
-
setupRequestProcessors
protected void setupRequestProcessors()- Overrides:
setupRequestProcessorsin classZooKeeperServer
-
logRequest
-
appendRequest
Append txn request to the transaction log directly without go through request processors.- Throws:
IOException
-
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:
getGlobalOutstandingLimitin classZooKeeperServer
-
getState
- Specified by:
getStatein interfaceServerStats.Provider- Overrides:
getStatein classZooKeeperServer
-
getLearner
Description copied from class:LearnerZooKeeperServerAbstract 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:
getLearnerin classLearnerZooKeeperServer
-
registerMetrics
protected void registerMetrics()- Overrides:
registerMetricsin classQuorumZooKeeperServer
-
unregisterMetrics
protected void unregisterMetrics()- Overrides:
unregisterMetricsin classQuorumZooKeeperServer
-