Class QuorumPeerConfig
- java.lang.Object
- 
- org.apache.zookeeper.server.quorum.QuorumPeerConfig
 
- 
- Direct Known Subclasses:
- ControllerServerConfig
 
 @Public public class QuorumPeerConfig extends Object 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classQuorumPeerConfig.ConfigException
 - 
Field SummaryFields Modifier and Type Field Description protected InetSocketAddressclientPortAddressprotected intclientPortListenBacklogdefaults to -1 if not set explicitlyprotected StringconfigFileStrprotected intconnectToLearnerMasterLimitprotected FiledataDirprotected FiledataLogDirprotected StringdynamicConfigFileStrprotected intelectionAlgprotected intelectionPortprotected StringinitialConfigprotected intinitLimitprotected longjvmPauseInfoThresholdMsJVM Pause Monitor info threshold in msprotected booleanjvmPauseMonitorToRunJVM Pause Monitor feature switchprotected longjvmPauseSleepTimeMsJVM Pause Monitor sleep time in msprotected longjvmPauseWarnThresholdMsJVM Pause Monitor warn threshold in msprotected QuorumVerifierlastSeenQuorumVerifierprotected booleanlocalSessionsEnabledprotected booleanlocalSessionsUpgradingEnabledprotected intmaxClientCnxnsprotected intmaxSessionTimeoutdefaults to -1 if not set explicitlyprotected StringmetricsProviderClassNameprotected PropertiesmetricsProviderConfigurationprotected intminSessionTimeoutdefaults to -1 if not set explicitlystatic StringnextDynamicConfigFileSuffixprotected intobserverMasterPortprotected StringoraclePathprotected QuorumPeer.LearnerTypepeerTypeprotected intpurgeIntervalprotected intquorumCnxnThreadsSizeprotected booleanquorumEnableSaslprotected StringquorumLearnerLoginContextprotected booleanquorumLearnerRequireSaslprotected booleanquorumListenOnAllIPsprotected StringquorumServerLoginContextprotected booleanquorumServerRequireSaslConfigurations for the quorumpeer-to-quorumpeer sasl authenticationprotected StringquorumServicePrincipalprotected QuorumVerifierquorumVerifierprotected InetSocketAddresssecureClientPortAddressprotected longserverIdprotected booleanshouldUsePortUnificationprotected intsnapRetainCountprotected booleansslQuorumprotected booleansslQuorumReloadCertFilesprotected booleansyncEnabledprotected intsyncLimitprotected inttickTime
 - 
Constructor SummaryConstructors Constructor Description QuorumPeerConfig()
 - 
Method Summary
 
- 
- 
- 
Field Detail- 
nextDynamicConfigFileSuffixpublic static final String nextDynamicConfigFileSuffix - See Also:
- Constant Field Values
 
 - 
clientPortAddressprotected InetSocketAddress clientPortAddress 
 - 
secureClientPortAddressprotected InetSocketAddress secureClientPortAddress 
 - 
sslQuorumprotected boolean sslQuorum 
 - 
shouldUsePortUnificationprotected boolean shouldUsePortUnification 
 - 
observerMasterPortprotected int observerMasterPort 
 - 
sslQuorumReloadCertFilesprotected boolean sslQuorumReloadCertFiles 
 - 
dataDirprotected File dataDir 
 - 
dataLogDirprotected File dataLogDir 
 - 
dynamicConfigFileStrprotected String dynamicConfigFileStr 
 - 
configFileStrprotected String configFileStr 
 - 
tickTimeprotected int tickTime 
 - 
maxClientCnxnsprotected int maxClientCnxns 
 - 
minSessionTimeoutprotected int minSessionTimeout defaults to -1 if not set explicitly
 - 
maxSessionTimeoutprotected int maxSessionTimeout defaults to -1 if not set explicitly
 - 
metricsProviderClassNameprotected String metricsProviderClassName 
 - 
metricsProviderConfigurationprotected Properties metricsProviderConfiguration 
 - 
localSessionsEnabledprotected boolean localSessionsEnabled 
 - 
