Class AbstractConfiguration<T extends AbstractConfiguration>

  • All Implemented Interfaces:
    java.lang.Cloneable, org.apache.commons.configuration.Configuration
    Direct Known Subclasses:
    ClientConfiguration, ServerConfiguration

    public abstract class AbstractConfiguration<T extends AbstractConfiguration>
    extends org.apache.commons.configuration.CompositeConfiguration
    Abstract configuration.
    • Field Detail

      • READ_SYSTEM_PROPERTIES_PROPERTY

        public static final java.lang.String READ_SYSTEM_PROPERTIES_PROPERTY
        See Also:
        Constant Field Values
      • DEFAULT_LOADER

        protected static final java.lang.ClassLoader DEFAULT_LOADER
      • ZK_RETRY_BACKOFF_MAX_RETRIES

        protected static final java.lang.String ZK_RETRY_BACKOFF_MAX_RETRIES
        See Also:
        Constant Field Values
      • LEDGER_MANAGER_TYPE

        protected static final java.lang.String LEDGER_MANAGER_TYPE
        See Also:
        Constant Field Values
      • LEDGER_MANAGER_FACTORY_CLASS

        protected static final java.lang.String LEDGER_MANAGER_FACTORY_CLASS
        See Also:
        Constant Field Values
      • LEDGER_METADATA_FORMAT_VERSION

        protected static final java.lang.String LEDGER_METADATA_FORMAT_VERSION
        See Also:
        Constant Field Values
      • ALLOW_SHADED_LEDGER_MANAGER_FACTORY_CLASS

        protected static final java.lang.String ALLOW_SHADED_LEDGER_MANAGER_FACTORY_CLASS
        See Also:
        Constant Field Values
      • SHADED_LEDGER_MANAGER_FACTORY_CLASS_PREFIX

        protected static final java.lang.String SHADED_LEDGER_MANAGER_FACTORY_CLASS_PREFIX
        See Also:
        Constant Field Values
      • METADATA_SERVICE_URI

        protected static final java.lang.String METADATA_SERVICE_URI
        See Also:
        Constant Field Values
      • ZK_LEDGERS_ROOT_PATH

        protected static final java.lang.String ZK_LEDGERS_ROOT_PATH
        See Also:
        Constant Field Values
      • ZK_REQUEST_RATE_LIMIT

        protected static final java.lang.String ZK_REQUEST_RATE_LIMIT
        See Also:
        Constant Field Values
      • ZK_REPLICATION_TASK_RATE_LIMIT

        protected static final java.lang.String ZK_REPLICATION_TASK_RATE_LIMIT
        See Also:
        Constant Field Values
      • REREPLICATION_ENTRY_BATCH_SIZE

        protected static final java.lang.String REREPLICATION_ENTRY_BATCH_SIZE
        See Also:
        Constant Field Values
      • STORE_SYSTEMTIME_AS_LEDGER_UNDERREPLICATED_MARK_TIME

        protected static final java.lang.String STORE_SYSTEMTIME_AS_LEDGER_UNDERREPLICATED_MARK_TIME
        See Also:
        Constant Field Values
      • STORE_SYSTEMTIME_AS_LEDGER_CREATION_TIME

        protected static final java.lang.String STORE_SYSTEMTIME_AS_LEDGER_CREATION_TIME
        See Also:
        Constant Field Values
      • ENABLE_BUSY_WAIT

        protected static final java.lang.String ENABLE_BUSY_WAIT
        See Also:
        Constant Field Values
      • ENABLE_HEALTH_CHECK

        protected static final java.lang.String ENABLE_HEALTH_CHECK
        See Also:
        Constant Field Values
      • METASTORE_IMPL_CLASS

        protected static final java.lang.String METASTORE_IMPL_CLASS
        See Also:
        Constant Field Values
      • METASTORE_MAX_ENTRIES_PER_SCAN

        protected static final java.lang.String METASTORE_MAX_ENTRIES_PER_SCAN
        See Also:
        Constant Field Values
      • TLS_PROVIDER_FACTORY_CLASS

        protected static final java.lang.String TLS_PROVIDER_FACTORY_CLASS
        See Also:
        Constant Field Values
      • LEDGERID_FORMATTER_CLASS

        protected static final java.lang.String LEDGERID_FORMATTER_CLASS
        See Also:
        Constant Field Values
      • ENTRY_FORMATTER_CLASS

        protected static final java.lang.String ENTRY_FORMATTER_CLASS
        See Also:
        Constant Field Values
      • TLS_CLIENT_AUTHENTICATION

        protected static final java.lang.String TLS_CLIENT_AUTHENTICATION
        See Also:
        Constant Field Values
      • PRESERVE_MDC_FOR_TASK_EXECUTION

        protected static final java.lang.String PRESERVE_MDC_FOR_TASK_EXECUTION
        See Also:
        Constant Field Values
      • DEFAULT_ENTRY_FORMATTER

        protected static final java.lang.Class<? extends EntryFormatter> DEFAULT_ENTRY_FORMATTER
      • DEFAULT_LEDGERID_FORMATTER

        protected static final java.lang.Class<? extends LedgerIdFormatter> DEFAULT_LEDGERID_FORMATTER
      • TLS_CERT_FILES_REFRESH_DURATION_SECONDS

        protected static final java.lang.String TLS_CERT_FILES_REFRESH_DURATION_SECONDS
        See Also:
        Constant Field Values
      • TLS_ENABLED_CIPHER_SUITES

        protected static final java.lang.String TLS_ENABLED_CIPHER_SUITES
        This list will be passed to SSLEngine.setEnabledCipherSuites(java.lang.String[]). Please refer to official JDK JavaDocs
        See Also:
        Constant Field Values
      • TLS_ENABLED_PROTOCOLS

        protected static final java.lang.String TLS_ENABLED_PROTOCOLS
        This list will be passed to SSLEngine.setEnabledProtocols(java.lang.String[]). Please refer to official JDK JavaDocs
        See Also:
        Constant Field Values
      • TLS_KEYSTORE_TYPE

        protected static final java.lang.String TLS_KEYSTORE_TYPE
        TLS KeyStore, TrustStore, Password files and Certificate Paths.
        See Also:
        Constant Field Values
      • TLS_KEYSTORE_PASSWORD_PATH

        protected static final java.lang.String TLS_KEYSTORE_PASSWORD_PATH
        See Also:
        Constant Field Values
      • TLS_TRUSTSTORE_TYPE

        protected static final java.lang.String TLS_TRUSTSTORE_TYPE
        See Also:
        Constant Field Values
      • TLS_TRUSTSTORE_PASSWORD_PATH

        protected static final java.lang.String TLS_TRUSTSTORE_PASSWORD_PATH
        See Also:
        Constant Field Values
      • TLS_CERTIFICATE_PATH

        protected static final java.lang.String TLS_CERTIFICATE_PATH
        See Also:
        Constant Field Values
      • NETTY_MAX_FRAME_SIZE

        protected static final java.lang.String NETTY_MAX_FRAME_SIZE
        See Also:
        Constant Field Values
      • DEFAULT_NETTY_MAX_FRAME_SIZE

        protected static final int DEFAULT_NETTY_MAX_FRAME_SIZE
        See Also:
        Constant Field Values
      • ZK_ENABLE_SECURITY

        protected static final java.lang.String ZK_ENABLE_SECURITY
        See Also:
        Constant Field Values
      • LEDGER_MANAGER_FACTORY_DISABLE_CLASS_CHECK

        public static final java.lang.String LEDGER_MANAGER_FACTORY_DISABLE_CLASS_CHECK
        See Also:
        Constant Field Values
      • PERMITTED_STARTUP_USERS

        public static final java.lang.String PERMITTED_STARTUP_USERS
        See Also:
        Constant Field Values
      • MIN_NUM_RACKS_PER_WRITE_QUORUM

        public static final java.lang.String MIN_NUM_RACKS_PER_WRITE_QUORUM
        See Also:
        Constant Field Values
      • ENFORCE_MIN_NUM_RACKS_PER_WRITE_QUORUM

        public static final java.lang.String ENFORCE_MIN_NUM_RACKS_PER_WRITE_QUORUM
        See Also:
        Constant Field Values
      • ENFORCE_MIN_NUM_FAULT_DOMAINS_FOR_WRITE

        public static final java.lang.String ENFORCE_MIN_NUM_FAULT_DOMAINS_FOR_WRITE
        See Also:
        Constant Field Values
      • IGNORE_LOCAL_NODE_IN_PLACEMENT_POLICY

        public static final java.lang.String IGNORE_LOCAL_NODE_IN_PLACEMENT_POLICY
        See Also:
        Constant Field Values
      • MIN_NUM_ZONES_PER_WRITE_QUORUM

        public static final java.lang.String MIN_NUM_ZONES_PER_WRITE_QUORUM
        See Also:
        Constant Field Values
      • DESIRED_NUM_ZONES_PER_WRITE_QUORUM

        public static final java.lang.String DESIRED_NUM_ZONES_PER_WRITE_QUORUM
        See Also:
        Constant Field Values
      • ENFORCE_STRICT_ZONEAWARE_PLACEMENT

        public static final java.lang.String ENFORCE_STRICT_ZONEAWARE_PLACEMENT
        See Also:
        Constant Field Values
      • ALLOCATOR_POOLING_POLICY

        protected static final java.lang.String ALLOCATOR_POOLING_POLICY
        See Also:
        Constant Field Values
      • ALLOCATOR_POOLING_CONCURRENCY

        protected static final java.lang.String ALLOCATOR_POOLING_CONCURRENCY
        See Also:
        Constant Field Values
      • ALLOCATOR_OOM_POLICY

        protected static final java.lang.String ALLOCATOR_OOM_POLICY
        See Also:
        Constant Field Values
      • ALLOCATOR_LEAK_DETECTION_POLICY

        protected static final java.lang.String ALLOCATOR_LEAK_DETECTION_POLICY
        See Also:
        Constant Field Values
      • ALLOCATOR_EXIT_ON_OUT_OF_MEMORY

        protected static final java.lang.String ALLOCATOR_EXIT_ON_OUT_OF_MEMORY
        See Also:
        Constant Field Values
      • LIMIT_STATS_LOGGING

        public static final java.lang.String LIMIT_STATS_LOGGING
        See Also:
        Constant Field Values
      • REPLICATION_RATE_BY_BYTES

        protected static final java.lang.String REPLICATION_RATE_BY_BYTES
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractConfiguration

        protected AbstractConfiguration()
    • Method Detail

      • setPermittedStartupUsers

        public void setPermittedStartupUsers​(java.lang.String s)
        Limit who can start the application to prevent future permission errors.
      • getPermittedStartupUsers

        public java.lang.String[] getPermittedStartupUsers()
        Get array of users specified in this property.
      • loadConf

        public void loadConf​(java.net.URL confURL)
                      throws org.apache.commons.configuration.ConfigurationException
        You can load configurations in precedence order. The first one takes precedence over any loaded later.
        Parameters:
        confURL - Configuration URL
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • loadConf

        public void loadConf​(org.apache.commons.configuration.CompositeConfiguration baseConf)
        You can load configuration from other configuration.
        Parameters:
        baseConf - Other Configuration
      • getMetadataServiceUriUnchecked

        public java.lang.String getMetadataServiceUriUnchecked()
                                                        throws UncheckedConfigurationException
        Get metadata service uri.

        Warning: this method silently converts checked exceptions to unchecked exceptions. It is useful to use this method in lambda expressions. However it should not be used with places which have logics to handle checked exceptions. In such cases use getMetadataServiceUri() instead.

        Returns:
        metadata service uri
        Throws:
        UncheckedConfigurationException - if the metadata service uri is invalid.
      • getMetadataServiceUri

        public java.lang.String getMetadataServiceUri()
                                               throws org.apache.commons.configuration.ConfigurationException
        Get metadata service uri.
        Returns:
        metadata service uri.
        Throws:
        org.apache.commons.configuration.ConfigurationException - if the metadata service uri is invalid.
      • setMetadataServiceUri

        public T setMetadataServiceUri​(java.lang.String serviceUri)
        Set the metadata service uri.
        Parameters:
        serviceUri - the metadata service uri.
        Returns:
        the configuration object.
      • getZkServers

        @Deprecated
        public java.lang.String getZkServers()
        Deprecated.
        since 4.7.0
        Get zookeeper servers to connect.

        `zkServers` is deprecating, in favor of using `metadataServiceUri`

        Returns:
        zookeeper servers
      • setZkServers

        @Deprecated
        public T setZkServers​(java.lang.String zkServers)
        Deprecated.
        Set zookeeper servers to connect.

        `zkServers` is deprecating, in favor of using `metadataServiceUri`

        Parameters:
        zkServers - ZooKeeper servers to connect
      • getZkTimeout

        public int getZkTimeout()
        Get zookeeper timeout.
        Returns:
        zookeeper server timeout
      • setZkTimeout

        public T setZkTimeout​(int zkTimeout)
        Set zookeeper timeout.
        Parameters:
        zkTimeout - ZooKeeper server timeout
        Returns:
        server configuration
      • getZkRetryBackoffMaxRetries

        public int getZkRetryBackoffMaxRetries()
        Get zookeeper client backoff max retry times.
        Returns:
        zk backoff max retry times.
      • setZkRetryBackoffMaxRetries

        public T setZkRetryBackoffMaxRetries​(int maxRetries)
        Set zookeeper client backoff max retry times.
        Parameters:
        maxRetries - backoff max retry times
        Returns:
        server configuration.
      • getLedgerManagerType

        @Deprecated
        public java.lang.String getLedgerManagerType()
        Deprecated.
        Get Ledger Manager Type.
        Returns:
        ledger manager type
      • setAllowShadedLedgerManagerFactoryClass

        public T setAllowShadedLedgerManagerFactoryClass​(boolean allowed)
        Set the flag to allow using shaded ledger manager factory class for instantiating a ledger manager factory.
        Parameters:
        allowed - the flag to allow/disallow using shaded ledger manager factory class
        Returns:
        configuration instance.
      • isShadedLedgerManagerFactoryClassAllowed

        public boolean isShadedLedgerManagerFactoryClassAllowed()
        Is shaded ledger manager factory class name allowed to be used for instantiating ledger manager factory.
        Returns:
        ledger manager factory class name.
      • setShadedLedgerManagerFactoryClassPrefix

        public T setShadedLedgerManagerFactoryClassPrefix​(java.lang.String classPrefix)
        Set the class prefix of the shaded ledger manager factory class for instantiating a ledger manager factory.

        This setting only takes effects when isShadedLedgerManagerFactoryClassAllowed() returns true.

        Parameters:
        classPrefix - the class prefix of shaded ledger manager factory class
        Returns:
        configuration instance.
      • getShadedLedgerManagerFactoryClassPrefix

        public java.lang.String getShadedLedgerManagerFactoryClassPrefix()
        Get the class prefix of the shaded ledger manager factory class name allowed to be used for instantiating ledger manager factory.

        This setting only takes effects when isShadedLedgerManagerFactoryClassAllowed() returns true

        Returns:
        ledger manager factory class name.
        See Also:
        isShadedLedgerManagerFactoryClassAllowed()
      • setLedgerManagerFactoryClassName

        public void setLedgerManagerFactoryClassName​(java.lang.String factoryClassName)
        Set Ledger Manager Factory Class Name.
        Parameters:
        factoryClassName - Ledger Manager Factory Class Name
      • getLedgerManagerFactoryClassName

        public java.lang.String getLedgerManagerFactoryClassName()
        Get Ledger Manager Factory Class Name.
        Returns:
        ledger manager factory class name.
      • setLedgerMetadataFormatVersion

        public void setLedgerMetadataFormatVersion​(int metadataFormatVersion)
        Set Ledger metadata format version.
        Parameters:
        metadataFormatVersion - Ledger metadata format version. pass -1 to use default version
      • getLedgerMetadataFormatVersion

        public int getLedgerMetadataFormatVersion()
        Get Ledger metadata format version.
        Returns:
        ledger metadata format version.
      • getLedgerManagerLayoutStringFromFactoryClass

        public java.lang.String getLedgerManagerLayoutStringFromFactoryClass()
                                                                      throws org.apache.commons.configuration.ConfigurationException
        Get layout string ("null" if unconfigured).
        Returns:
        null, hierarchical, longhierarchical, or flat based on LEDGER_MANAGER_FACTORY_CLASS
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • setLedgerManagerFactoryClass

        public void setLedgerManagerFactoryClass​(java.lang.Class<? extends LedgerManagerFactory> factoryClass)
        Set Ledger Manager Factory Class.
        Parameters:
        factoryClass - Ledger Manager Factory Class
      • getLedgerManagerFactoryClass

        public java.lang.Class<? extends LedgerManagerFactory> getLedgerManagerFactoryClass()
                                                                                     throws org.apache.commons.configuration.ConfigurationException
        Get ledger manager factory class.
        Returns:
        ledger manager factory class
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • setZkLedgersRootPath

        @Deprecated
        public void setZkLedgersRootPath​(java.lang.String zkLedgersPath)
        Deprecated.
        Set Zk Ledgers Root Path.
        Parameters:
        zkLedgersPath - zk ledgers root path
      • getZkLedgersRootPath

        @Deprecated
        public java.lang.String getZkLedgersRootPath()
        Deprecated.
        Get Zk Ledgers Root Path.
        Returns:
        zk ledgers root path
      • getZkRequestRateLimit

        public double getZkRequestRateLimit()
        Get zookeeper access request rate limit.
        Returns:
        zookeeper access request rate limit.
      • setZkRequestRateLimit

        public void setZkRequestRateLimit​(double rateLimit)
        Set zookeeper access request rate limit.
        Parameters:
        rateLimit - zookeeper access request rate limit.
      • isZkEnableSecurity

        public boolean isZkEnableSecurity()
        Are z-node created with strict ACLs.
        Returns:
        usage of secure ZooKeeper ACLs
      • setZkEnableSecurity

        public void setZkEnableSecurity​(boolean zkEnableSecurity)
        Set the usage of ACLs of new z-nodes.
        Parameters:
        zkEnableSecurity -
      • getZkAvailableBookiesPath

        @Deprecated
        public java.lang.String getZkAvailableBookiesPath()
        Deprecated.
        Get the node under which available bookies are stored.
        Returns:
        Node under which available bookies are stored.
      • setRereplicationEntryBatchSize

        public void setRereplicationEntryBatchSize​(long rereplicationEntryBatchSize)
        Set the max entries to keep in fragment for re-replication. If fragment has more entries than this count, then the original fragment will be split into multiple small logical fragments by keeping max entries count to rereplicationEntryBatchSize. So, re-replication will happen in batches wise.
      • getRereplicationEntryBatchSize

        public long getRereplicationEntryBatchSize()
        Get the re-replication entry batch size.
      • getMetastoreImplClass

        public java.lang.String getMetastoreImplClass()
        Get metastore implementation class.
        Returns:
        metastore implementation class name.
      • setMetastoreImplClass

        public void setMetastoreImplClass​(java.lang.String metastoreImplClass)
        Set metastore implementation class.
        Parameters:
        metastoreImplClass - Metastore implementation Class name.
      • getMetastoreMaxEntriesPerScan

        public int getMetastoreMaxEntriesPerScan()
        Get max entries per scan in metastore.
        Returns:
        max entries per scan in metastore.
      • setMetastoreMaxEntriesPerScan

        public void setMetastoreMaxEntriesPerScan​(int maxEntries)
        Set max entries per scan in metastore.
        Parameters:
        maxEntries - Max entries per scan in metastore.
      • setFeature

        public void setFeature​(java.lang.String configProperty,
                               Feature feature)
      • getFeature

        public Feature getFeature​(java.lang.String configProperty,
                                  Feature defaultValue)
      • setLedgerIdFormatterClass

        public void setLedgerIdFormatterClass​(java.lang.Class<? extends LedgerIdFormatter> formatterClass)
        Set Ledger id formatter Class.
        Parameters:
        formatterClass - LedgerIdFormatter Class
      • getLedgerIdFormatterClass

        public java.lang.Class<? extends LedgerIdFormatter> getLedgerIdFormatterClass()
                                                                               throws org.apache.commons.configuration.ConfigurationException
        Get ledger id formatter class.
        Returns:
        LedgerIdFormatter class
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • setEntryFormatterClass

        public void setEntryFormatterClass​(java.lang.Class<? extends EntryFormatter> formatterClass)
        Set entry formatter Class.
        Parameters:
        formatterClass - EntryFormatter Class
      • getEntryFormatterClass

        public java.lang.Class<? extends EntryFormatter> getEntryFormatterClass()
                                                                         throws org.apache.commons.configuration.ConfigurationException
        Get entry formatter class.
        Returns:
        EntryFormatter class
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • setClientAuthProviderFactoryClass

        public T setClientAuthProviderFactoryClass​(java.lang.String factoryClass)
        Set the client authentication provider factory class name. If this is not set, no authentication will be used
        Parameters:
        factoryClass - the client authentication provider factory class name
        Returns:
        client configuration
      • getClientAuthProviderFactoryClass

        public java.lang.String getClientAuthProviderFactoryClass()
        Get the client authentication provider factory class name. If this returns null, no authentication will take place.
        Returns:
        the client authentication provider factory class name or null.
      • getNettyMaxFrameSizeBytes

        public int getNettyMaxFrameSizeBytes()
        Get the maximum netty frame size in bytes. Any message received larger that this will be rejected.
        Returns:
        the maximum netty frame size in bytes.
      • setNettyMaxFrameSizeBytes

        public T setNettyMaxFrameSizeBytes​(int maxSize)
        Set the max number of bytes a single message can be that is read by the bookie. Any message larger than that size will be rejected.
        Parameters:
        maxSize - the max size in bytes
        Returns:
        server configuration
      • getTLSProviderFactoryClass

        public java.lang.String getTLSProviderFactoryClass()
        Get the security provider factory class name. If this returns null, no security will be enforced on the channel.
        Returns:
        the security provider factory class name or null.
      • setTLSProviderFactoryClass

        public T setTLSProviderFactoryClass​(java.lang.String factoryClass)
        Set the client security provider factory class name. If this is not set, no security will be used on the channel.
        Parameters:
        factoryClass - the client security provider factory class name
        Returns:
        client configuration
      • getTLSProvider

        public java.lang.String getTLSProvider()
        Get TLS Provider (JDK or OpenSSL).
        Returns:
        the TLS provider to use in creating TLS Context
      • setTLSProvider

        public T setTLSProvider​(java.lang.String provider)
        Set TLS Provider (JDK or OpenSSL).
        Parameters:
        provider - TLS Provider type
        Returns:
        Client Configuration
      • getTLSClientAuthentication

        public boolean getTLSClientAuthentication()
        Whether the client will send an TLS certificate on TLS-handshake.
        Returns:
        whether TLS is enabled on the bookie or not.
        See Also:
        setTLSClientAuthentication(boolean)
      • setTLSClientAuthentication

        public T setTLSClientAuthentication​(boolean enabled)
        Specify whether the client will send an TLS certificate on TLS-handshake.
        Parameters:
        enabled - Whether to send a certificate or not
        Returns:
        client configuration
      • setTLSCertFilesRefreshDurationSeconds

        public T setTLSCertFilesRefreshDurationSeconds​(long certFilesRefreshSec)
        Set tls certificate files refresh duration in seconds.
        Parameters:
        certFilesRefreshSec - tls certificate files refresh duration in seconds (set 0 to disable auto refresh)
        Returns:
        current configuration
      • getTLSCertFilesRefreshDurationSeconds

        public long getTLSCertFilesRefreshDurationSeconds()
        Get tls certificate files refresh duration in seconds.
        Returns:
        tls certificate files refresh duration in seconds. Default 0 to disable auto refresh.
      • setTLSEnabledCipherSuites

        public T setTLSEnabledCipherSuites​(java.lang.String list)
        Set the list of enabled TLS cipher suites. Leave null not to override default JDK list. This list will be passed to SSLEngine.setEnabledCipherSuites(java.lang.String[]). Please refer to official JDK JavaDocs
        Parameters:
        list - comma separated list of enabled TLS cipher suites
        Returns:
        current configuration
      • getTLSEnabledCipherSuites

        public java.lang.String getTLSEnabledCipherSuites()
        Get the list of enabled TLS cipher suites.
        Returns:
        this list of enabled TLS cipher suites
        See Also:
        setTLSEnabledCipherSuites(java.lang.String)
      • setTLSEnabledProtocols

        public T setTLSEnabledProtocols​(java.lang.String list)
        Set the list of enabled TLS protocols. Leave null not to override default JDK list. This list will be passed to SSLEngine.setEnabledProtocols(java.lang.String[]). Please refer to official JDK JavaDocs
        Parameters:
        list - comma separated list of enabled TLS cipher suites
        Returns:
        current configuration
      • getTLSEnabledProtocols

        public java.lang.String getTLSEnabledProtocols()
        Get the list of enabled TLS protocols.
        Returns:
        the list of enabled TLS protocols.
        See Also:
        setTLSEnabledProtocols(java.lang.String)
      • setMinNumRacksPerWriteQuorum

        public void setMinNumRacksPerWriteQuorum​(int minNumRacksPerWriteQuorum)
        Set the minimum number of racks per write quorum.
      • getMinNumRacksPerWriteQuorum

        public int getMinNumRacksPerWriteQuorum()
        Get the minimum number of racks per write quorum.
      • setMinNumZonesPerWriteQuorum

        public void setMinNumZonesPerWriteQuorum​(int minNumZonesPerWriteQuorum)
        Set the minimum number of zones per write quorum in ZoneAwarePlacementPolicy.
      • getMinNumZonesPerWriteQuorum

        public int getMinNumZonesPerWriteQuorum()
        Get the minimum number of zones per write quorum in ZoneAwarePlacementPolicy.
      • setDesiredNumZonesPerWriteQuorum

        public void setDesiredNumZonesPerWriteQuorum​(int desiredNumZonesPerWriteQuorum)
        Set the desired number of zones per write quorum in ZoneAwarePlacementPolicy.
      • getDesiredNumZonesPerWriteQuorum

        public int getDesiredNumZonesPerWriteQuorum()
        Get the desired number of zones per write quorum in ZoneAwarePlacementPolicy.
      • setEnforceStrictZoneawarePlacement

        public void setEnforceStrictZoneawarePlacement​(boolean enforceStrictZoneawarePlacement)
        Set the flag to enforce strict zoneaware placement.

        in ZoneawareEnsemblePlacementPolicy if strict placement is enabled then minZones/desiredZones in writeQuorum would be maintained otherwise it will pick nodes randomly.

      • getEnforceStrictZoneawarePlacement

        public boolean getEnforceStrictZoneawarePlacement()
        Get the flag to enforce strict zoneaware placement.

        in ZoneawareEnsemblePlacementPolicy if strict placement is enabled then minZones/desiredZones in writeQuorum would be maintained otherwise it will pick nodes randomly.

      • setEnforceMinNumRacksPerWriteQuorum

        public void setEnforceMinNumRacksPerWriteQuorum​(boolean enforceMinNumRacksPerWriteQuorum)
        Set the flag to enforce minimum number of racks per write quorum.
      • getEnforceMinNumRacksPerWriteQuorum

        public boolean getEnforceMinNumRacksPerWriteQuorum()
        Get the flag which enforces the minimum number of racks per write quorum.
      • setEnforceMinNumFaultDomainsForWrite

        public void setEnforceMinNumFaultDomainsForWrite​(boolean enforceMinNumFaultDomainsForWrite)
        Set the flag to enforce minimum number of fault domains for write.
      • getEnforceMinNumFaultDomainsForWrite

        public boolean getEnforceMinNumFaultDomainsForWrite()
        Get the flag to enforce minimum number of fault domains for write.
      • setIgnoreLocalNodeInPlacementPolicy

        public void setIgnoreLocalNodeInPlacementPolicy​(boolean ignoreLocalNodeInPlacementPolicy)
        Sets the flag to ignore usage of localnode in placement policy.
      • getIgnoreLocalNodeInPlacementPolicy

        public boolean getIgnoreLocalNodeInPlacementPolicy()
        Whether to ignore localnode in placementpolicy.
      • setStoreSystemTimeAsLedgerUnderreplicatedMarkTime

        public T setStoreSystemTimeAsLedgerUnderreplicatedMarkTime​(boolean enabled)
        Enable the Auditor to use system time as underreplicated ledger mark time.

        If this is enabled, Auditor will write a ctime field into the underreplicated ledger znode.

        Parameters:
        enabled - flag to enable/disable Auditor using system time as underreplicated ledger mark time.
      • getStoreSystemTimeAsLedgerUnderreplicatedMarkTime

        public boolean getStoreSystemTimeAsLedgerUnderreplicatedMarkTime()
        Return the flag that indicates whether auditor is using system time as underreplicated ledger mark time.
        Returns:
        the flag that indicates whether auditor is using system time as underreplicated ledger mark time.
      • getPreserveMdcForTaskExecution

        public boolean getPreserveMdcForTaskExecution()
        Whether to preserve MDC for tasks in Executor.
        Returns:
        flag to enable/disable MDC preservation in Executor.
      • setPreserveMdcForTaskExecution

        public T setPreserveMdcForTaskExecution​(boolean enabled)
        Whether to preserve MDC for tasks in Executor.
        Parameters:
        enabled - flag to enable/disable MDC preservation in Executor.
        Returns:
        configuration.
      • getAllocatorPoolingPolicy

        public PoolingPolicy getAllocatorPoolingPolicy()
        Returns:
        the configured pooling policy for the allocator.
      • setAllocatorPoolingPolicy

        public T setAllocatorPoolingPolicy​(PoolingPolicy poolingPolicy)
        Define the memory pooling policy.

        Default is PoolingPolicy.PooledDirect

        Parameters:
        poolingPolicy - the memory pooling policy
        Returns:
        configuration object.
      • getAllocatorPoolingConcurrency

        public int getAllocatorPoolingConcurrency()
        Returns:
        the configured pooling concurrency for the allocator.
      • setAllocatorPoolingConcurrency

        public T setAllocatorPoolingConcurrency​(int concurrency)
        Controls the amount of concurrency for the memory pool.

        Default is to have a number of allocator arenas equals to 2 * CPUS.

        Decreasing this number will reduce the amount of memory overhead, at the expense of increased allocation contention.

        Parameters:
        concurrency - the concurrency level to use for the allocator pool
        Returns:
        configuration object.
      • getAllocatorOutOfMemoryPolicy

        public OutOfMemoryPolicy getAllocatorOutOfMemoryPolicy()
        Returns:
        the configured ouf of memory policy for the allocator.
      • setAllocatorOutOfMemoryPolicy

        public T setAllocatorOutOfMemoryPolicy​(OutOfMemoryPolicy oomPolicy)
        Define the memory allocator out of memory policy.

        Default is OutOfMemoryPolicy.FallbackToHeap

        Parameters:
        oomPolicy - the "out-of-memory" policy for the memory allocator
        Returns:
        configuration object.
      • getAllocatorLeakDetectionPolicy

        public LeakDetectionPolicy getAllocatorLeakDetectionPolicy()
        Return the configured leak detection policy for the allocator.
      • setAllocatorLeakDetectionPolicy

        public T setAllocatorLeakDetectionPolicy​(LeakDetectionPolicy leakDetectionPolicy)
        Enable the leak detection for the allocator.

        Default is LeakDetectionPolicy.Disabled

        Parameters:
        leakDetectionPolicy - the leak detection policy for the memory allocator
        Returns:
        configuration object.
      • setExitOnOutOfMemory

        public T setExitOnOutOfMemory​(boolean exitOnOutOfMemory)
      • exitOnOutOfMemory

        public boolean exitOnOutOfMemory()
      • isBusyWaitEnabled

        public boolean isBusyWaitEnabled()
        Return whether the busy-wait is enabled for BookKeeper and Netty IO threads.

        Default is false

        Returns:
        the value of the option
      • setBusyWaitEnabled

        public T setBusyWaitEnabled​(boolean busyWaitEnabled)
        Option to enable busy-wait settings.

        Default is false.

        WARNING: This option will enable spin-waiting on executors and IO threads in order to reduce latency during context switches. The spinning will consume 100% CPU even when bookie is not doing any work. It is recommended to reduce the number of threads in the main workers pool (ClientConfiguration.setNumWorkerThreads(int)) and Netty event loop ClientConfiguration.setNumIOThreads(int) to only have few CPU cores busy.

        Parameters:
        busyWaitEnabled - if enabled, use spin-waiting strategy to reduce latency in context switches
        See Also:
        isBusyWaitEnabled()
      • getLimitStatsLogging

        public boolean getLimitStatsLogging()
        Return the flag indicating whether to limit stats logging.
        Returns:
        the boolean flag indicating whether to limit stats logging
      • setLimitStatsLogging

        public T setLimitStatsLogging​(boolean limitStatsLogging)
        Sets flag to limit the stats logging.
        Parameters:
        limitStatsLogging - flag to limit the stats logging.
        Returns:
        configuration.
      • getReplicationRateByBytes

        public int getReplicationRateByBytes()
        Get the bytes rate of re-replication. Default value is -1 which it means entries will replicated without any throttling activity.
        Returns:
        bytes rate of re-replication.
      • setReplicationRateByBytes

        public T setReplicationRateByBytes​(int rate)
        Set the bytes rate of re-replication.
        Parameters:
        rate - bytes rate of re-replication.
        Returns:
        ClientConfiguration
      • getZkReplicationTaskRateLimit

        public double getZkReplicationTaskRateLimit()
        get the max tasks can be acquired per second of re-replication.
        Returns:
        max tasks can be acquired per second of re-replication.
      • setZkReplicationTaskRateLimit

        public T setZkReplicationTaskRateLimit​(double zkReplicationTaskRateLimit)
        set the max tasks can be acquired per second of re-replication, default is 0, which means no limit. Value greater than 0 will enable the rate limiting. Decimal value is allowed. For example, 0.5 means 1 task per 2 seconds, 1 means 1 task per second.
        Parameters:
        zkReplicationTaskRateLimit -
        Returns:
        ClientConfiguration
      • getThis

        protected abstract T getThis()
        Trickery to allow inheritance with fluent style.