# 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`
/ / If you update the configuration parameters be sure / to update the "conf" 4letter word /
`protected File`
`dataDir`
`protected File`
`dataLogDir`
`protected String`
`initialConfig`
`protected long`
`jvmPauseInfoThresholdMs`
JVM Pause Monitor info threshold in ms
`protected boolean`
`jvmPauseMonitorToRun`
JVM Pause Monitor feature switch
`protected long`
`jvmPauseSleepTimeMs`
JVM Pause Monitor sleep time in ms
`protected long`
`jvmPauseWarnThresholdMs`
JVM Pause Monitor warn threshold in ms
`protected int`
`listenBacklog`
defaults to -1 if not set explicitly
`protected int`
`maxClientCnxns`
`protected int`
`maxSessionTimeout`
defaults to -1 if not set explicitly
`protected String`
`metricsProviderClassName`
`protected Properties`
`metricsProviderConfiguration`
`protected int`
`minSessionTimeout`
defaults to -1 if not set explicitly
`protected InetSocketAddress`
`secureClientPortAddress`
`protected int`
`tickTime`

## Constructor Summary

Constructors
Constructor
Description
`ServerConfig()`

## Method Summary

Modifier and Type
Method
Description
`InetSocketAddress`
`getClientPortAddress()`
`int`
`getClientPortListenBacklog()`
Maximum number of pending socket connections to read, -1 if unset
`File`
`getDataDir()`
`File`
`getDataLogDir()`
`long`
`getJvmPauseInfoThresholdMs()`
`long`
`getJvmPauseSleepTimeMs()`
`long`
`getJvmPauseWarnThresholdMs()`
`int`
`getMaxClientCnxns()`
`int`
`getMaxSessionTimeout()`
maximum session timeout in milliseconds, -1 if unset
`String`
`getMetricsProviderClassName()`
`Properties`
`getMetricsProviderConfiguration()`
`int`
`getMinSessionTimeout()`
minimum session timeout in milliseconds, -1 if unset
`InetSocketAddress`
`getSecureClientPortAddress()`
`int`
`getTickTime()`
`boolean`
`isJvmPauseMonitorToRun()`
`void`
`parse(String path)`
Parse a ZooKeeper configuration file
`void`
`parse(String[] args)`
Parse arguments for server configuration
`void`
`readFrom(QuorumPeerConfig config)`
Read attributes from a QuorumPeerConfig.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### clientPortAddress

protected InetSocketAddress clientPortAddress
/ / If you update the configuration parameters be sure / to update the "conf" 4letter word /

### 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

## Constructor Details

### ServerConfig

public ServerConfig()

## Method Details

### 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