localSessionsUpgradingEnabledprotected boolean localSessionsUpgradingEnabled 
 - 
clientPortListenBacklogprotected int clientPortListenBacklog defaults to -1 if not set explicitly
 - 
initLimitprotected int initLimit 
 - 
syncLimitprotected int syncLimit 
 - 
connectToLearnerMasterLimitprotected int connectToLearnerMasterLimit 
 - 
electionAlgprotected int electionAlg 
 - 
electionPortprotected int electionPort 
 - 
quorumListenOnAllIPsprotected boolean quorumListenOnAllIPs 
 - 
serverIdprotected long serverId 
 - 
quorumVerifierprotected QuorumVerifier quorumVerifier 
 - 
lastSeenQuorumVerifierprotected QuorumVerifier lastSeenQuorumVerifier 
 - 
snapRetainCountprotected int snapRetainCount 
 - 
purgeIntervalprotected int purgeInterval 
 - 
syncEnabledprotected boolean syncEnabled 
 - 
initialConfigprotected String initialConfig 
 - 
peerTypeprotected QuorumPeer.LearnerType peerType 
 - 
quorumServerRequireSaslprotected boolean quorumServerRequireSasl Configurations for the quorumpeer-to-quorumpeer sasl authentication
 - 
quorumLearnerRequireSaslprotected boolean quorumLearnerRequireSasl 
 - 
quorumEnableSaslprotected boolean quorumEnableSasl 
 - 
quorumServicePrincipalprotected String quorumServicePrincipal 
 - 
quorumLearnerLoginContextprotected String quorumLearnerLoginContext 
 - 
quorumServerLoginContextprotected String quorumServerLoginContext 
 - 
quorumCnxnThreadsSizeprotected int quorumCnxnThreadsSize 
 - 
oraclePathprotected String oraclePath 
 - 
jvmPauseMonitorToRunprotected boolean jvmPauseMonitorToRun JVM Pause Monitor feature switch
 - 
jvmPauseWarnThresholdMsprotected long jvmPauseWarnThresholdMs JVM Pause Monitor warn threshold in ms
 - 
jvmPauseInfoThresholdMsprotected long jvmPauseInfoThresholdMs JVM Pause Monitor info threshold in ms
 - 
jvmPauseSleepTimeMsprotected long jvmPauseSleepTimeMs JVM Pause Monitor sleep time in ms
 
- 
 - 
Method Detail- 
parsepublic void parse(String path) throws QuorumPeerConfig.ConfigException Parse a ZooKeeper configuration file- Parameters:
- path- the patch of the configuration file
- Throws:
- QuorumPeerConfig.ConfigException- error processing configuration
 
 - 
parsePropertiespublic void parseProperties(Properties zkProp) throws IOException, QuorumPeerConfig.ConfigException Parse config from a Properties.- Parameters:
- zkProp- Properties to parse from.
- Throws:
- IOException
- QuorumPeerConfig.ConfigException
 
 - 
configureSSLAuthpublic static void configureSSLAuth() throws QuorumPeerConfig.ConfigExceptionConfigure SSL authentication only if it is not configured.- Throws:
- QuorumPeerConfig.ConfigException- If authentication scheme is configured but authentication provider is not configured.
 
 - 
writeDynamicConfigpublic static void writeDynamicConfig(String dynamicConfigFilename, QuorumVerifier qv, boolean needKeepVersion) throws IOException Writes dynamic configuration file- Throws:
- IOException
 
 - 
editStaticConfigpublic static void editStaticConfig(String configFileStr, String dynamicFileStr, boolean eraseClientPortAddress) throws IOException Edit static config file. If there are quorum information in static file, e.g. "server.X", "group", it will remove them. If it needs to erase client port information left by the old config, "eraseClientPortAddress" should be set true. It should also updates dynamic file pointer on reconfig.- Throws:
- IOException
 
 - 
deleteFilepublic static void deleteFile(String filename) 
 - 
