@InterfaceAudience.Public public class QuorumPeerConfig extends Object
Modifier and Type | Class and Description |
---|---|
static class |
QuorumPeerConfig.ConfigException |
Constructor and Description |
---|
QuorumPeerConfig() |
Modifier and Type | Method and Description |
---|---|
boolean |
areLocalSessionsEnabled() |
void |
checkValidity() |
static void |
configureSSLAuth()
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.
|
InetSocketAddress |
getClientPortAddress() |
String |
getConfigFilename() |
File |
getDataDir() |
File |
getDataLogDir() |
int |
getElectionAlg() |
int |
getElectionPort() |
int |
getInitLimit() |
QuorumVerifier |
getLastSeenQuorumVerifier() |
int |
getMaxClientCnxns() |
int |
getMaxSessionTimeout() |
int |
getMinSessionTimeout() |
QuorumPeer.LearnerType |
getPeerType() |
int |
getPurgeInterval() |
Boolean |
getQuorumListenOnAllIPs() |
QuorumVerifier |
getQuorumVerifier() |
InetSocketAddress |
getSecureClientPortAddress() |
long |
getServerId() |
Map<Long,QuorumPeer.QuorumServer> |
getServers() |
int |
getSnapRetainCount() |
boolean |
getSyncEnabled() |
int |
getSyncLimit() |
int |
getTickTime() |
static String |
getVersionFromFilename(String filename) |
boolean |
isDistributed() |
boolean |
isLocalSessionsUpgradingEnabled() |
static boolean |
isReconfigEnabled() |
boolean |
isSslQuorum() |
static boolean |
isStandaloneEnabled() |
void |
parse(String path)
Parse a ZooKeeper configuration file
|
static QuorumVerifier |
parseDynamicConfig(Properties dynamicConfigProp,
int eAlg,
boolean warnings,
boolean configBackwardCompatibilityMode)
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 |
shouldUsePortUnification() |
static void |
writeDynamicConfig(String dynamicConfigFilename,
QuorumVerifier qv,
boolean needKeepVersion)
Writes dynamic configuration file
|
public static final String nextDynamicConfigFileSuffix
protected InetSocketAddress clientPortAddress
protected InetSocketAddress secureClientPortAddress
protected boolean sslQuorum
protected boolean shouldUsePortUnification
protected boolean sslQuorumReloadCertFiles
protected File dataDir
protected File dataLogDir
protected String dynamicConfigFileStr
protected String configFileStr
protected int tickTime
protected int maxClientCnxns
protected int minSessionTimeout
protected int maxSessionTimeout
protected boolean localSessionsEnabled
protected boolean localSessionsUpgradingEnabled
protected int initLimit
protected int syncLimit
protected int electionAlg
protected int electionPort
protected boolean quorumListenOnAllIPs
protected long serverId
protected QuorumVerifier quorumVerifier
protected QuorumVerifier lastSeenQuorumVerifier
protected int snapRetainCount
protected int purgeInterval
protected boolean syncEnabled
protected QuorumPeer.LearnerType peerType
protected boolean quorumServerRequireSasl
protected boolean quorumLearnerRequireSasl
protected boolean quorumEnableSasl
protected String quorumServicePrincipal
protected String quorumLearnerLoginContext
protected String quorumServerLoginContext
protected int quorumCnxnThreadsSize
public void parse(String path) throws QuorumPeerConfig.ConfigException
path
- the patch of the configuration fileQuorumPeerConfig.ConfigException
- error processing configurationpublic void parseProperties(Properties zkProp) throws IOException, QuorumPeerConfig.ConfigException
zkProp
- Properties to parse from.IOException
QuorumPeerConfig.ConfigException
public static void configureSSLAuth() throws QuorumPeerConfig.ConfigException
QuorumPeerConfig.ConfigException
- If authentication scheme is configured but authentication
provider is not configured.public static void writeDynamicConfig(String dynamicConfigFilename, QuorumVerifier qv, boolean needKeepVersion) throws IOException
IOException
public static void editStaticConfig(String configFileStr, String dynamicFileStr, boolean eraseClientPortAddress) throws IOException
IOException
public static void deleteFile(String filename)
public static QuorumVerifier parseDynamicConfig(Properties dynamicConfigProp, int eAlg, boolean warnings, boolean configBackwardCompatibilityMode) throws IOException, QuorumPeerConfig.ConfigException
dynamicConfigProp
- Properties to parse from.IOException
QuorumPeerConfig.ConfigException
public void checkValidity() throws IOException, QuorumPeerConfig.ConfigException
public InetSocketAddress getClientPortAddress()
public InetSocketAddress getSecureClientPortAddress()
public File getDataDir()
public File getDataLogDir()
public int getTickTime()
public int getMaxClientCnxns()
public int getMinSessionTimeout()
public int getMaxSessionTimeout()
public boolean areLocalSessionsEnabled()
public boolean isLocalSessionsUpgradingEnabled()
public boolean isSslQuorum()
public boolean shouldUsePortUnification()
public int getInitLimit()
public int getSyncLimit()
public int getElectionAlg()
public int getElectionPort()
public int getSnapRetainCount()
public int getPurgeInterval()
public boolean getSyncEnabled()
public QuorumVerifier getQuorumVerifier()
public QuorumVerifier getLastSeenQuorumVerifier()
public Map<Long,QuorumPeer.QuorumServer> getServers()
public long getServerId()
public boolean isDistributed()
public QuorumPeer.LearnerType getPeerType()
public String getConfigFilename()
public Boolean getQuorumListenOnAllIPs()
public static boolean isStandaloneEnabled()
public static void setStandaloneEnabled(boolean enabled)
public static boolean isReconfigEnabled()
public static void setReconfigEnabled(boolean enabled)
Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.