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