Class ObserverZooKeeperServer
- 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.ObserverZooKeeperServer
 
 
 
 
- 
- All Implemented Interfaces:
- ServerStats.Provider,- SessionTracker.SessionExpirer
 
 public class ObserverZooKeeperServer extends LearnerZooKeeperServer A ZooKeeperServer for the Observer node type. Not much is different, but we anticipate specializing the request processors in the future.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.zookeeper.server.ZooKeeperServerZooKeeperServer.MissingSessionException, ZooKeeperServer.State
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.zookeeper.server.quorum.LearnerZooKeeperServercommitProcessor, syncProcessor
 - 
Fields inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServerself, upgradeableSessionTracker
 - 
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, maxSessionTimeout, minSessionTimeout, ok, reconfigEnabled, SASL_SUPER_USER, secureServerCnxnFactory, serverCnxnFactory, sessionTracker, SKIP_ACL, SNAP_COUNT, state, throttledOpWaitTime, tickTime, ZOOKEEPER_DIGEST_ENABLED
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommitRequest(Request request)Unlike a Follower, which sees a full request only during the PROPOSAL phase, Observers get all the data required with the INFORM packet.voiddumpMonitorValues(BiConsumer<String,Object> response)Hook into admin server, useful to expose additional data that do not represent metrics.LearnergetLearner()Abstract method to return the learner associated with this server.ObservergetObserver()StringgetState()protected voidsetupRequestProcessors()Set up the request processors for an Observer: firstProcesor->commitProcessor->finalProcessorvoidshutdown()voidsync()- 
Methods inherited from class org.apache.zookeeper.server.quorum.LearnerZooKeeperServercreateSessionTracker, getServerId, getTouchSnapshot, registerJMX, registerJMX, revalidateSession, unregisterJMX, unregisterJMX
 - 
Methods inherited from class org.apache.zookeeper.server.quorum.QuorumZooKeeperServercheckUpgradeSession, dumpConf, registerMetrics, setLocalSessionFlag, setState, startSessionTracker, unregisterMetrics, upgrade
 - 
Methods inherited from class org.apache.zookeeper.server.ZooKeeperServerauthWriteRequest, canShutdown, checkACL, checkPasswd, checkQuota, checkRequestSizeWhenReceivingMessage, closeSession, closeSession, connThrottle, createRequestThrottler, 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, getSessionExpiryMap, getSessionTracker, getSnapCount, getSnapSizeInBytes, getThrottledOpWaitTime, getTickTime, getTxnLogElapsedSyncTime, getTxnLogFactory, getZKDatabase, getZkShutdownHandler, getZooKeeperServerListener, getZxid, incInProcess, isCloseSessionTxnEnabled, isDigestEnabled, isEnableEagerACLCheck, isReconfigEnabled, isResponseCachingEnabled, isRunning, killSession, loadData, processConnectRequest, processPacket, processTxn, processTxn, reopenSession, requestFinished, serverStats, setClientPortListenBacklog, setCloseSessionTxnEnabled, setCreateSessionTrackerServerId, setDigestEnabled, setEnableEagerACLCheck, 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
 
- 
 
- 
- 
- 
Method Detail- 
getObserverpublic Observer getObserver() 
 - 
getLearnerpublic Learner 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 class- LearnerZooKeeperServer
 
 - 
commitRequestpublic void commitRequest(Request request) Unlike a Follower, which sees a full request only during the PROPOSAL phase, Observers get all the data required with the INFORM packet. This method commits a request that has been unpacked by from an INFORM received from the Leader.- Parameters:
- request-
 
 - 
setupRequestProcessorsprotected void setupRequestProcessors() Set up the request processors for an Observer: firstProcesor->commitProcessor->finalProcessor- Overrides:
- setupRequestProcessorsin class- ZooKeeperServer
 
 - 
syncpublic void sync() 
 - 
getStatepublic String getState() - Specified by:
- getStatein interface- ServerStats.Provider
- Overrides:
- getStatein class- ZooKeeperServer
 
 - 
shutdownpublic void shutdown() - Overrides:
- shutdownin class- LearnerZooKeeperServer
 
 - 
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- QuorumZooKeeperServer
- Parameters:
- response- a sink which collects the data.
 
 
- 
 
-