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 InetSocketAddress
protected int
defaults to -1 if not set explicitlyprotected String
protected int
protected File
protected File
protected String
protected int
protected int
protected String
protected int
protected long
JVM Pause Monitor info threshold in msprotected boolean
JVM Pause Monitor feature switchprotected long
JVM Pause Monitor sleep time in msprotected long
JVM Pause Monitor warn threshold in msprotected QuorumVerifier
protected boolean
protected boolean
protected int
protected int
defaults to -1 if not set explicitlyprotected String
protected Properties
protected int
defaults to -1 if not set explicitlystatic final String
protected int
protected String
protected QuorumPeer.LearnerType
protected int
protected int
protected boolean
protected String
protected boolean
protected boolean
protected String
protected boolean
Configurations for the quorumpeer-to-quorumpeer sasl authenticationprotected String
protected QuorumVerifier
protected InetSocketAddress
protected long
protected boolean
protected int
protected boolean
protected boolean
protected boolean
protected int
protected int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
static void
Configure SSL authentication only if it is not configured.static void
deleteFile
(String filename) static void
editStaticConfig
(String configFileStr, String dynamicFileStr, boolean eraseClientPortAddress) Edit static config file.int
int
int
int
int
long
long
long
int
int
int
int
int
int
long
int
boolean
int
int
static String
getVersionFromFilename
(String filename) boolean
boolean
boolean
boolean
boolean
static boolean
boolean
static boolean
void
Parse a ZooKeeper configuration filestatic QuorumVerifier
parseDynamicConfig
(Properties dynamicConfigProp, int eAlg, boolean warnings, boolean configBackwardCompatibilityMode, String oraclePath) Parse dynamic configuration file and return quorumVerifier for new configuration.void
parseProperties
(Properties zkProp) Parse config from a Properties.static void
setReconfigEnabled
(boolean enabled) static void
setStandaloneEnabled
(boolean enabled) boolean
static void
writeDynamicConfig
(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:
IOException
QuorumPeerConfig.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:
IOException
QuorumPeerConfig.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)
-