Class QuorumPeerConfig
java.lang.Object
org.apache.zookeeper.server.quorum.QuorumPeerConfig
- Direct Known Subclasses:
ControllerServerConfig
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InetSocketAddressprotected intdefaults to -1 if not set explicitlyprotected Stringprotected intprotected Fileprotected Fileprotected Stringprotected intprotected intprotected Stringprotected intprotected longJVM Pause Monitor info threshold in msprotected booleanJVM Pause Monitor feature switchprotected longJVM Pause Monitor sleep time in msprotected longJVM Pause Monitor warn threshold in msprotected QuorumVerifierprotected booleanprotected booleanprotected intprotected intdefaults to -1 if not set explicitlyprotected Stringprotected Propertiesprotected intdefaults to -1 if not set explicitlystatic final Stringprotected intprotected Stringprotected QuorumPeer.LearnerTypeprotected intprotected intprotected booleanprotected Stringprotected booleanprotected booleanprotected Stringprotected booleanConfigurations for the quorumpeer-to-quorumpeer sasl authenticationprotected Stringprotected QuorumVerifierprotected InetSocketAddressprotected longprotected booleanprotected intprotected booleanprotected booleanprotected booleanprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidstatic voidConfigure SSL authentication only if it is not configured.static voiddeleteFile(String filename) static voideditStaticConfig(String configFileStr, String dynamicFileStr, boolean eraseClientPortAddress) Edit static config file.intintintintintlonglonglongintintintintintintlongintbooleanintintstatic StringgetVersionFromFilename(String filename) booleanbooleanbooleanbooleanbooleanstatic booleanbooleanstatic booleanvoidParse a ZooKeeper configuration filestatic QuorumVerifierparseDynamicConfig(Properties dynamicConfigProp, int eAlg, boolean warnings, boolean configBackwardCompatibilityMode, String oraclePath) Parse dynamic configuration file and return quorumVerifier for new configuration.voidparseProperties(Properties zkProp) Parse config from a Properties.static voidsetReconfigEnabled(boolean enabled) static voidsetStandaloneEnabled(boolean enabled) booleanstatic voidwriteDynamicConfig(String dynamicConfigFilename, QuorumVerifier qv, boolean needKeepVersion) Writes dynamic configuration file
-
Field Details
-
nextDynamicConfigFileSuffix
- See Also:
-
clientPortAddress
-
secureClientPortAddress
-
sslQuorum
protected boolean sslQuorum -
shouldUsePortUnification
protected boolean shouldUsePortUnification -
observerMasterPort
protected int observerMasterPort -
sslQuorumReloadCertFiles
protected boolean sslQuorumReloadCertFiles -
dataDir
-
dataLogDir
-
dynamicConfigFileStr
-
configFileStr
-
tickTime
protected int tickTime -
maxClientCnxns
protected int maxClientCnxns -
minSessionTimeout
protected int minSessionTimeoutdefaults to -1 if not set explicitly -
maxSessionTimeout
protected int maxSessionTimeoutdefaults to -1 if not set explicitly -
metricsProviderClassName
-
metricsProviderConfiguration
-
localSessionsEnabled
protected boolean localSessionsEnabled -
localSessionsUpgradingEnabled
protected boolean localSessionsUpgradingEnabled -
clientPortListenBacklog
protected int clientPortListenBacklogdefaults to -1 if not set explicitly -
initLimit
protected int initLimit -
syncLimit
protected int syncLimit -
connectToLearnerMasterLimit
protected int connectToLearnerMasterLimit -
electionAlg
protected int electionAlg -
electionPort
protected int electionPort -
quorumListenOnAllIPs
protected boolean quorumListenOnAllIPs -
serverId
protected long serverId -
quorumVerifier
-
lastSeenQuorumVerifier
-
snapRetainCount
protected int snapRetainCount -
purgeInterval
protected int purgeInterval -
syncEnabled
protected boolean syncEnabled -
initialConfig
-
peerType
-
quorumServerRequireSasl
protected boolean quorumServerRequireSaslConfigurations for the quorumpeer-to-quorumpeer sasl authentication -
quorumLearnerRequireSasl
protected boolean quorumLearnerRequireSasl -
quorumEnableSasl
protected boolean quorumEnableSasl -
quorumServicePrincipal
-
quorumLearnerLoginContext
-
quorumServerLoginContext
-
quorumCnxnThreadsSize
protected int quorumCnxnThreadsSize -
oraclePath
-
jvmPauseMonitorToRun
protected boolean jvmPauseMonitorToRunJVM Pause Monitor feature switch -
jvmPauseWarnThresholdMs
protected long jvmPauseWarnThresholdMsJVM Pause Monitor warn threshold in ms -
jvmPauseInfoThresholdMs
protected long jvmPauseInfoThresholdMsJVM Pause Monitor info threshold in ms -
jvmPauseSleepTimeMs
protected long jvmPauseSleepTimeMsJVM Pause Monitor sleep time in ms
-
-
Constructor Details
-
QuorumPeerConfig
public QuorumPeerConfig()
-
-
Method Details
-
parse
Parse a ZooKeeper configuration file- Parameters:
path- the patch of the configuration file- Throws:
QuorumPeerConfig.ConfigException- error processing configuration
-
getVersionFromFilename
-
parseProperties
Parse config from a Properties.- Parameters:
zkProp- Properties to parse from.- Throws:
IOExceptionQuorumPeerConfig.ConfigException
-
configureSSLAuth
Configure SSL authentication only if it is not configured.- Throws:
QuorumPeerConfig.ConfigException- If authentication scheme is configured but authentication provider is not configured.
-
writeDynamicConfig
public static void writeDynamicConfig(String dynamicConfigFilename, QuorumVerifier qv, boolean needKeepVersion) throws IOException Writes dynamic configuration file- Throws:
IOException
-
editStaticConfig
public 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
-
deleteFile
-
parseDynamicConfig
public 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:
IOExceptionQuorumPeerConfig.ConfigException
-
checkValidity
-
getClientPortAddress
-
getSecureClientPortAddress
-
getObserverMasterPort
public int getObserverMasterPort() -
getDataDir
-
getDataLogDir
-
getInitialConfig
-
getTickTime
public int getTickTime() -
getMaxClientCnxns
public int getMaxClientCnxns() -
getMinSessionTimeout
public int getMinSessionTimeout() -
getMaxSessionTimeout
public int getMaxSessionTimeout() -
getMetricsProviderClassName
-
getMetricsProviderConfiguration
-
areLocalSessionsEnabled
public boolean areLocalSessionsEnabled() -
isLocalSessionsUpgradingEnabled
public boolean isLocalSessionsUpgradingEnabled() -
isSslQuorum
public boolean isSslQuorum() -
shouldUsePortUnification
public boolean shouldUsePortUnification() -
getClientPortListenBacklog
public int getClientPortListenBacklog() -
getInitLimit
public int getInitLimit() -
getSyncLimit
public int getSyncLimit() -
getConnectToLearnerMasterLimit
public int getConnectToLearnerMasterLimit() -
getElectionAlg
public int getElectionAlg() -
getElectionPort
public int getElectionPort() -
getSnapRetainCount
public int getSnapRetainCount() -
getPurgeInterval
public int getPurgeInterval() -
getSyncEnabled
public boolean getSyncEnabled() -
getQuorumVerifier
-
getLastSeenQuorumVerifier
-
getServers
-
getJvmPauseInfoThresholdMs
public long getJvmPauseInfoThresholdMs() -
getJvmPauseWarnThresholdMs
public long getJvmPauseWarnThresholdMs() -
getJvmPauseSleepTimeMs
public long getJvmPauseSleepTimeMs() -
isJvmPauseMonitorToRun
public boolean isJvmPauseMonitorToRun() -
getServerId
public long getServerId() -
isDistributed
public boolean isDistributed() -
getPeerType
-
getConfigFilename
-
getQuorumListenOnAllIPs
-
isMultiAddressEnabled
public boolean isMultiAddressEnabled() -
isMultiAddressReachabilityCheckEnabled
public boolean isMultiAddressReachabilityCheckEnabled() -
getMultiAddressReachabilityCheckTimeoutMs
public int getMultiAddressReachabilityCheckTimeoutMs() -
isStandaloneEnabled
public static boolean isStandaloneEnabled() -
setStandaloneEnabled
public static void setStandaloneEnabled(boolean enabled) -
isReconfigEnabled
public static boolean isReconfigEnabled() -
setReconfigEnabled
public static void setReconfigEnabled(boolean enabled)
-