ServerConfig (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.server

## Class ServerConfig

- java.lang.Object
- - org.apache.zookeeper.server.ServerConfig

-     @InterfaceAudience.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 and Description
    --- | ---
    `protected InetSocketAddress` | `clientPortAddress`
    `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 and Description
    `ServerConfig()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 java.lang.Object

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

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

  - ### Constructor Detail

    - #### ServerConfig

          public ServerConfig()

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

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.