Class QuorumPeerConfig

java.lang.Object
org.apache.zookeeper.server.quorum.QuorumPeerConfig
Direct Known Subclasses:
ControllerServerConfig

@Public public class QuorumPeerConfig extends Object
  • Field Details

    • nextDynamicConfigFileSuffix

      public static final String nextDynamicConfigFileSuffix
      See Also:
    • clientPortAddress

      protected InetSocketAddress clientPortAddress
    • secureClientPortAddress

      protected InetSocketAddress secureClientPortAddress
    • sslQuorum

      protected boolean sslQuorum
    • shouldUsePortUnification

      protected boolean shouldUsePortUnification
    • observerMasterPort

      protected int observerMasterPort
    • sslQuorumReloadCertFiles

      protected boolean sslQuorumReloadCertFiles
    • dataDir

      protected File dataDir
    • dataLogDir

      protected File dataLogDir
    • dynamicConfigFileStr

      protected String dynamicConfigFileStr
    • configFileStr

      protected String configFileStr
    • 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
    • localSessionsEnabled

      protected boolean localSessionsEnabled
    • localSessionsUpgradingEnabled

      protected boolean localSessionsUpgradingEnabled
    • clientPortListenBacklog

      protected int clientPortListenBacklog
      defaults to -1 if not set explicitly
    • initLimit

      protected int initLimit
    • syncLimit

      protected int syncLimit
    • connectToLearnerMasterLimit

      protected int connectToLearnerMasterLimit
    • electionAlg

      protected int electionAlg
    • electionPort

      protected int electionPort
    • quorumListenOnAllIPs

      protected boolean quorumListenOnAllIPs
    • serverId

      protected long serverId
    • quorumVerifier

      protected QuorumVerifier quorumVerifier
    • lastSeenQuorumVerifier

      protected QuorumVerifier lastSeenQuorumVerifier
    • snapRetainCount

      protected int snapRetainCount
    • purgeInterval

      protected int purgeInterval
    • syncEnabled

      protected boolean syncEnabled
    • initialConfig

      protected String initialConfig
    • peerType

      protected QuorumPeer.LearnerType peerType
    • quorumServerRequireSasl

      protected boolean quorumServerRequireSasl
      Configurations for the quorumpeer-to-quorumpeer sasl authentication
    • quorumLearnerRequireSasl

      protected boolean quorumLearnerRequireSasl
    • quorumEnableSasl

      protected boolean quorumEnableSasl
    • quorumServicePrincipal

      protected String quorumServicePrincipal
    • quorumLearnerLoginContext

      protected String quorumLearnerLoginContext
    • quorumServerLoginContext

      protected String quorumServerLoginContext
    • quorumCnxnThreadsSize

      protected int quorumCnxnThreadsSize
    • oraclePath

      protected String oraclePath
    • 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

    • QuorumPeerConfig

      public QuorumPeerConfig()
  • Method Details

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

      public static String getVersionFromFilename(String filename)
    • parseProperties

      public void parseProperties(Properties zkProp) throws IOException, QuorumPeerConfig.ConfigException
      Parse config from a Properties.
      Parameters:
      zkProp - Properties to parse from.
      Throws:
      IOException
      QuorumPeerConfig.ConfigException
    • configureSSLAuth

      public static void configureSSLAuth() throws QuorumPeerConfig.ConfigException
      Configure SSL authentication only if it is not configured.
      Throws:
      QuorumPeerConfig.ConfigException - If authentication scheme is configured but authentication provider is not configured.
    • writeDynamicConfig

      public static void writeDynamicConfig(String dynamicConfigFilename, QuorumVerifier qv, boolean needKeepVersion) throws IOException
      Writes dynamic configuration file
      Throws:
      IOException
    • editStaticConfig

      public static void editStaticConfig(String configFileStr, String dynamicFileStr, boolean eraseClientPortAddress) throws IOException
      Edit static config file. If there are quorum information in static file, e.g. "server.X", "group", it will remove them. If it needs to erase client port information left by the old config, "eraseClientPortAddress" should be set true. It should also updates dynamic file pointer on reconfig.
      Throws:
      IOException
    • deleteFile

      public static void deleteFile(String filename)
    • parseDynamicConfig

      public static QuorumVerifier parseDynamicConfig(Properties dynamicConfigProp, int eAlg, boolean warnings, boolean configBackwardCompatibilityMode, String oraclePath) throws IOException, QuorumPeerConfig.ConfigException
      Parse dynamic configuration file and return quorumVerifier for new configuration.
      Parameters:
      dynamicConfigProp - Properties to parse from.
      Throws:
      IOException
      QuorumPeerConfig.ConfigException
    • checkValidity

      public void checkValidity() throws IOException, QuorumPeerConfig.ConfigException
      Throws:
      IOException
      QuorumPeerConfig.ConfigException
    • getClientPortAddress

      public InetSocketAddress getClientPortAddress()
    • getSecureClientPortAddress

      public InetSocketAddress getSecureClientPortAddress()
    • getObserverMasterPort

      public int getObserverMasterPort()
    • getDataDir

      public File getDataDir()
    • getDataLogDir

      public File getDataLogDir()
    • getInitialConfig

      public String getInitialConfig()
    • getTickTime

      public int getTickTime()
    • getMaxClientCnxns

      public int getMaxClientCnxns()
    • getMinSessionTimeout

      public int getMinSessionTimeout()
    • getMaxSessionTimeout

      public int getMaxSessionTimeout()
    • getMetricsProviderClassName

      public String getMetricsProviderClassName()
    • getMetricsProviderConfiguration

      public Properties getMetricsProviderConfiguration()
    • areLocalSessionsEnabled

      public boolean areLocalSessionsEnabled()
    • isLocalSessionsUpgradingEnabled

      public boolean isLocalSessionsUpgradingEnabled()
    • isSslQuorum

      public boolean isSslQuorum()
    • shouldUsePortUnification

      public boolean shouldUsePortUnification()
    • getClientPortListenBacklog

      public int getClientPortListenBacklog()
    • getInitLimit

      public int getInitLimit()
    • getSyncLimit

      public int getSyncLimit()
    • getConnectToLearnerMasterLimit

      public int getConnectToLearnerMasterLimit()
    • getElectionAlg

      public int getElectionAlg()
    • getElectionPort

      public int getElectionPort()
    • getSnapRetainCount

      public int getSnapRetainCount()
    • getPurgeInterval

      public int getPurgeInterval()
    • getSyncEnabled

      public boolean getSyncEnabled()
    • getQuorumVerifier

      public QuorumVerifier getQuorumVerifier()
    • getLastSeenQuorumVerifier

      public QuorumVerifier getLastSeenQuorumVerifier()
    • getServers

      public Map<Long,QuorumPeer.QuorumServer> getServers()
    • getJvmPauseInfoThresholdMs

      public long getJvmPauseInfoThresholdMs()
    • getJvmPauseWarnThresholdMs

      public long getJvmPauseWarnThresholdMs()
    • getJvmPauseSleepTimeMs

      public long getJvmPauseSleepTimeMs()
    • isJvmPauseMonitorToRun

      public boolean isJvmPauseMonitorToRun()
    • getServerId

      public long getServerId()
    • isDistributed

      public boolean isDistributed()
    • getPeerType

      public QuorumPeer.LearnerType getPeerType()
    • getConfigFilename

      public String getConfigFilename()
    • getQuorumListenOnAllIPs

      public Boolean getQuorumListenOnAllIPs()
    • isMultiAddressEnabled

      public boolean isMultiAddressEnabled()
    • isMultiAddressReachabilityCheckEnabled

      public boolean isMultiAddressReachabilityCheckEnabled()
    • getMultiAddressReachabilityCheckTimeoutMs

      public int getMultiAddressReachabilityCheckTimeoutMs()
    • isStandaloneEnabled

      public static boolean isStandaloneEnabled()
    • setStandaloneEnabled

      public static void setStandaloneEnabled(boolean enabled)
    • isReconfigEnabled

      public static boolean isReconfigEnabled()
    • setReconfigEnabled

      public static void setReconfigEnabled(boolean enabled)