Package org.apache.zookeeper.server
Class ServerConfig
- java.lang.Object
-
- org.apache.zookeeper.server.ServerConfig
-
@Public public class ServerConfig extends Object
Server configuration storage. We use this instead of Properties as it's typed.
-
-
Field Summary
Fields Modifier and Type Field Description protected InetSocketAddress
clientPortAddress
protected File
dataDir
protected File
dataLogDir
protected String
initialConfig
protected long
jvmPauseInfoThresholdMs
JVM Pause Monitor info threshold in msprotected boolean
jvmPauseMonitorToRun
JVM Pause Monitor feature switchprotected long
jvmPauseSleepTimeMs
JVM Pause Monitor sleep time in msprotected long
jvmPauseWarnThresholdMs
JVM Pause Monitor warn threshold in msprotected int
listenBacklog
defaults to -1 if not set explicitlyprotected int
maxClientCnxns
protected int
maxSessionTimeout
defaults to -1 if not set explicitlyprotected String
metricsProviderClassName
protected Properties
metricsProviderConfiguration
protected int
minSessionTimeout
defaults to -1 if not set explicitlyprotected InetSocketAddress
secureClientPortAddress
protected int
tickTime
-
Constructor Summary
Constructors Constructor Description ServerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InetSocketAddress
getClientPortAddress()
int
getClientPortListenBacklog()
Maximum number of pending socket connections to read, -1 if unsetFile
getDataDir()
File
getDataLogDir()
long
getJvmPauseInfoThresholdMs()
long
getJvmPauseSleepTimeMs()
long
getJvmPauseWarnThresholdMs()
int
getMaxClientCnxns()
int
getMaxSessionTimeout()
maximum session timeout in milliseconds, -1 if unsetString
getMetricsProviderClassName()
Properties
getMetricsProviderConfiguration()
int
getMinSessionTimeout()
minimum session timeout in milliseconds, -1 if unsetInetSocketAddress
getSecureClientPortAddress()
int
getTickTime()
boolean
isJvmPauseMonitorToRun()
void
parse(String path)
Parse a ZooKeeper configuration filevoid
parse(String[] args)
Parse arguments for server configurationvoid
readFrom(QuorumPeerConfig config)
Read attributes from a QuorumPeerConfig.
-
-
-
Field Detail
-
clientPortAddress
protected InetSocketAddress clientPortAddress
-
secureClientPortAddress
protected InetSocketAddress secureClientPortAddress
-
dataDir
protected File dataDir
-
dataLogDir
protected File dataLogDir
-
tickTime
protected int tickTime
-
maxClientCnxns
protected int maxClientCnxns
-
minSessionTimeout
protected int minSessionTimeout
defaults to -1 if not set explicitly
-
maxSessionTimeout
protected int maxSessionTimeout
defaults to -1 if not set explicitly
-
metricsProviderClassName
protected String metricsProviderClassName
-
metricsProviderConfiguration
protected Properties metricsProviderConfiguration
-
listenBacklog
protected int listenBacklog
defaults to -1 if not set explicitly
-
initialConfig
protected String initialConfig
-
jvmPauseMonitorToRun
protected boolean jvmPauseMonitorToRun
JVM Pause Monitor feature switch
-
jvmPauseWarnThresholdMs
protected long jvmPauseWarnThresholdMs
JVM Pause Monitor warn threshold in ms
-
jvmPauseInfoThresholdMs
protected long jvmPauseInfoThresholdMs
JVM Pause Monitor info threshold in ms
-
jvmPauseSleepTimeMs
protected long jvmPauseSleepTimeMs
JVM Pause Monitor sleep time in ms
-
-
Method Detail
-
parse
public void parse(String[] args)
Parse arguments for server configuration- Parameters:
args
- clientPort dataDir and optional tickTime and maxClientCnxns- Throws:
IllegalArgumentException
- on invalid usage
-
parse
public 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
-
readFrom
public void readFrom(QuorumPeerConfig config)
Read attributes from a QuorumPeerConfig.- Parameters:
config
-
-
getClientPortAddress
public InetSocketAddress getClientPortAddress()
-
getSecureClientPortAddress
public InetSocketAddress getSecureClientPortAddress()
-
getDataDir
public File getDataDir()
-
getDataLogDir
public File getDataLogDir()
-
getTickTime
public int getTickTime()
-
getMaxClientCnxns
public int getMaxClientCnxns()
-
getMinSessionTimeout
public int getMinSessionTimeout()
minimum session timeout in milliseconds, -1 if unset
-
getMaxSessionTimeout
public int getMaxSessionTimeout()
maximum session timeout in milliseconds, -1 if unset
-
getJvmPauseInfoThresholdMs
public long getJvmPauseInfoThresholdMs()
-
getJvmPauseWarnThresholdMs
public long getJvmPauseWarnThresholdMs()
-
getJvmPauseSleepTimeMs
public long getJvmPauseSleepTimeMs()
-
isJvmPauseMonitorToRun
public boolean isJvmPauseMonitorToRun()
-
getMetricsProviderClassName
public String getMetricsProviderClassName()
-
getMetricsProviderConfiguration
public Properties getMetricsProviderConfiguration()
-
getClientPortListenBacklog
public int getClientPortListenBacklog()
Maximum number of pending socket connections to read, -1 if unset
-
-