Class ServerConfig


  • @Public
    public class ServerConfig
    extends Object
    Server configuration storage. We use this instead of Properties as it's typed.
    • Field Detail

      • 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
      • readFrom

        public void readFrom​(QuorumPeerConfig config)
        Read attributes from a QuorumPeerConfig.
        Parameters:
        config -
      • 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