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.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.zookeeper.server.ZooKeeperServerZooKeeperServer.MissingSessionException, ZooKeeperServer.State
 
- 
 - 
Field SummaryFields Modifier and Type Field Description QuorumPeerselfprotected UpgradeableSessionTrackerupgradeableSessionTracker- 
Fields inherited from class org.apache.zookeeper.server.ZooKeeperServerALLOW_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
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedQuorumZooKeeperServer(FileTxnSnapLog logFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, int listenBacklog, ZKDatabase zkDb, QuorumPeer self)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestcheckUpgradeSession(Request request)voiddumpConf(PrintWriter pwriter)voiddumpMonitorValues(BiConsumer<String,Object> response)Hook into admin server, useful to expose additional data that do not represent metrics.protected voidregisterMetrics()protected voidsetLocalSessionFlag(Request si)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.protected voidsetState(ZooKeeperServer.State state)Sets the state of ZooKeeper server.protected voidstartSessionTracker()protected voidunregisterMetrics()voidupgrade(long sessionId)Implements the SessionUpgrader interface,- 
Methods inherited from class org.apache.zookeeper.server.ZooKeeperServerauthWriteRequest, canShutdown, checkACL, checkPasswd, checkQuota, checkRequestSizeWhenReceivingMessage, closeSession, closeSession, connThrottle, createRequestThrottler, createSessionTracker, decInProcess, dumpEphemerals, enqueueRequest, expire, expire, finishSessionInit, getClientPort, getClientPortListenBacklog, getConf, getConnectionDropChance, getDataDirSize, getEphemerals, getGetChildrenResponseCache, getGlobalOutstandingLimit, getInflight, getInitialConfig, getInProcess, getLargeRequestBytes, getLargeRequestMaxBytes, getLargeRequestThreshold, getLastProcessedZxid, getLogDirSize, getMaxClientCnxnsPerHost, getMaxSessionTimeout, getMinSessionTimeout, getNumAliveConnections, getOutstandingHandshakeNum, getOutstandingRequests, getReadResponseCache, getRequestPathMetricsCollector, getSecureClientPort, getSecureServerCnxnFactory, getServerCnxnFactory, getServerId, getSessionExpiryMap, getSessionTracker, getSnapCount, getSnapSizeInBytes, getState, getThrottledOpWaitTime, getTickTime, getTxnLogElapsedSyncTime, getTxnLogFactory, getZKDatabase, getZkShutdownHandler, getZooKeeperServerListener, getZxid, incInProcess, isCloseSessionTxnEnabled, isDigestEnabled, isEnableEagerACLCheck, isReconfigEnabled, isResponseCachingEnabled, isRunning, killSession, loadData, processConnectRequest, processPacket, processTxn, processTxn, registerJMX, reopenSession, requestFinished, revalidateSession, serverStats, setClientPortListenBacklog, setCloseSessionTxnEnabled, setCreateSessionTrackerServerId, setDigestEnabled, setEnableEagerACLCheck, setLargeRequestMaxBytes, setLargeRequestThreshold, setMaxSessionTimeout, setMinSessionTimeout, setOwner, setResponseCachingEnabled, setSecureServerCnxnFactory, setServerCnxnFactory, setThrottledOpWaitTime, setTickTime, setTxnLogFactory, setupRequestProcessors, setZKDatabase, setZxid, shouldForceWriteInitialSnapshotAfterLeaderElection, shouldThrottle, shutdown, shutdown, startdata, startJvmPauseMonitor, startRequestThrottler, startServing, startup, startupWithoutServing, submitRequest, submitRequestNow, takeSnapshot, takeSnapshot, truncateLog, unregisterJMX, validateSession
 
- 
 
- 
- 
- 
Field Detail- 
selfpublic final QuorumPeer self 
 - 
upgradeableSessionTrackerprotected UpgradeableSessionTracker upgradeableSessionTracker 
 
- 
 - 
Constructor Detail- 
QuorumZooKeeperServerprotected QuorumZooKeeperServer(FileTxnSnapLog logFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, int listenBacklog, ZKDatabase zkDb, QuorumPeer self) 
 
- 
 - 
Method Detail- 
startSessionTrackerprotected void startSessionTracker() - Overrides:
- startSessionTrackerin class- ZooKeeperServer
 
 - 
checkUpgradeSessionpublic Request checkUpgradeSession(Request request) throws IOException, KeeperException - Throws:
- IOException
- KeeperException
 
 - 
upgradepublic void upgrade(long sessionId) Implements the SessionUpgrader interface,- Parameters:
- sessionId-
 
 - 
setLocalSessionFlagprotected void setLocalSessionFlag(Request si) Description copied from class:ZooKeeperServerIf 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:
- setLocalSessionFlagin class- ZooKeeperServer
 
 - 
dumpConfpublic void dumpConf(PrintWriter pwriter) - Overrides:
- dumpConfin class- ZooKeeperServer
 
 - 
setStateprotected void setState(ZooKeeperServer.State state) Description copied from class:ZooKeeperServerSets 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. ZooKeeperServerListenerImplnotifies 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:
- setStatein class- ZooKeeperServer
- Parameters:
- state- new server state.
 
 - 
registerMetricsprotected void registerMetrics() - Overrides:
- registerMetricsin class- ZooKeeperServer
 
 - 
unregisterMetricsprotected void unregisterMetrics() - Overrides:
- unregisterMetricsin class- ZooKeeperServer
 
 - 
dumpMonitorValuespublic void dumpMonitorValues(BiConsumer<String,Object> response) Description copied from class:ZooKeeperServerHook into admin server, useful to expose additional data that do not represent metrics.- Overrides:
- dumpMonitorValuesin class- ZooKeeperServer
- Parameters:
- response- a sink which collects the data.
 
 
- 
 
-