parseDynamicConfigpublic static QuorumVerifier parseDynamicConfig(Properties dynamicConfigProp, int eAlg, boolean warnings, boolean configBackwardCompatibilityMode, String oraclePath) throws IOException, QuorumPeerConfig.ConfigException Parse dynamic configuration file and return quorumVerifier for new configuration.- Parameters:
- dynamicConfigProp- Properties to parse from.
- Throws:
- IOException
- QuorumPeerConfig.ConfigException
 
 - 
checkValiditypublic void checkValidity() throws IOException, QuorumPeerConfig.ConfigException
 - 
getClientPortAddresspublic InetSocketAddress getClientPortAddress() 
 - 
getSecureClientPortAddresspublic InetSocketAddress getSecureClientPortAddress() 
 - 
getObserverMasterPortpublic int getObserverMasterPort() 
 - 
getDataDirpublic File getDataDir() 
 - 
getDataLogDirpublic File getDataLogDir() 
 - 
getInitialConfigpublic String getInitialConfig() 
 - 
getTickTimepublic int getTickTime() 
 - 
getMaxClientCnxnspublic int getMaxClientCnxns() 
 - 
getMinSessionTimeoutpublic int getMinSessionTimeout() 
 - 
getMaxSessionTimeoutpublic int getMaxSessionTimeout() 
 - 
getMetricsProviderClassNamepublic String getMetricsProviderClassName() 
 - 
getMetricsProviderConfigurationpublic Properties getMetricsProviderConfiguration() 
 - 
areLocalSessionsEnabledpublic boolean areLocalSessionsEnabled() 
 - 
isLocalSessionsUpgradingEnabledpublic boolean isLocalSessionsUpgradingEnabled() 
 - 
isSslQuorumpublic boolean isSslQuorum() 
 - 
shouldUsePortUnificationpublic boolean shouldUsePortUnification() 
 - 
getClientPortListenBacklogpublic int getClientPortListenBacklog() 
 - 
getInitLimitpublic int getInitLimit() 
 - 
getSyncLimitpublic int getSyncLimit() 
 - 
getConnectToLearnerMasterLimitpublic int getConnectToLearnerMasterLimit() 
 - 
getElectionAlgpublic int getElectionAlg() 
 - 
getElectionPortpublic int getElectionPort() 
 - 
getSnapRetainCountpublic int getSnapRetainCount() 
 - 
getPurgeIntervalpublic int getPurgeInterval() 
 - 
getSyncEnabledpublic boolean getSyncEnabled() 
 - 
getQuorumVerifierpublic QuorumVerifier getQuorumVerifier() 
 - 
getLastSeenQuorumVerifierpublic QuorumVerifier getLastSeenQuorumVerifier() 
 - 
getServerspublic Map<Long,QuorumPeer.QuorumServer> getServers() 
 - 
getJvmPauseInfoThresholdMspublic long getJvmPauseInfoThresholdMs() 
 - 
getJvmPauseWarnThresholdMspublic long getJvmPauseWarnThresholdMs() 
 - 
getJvmPauseSleepTimeMspublic long getJvmPauseSleepTimeMs() 
 - 
isJvmPauseMonitorToRunpublic boolean isJvmPauseMonitorToRun() 
 - 
getServerIdpublic long getServerId() 
 - 
isDistributedpublic boolean isDistributed() 
 - 
getPeerTypepublic QuorumPeer.LearnerType getPeerType() 
 - 
getConfigFilenamepublic String getConfigFilename() 
 - 
getQuorumListenOnAllIPspublic Boolean getQuorumListenOnAllIPs() 
 - 
isMultiAddressEnabledpublic boolean isMultiAddressEnabled() 
 - 
isMultiAddressReachabilityCheckEnabledpublic boolean isMultiAddressReachabilityCheckEnabled() 
 - 
getMultiAddressReachabilityCheckTimeoutMspublic int getMultiAddressReachabilityCheckTimeoutMs() 
 - 
isStandaloneEnabledpublic static boolean isStandaloneEnabled() 
 - 
setStandaloneEnabledpublic static void setStandaloneEnabled(boolean enabled) 
 - 
isReconfigEnabledpublic static boolean isReconfigEnabled() 
 - 
setReconfigEnabledpublic static void setReconfigEnabled(boolean enabled) 
 
- 
 
-