Class LeaderZooKeeperServer
java.lang.Object
org.apache.zookeeper.server.ZooKeeperServer
org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
org.apache.zookeeper.server.quorum.LeaderZooKeeperServer
- All Implemented Interfaces:
ServerStats.Provider,SessionTracker.SessionExpirer
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, ZooKeeperServer.State -
Field Summary
Fields inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
self, upgradeableSessionTrackerFields 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, LOG, 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 -
Constructor Summary
ConstructorsConstructorDescriptionLeaderZooKeeperServer(FileTxnSnapLog logFactory, QuorumPeer self, ZKDatabase zkDb) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckIfValidGlobalSession(long sess, int to) voidintlongReturns the id of the associated QuorumPeer, which will do for a unique id of this server.getState()protected voidvoidregisterJMX(LeaderBean leaderBean, LocalPeerBean localPeerBean) protected voidprotected voidrevalidateSession(ServerCnxn cnxn, long sessionId, int sessionTimeout) protected voidvoidshutdown()voidstartup()voidsubmitLearnerRequest(Request request) Requests coming from the learner should go directly to PrepRequestProcessorbooleantouch(long sess, int to) protected voidprotected voidunregisterJMX(Leader leader) protected voidMethods inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServer
checkUpgradeSession, dumpConf, dumpMonitorValues, setLocalSessionFlag, setState, startSessionTracker, upgradeMethods inherited from class org.apache.zookeeper.server.ZooKeeperServer
authWriteRequest, canShutdown, 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, 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, startdata, startJvmPauseMonitor, startRequestThrottler, startServing, startupWithoutServing, submitRequest, submitRequestNow, takeSnapshot, takeSnapshot, takeSnapshot, truncateLog, validateSession
-
Constructor Details
-
LeaderZooKeeperServer
public LeaderZooKeeperServer(FileTxnSnapLog logFactory, QuorumPeer self, ZKDatabase zkDb) throws IOException - Throws:
IOException
-
-
Method Details
-
getLeader
-
setupRequestProcessors
protected void setupRequestProcessors()- Overrides:
setupRequestProcessorsin classZooKeeperServer
-
startup
public void startup()- Overrides:
startupin classZooKeeperServer
-
registerMetrics
protected void registerMetrics()- Overrides:
registerMetricsin classQuorumZooKeeperServer
-
unregisterMetrics
protected void unregisterMetrics()- Overrides:
unregisterMetricsin classQuorumZooKeeperServer
-
shutdown
public void shutdown()- Overrides:
shutdownin classZooKeeperServer
-
getGlobalOutstandingLimit
public int getGlobalOutstandingLimit()- Overrides:
getGlobalOutstandingLimitin classZooKeeperServer
-
createSessionTracker
public void createSessionTracker()- Overrides:
createSessionTrackerin classZooKeeperServer
-
touch
public boolean touch(long sess, int to) -
checkIfValidGlobalSession
public boolean checkIfValidGlobalSession(long sess, int to) -
submitLearnerRequest
Requests coming from the learner should go directly to PrepRequestProcessor- Parameters:
request-
-
registerJMX
protected void registerJMX()- Overrides:
registerJMXin classZooKeeperServer
-
registerJMX
-
unregisterJMX
protected void unregisterJMX()- Overrides:
unregisterJMXin classZooKeeperServer
-
unregisterJMX
-
getState
- Specified by:
getStatein interfaceServerStats.Provider- Overrides:
getStatein classZooKeeperServer
-
getServerId
public long getServerId()Returns the id of the associated QuorumPeer, which will do for a unique id of this server.- Specified by:
getServerIdin interfaceSessionTracker.SessionExpirer- Overrides:
getServerIdin classZooKeeperServer
-
revalidateSession
protected void revalidateSession(ServerCnxn cnxn, long sessionId, int sessionTimeout) throws IOException - Overrides:
revalidateSessionin classZooKeeperServer- Throws:
IOException
-