Class ClientConfiguration

  • All Implemented Interfaces:
    java.lang.Cloneable, org.apache.commons.configuration.Configuration

    public class ClientConfiguration
    extends AbstractConfiguration<ClientConfiguration>
    Configuration settings for client side.
    • Field Detail

      • ENABLE_DIGEST_TYPE_AUTODETECTION

        protected static final java.lang.String ENABLE_DIGEST_TYPE_AUTODETECTION
        See Also:
        Constant Field Values
      • CLIENT_TCP_NODELAY

        protected static final java.lang.String CLIENT_TCP_NODELAY
        See Also:
        Constant Field Values
      • CLIENT_SOCK_KEEPALIVE

        protected static final java.lang.String CLIENT_SOCK_KEEPALIVE
        See Also:
        Constant Field Values
      • CLIENT_SENDBUFFER_SIZE

        protected static final java.lang.String CLIENT_SENDBUFFER_SIZE
        See Also:
        Constant Field Values
      • CLIENT_RECEIVEBUFFER_SIZE

        protected static final java.lang.String CLIENT_RECEIVEBUFFER_SIZE
        See Also:
        Constant Field Values
      • CLIENT_WRITEBUFFER_LOW_WATER_MARK

        protected static final java.lang.String CLIENT_WRITEBUFFER_LOW_WATER_MARK
        See Also:
        Constant Field Values
      • CLIENT_WRITEBUFFER_HIGH_WATER_MARK

        protected static final java.lang.String CLIENT_WRITEBUFFER_HIGH_WATER_MARK
        See Also:
        Constant Field Values
      • CLIENT_CONNECT_TIMEOUT_MILLIS

        protected static final java.lang.String CLIENT_CONNECT_TIMEOUT_MILLIS
        See Also:
        Constant Field Values
      • CLIENT_TCP_USER_TIMEOUT_MILLIS

        protected static final java.lang.String CLIENT_TCP_USER_TIMEOUT_MILLIS
        See Also:
        Constant Field Values
      • NUM_CHANNELS_PER_BOOKIE

        protected static final java.lang.String NUM_CHANNELS_PER_BOOKIE
        See Also:
        Constant Field Values
      • USE_V2_WIRE_PROTOCOL

        protected static final java.lang.String USE_V2_WIRE_PROTOCOL
        See Also:
        Constant Field Values
      • NETTY_USE_POOLED_BUFFERS

        protected static final java.lang.String NETTY_USE_POOLED_BUFFERS
        See Also:
        Constant Field Values
      • SPECULATIVE_READ_TIMEOUT

        protected static final java.lang.String SPECULATIVE_READ_TIMEOUT
        See Also:
        Constant Field Values
      • FIRST_SPECULATIVE_READ_TIMEOUT

        protected static final java.lang.String FIRST_SPECULATIVE_READ_TIMEOUT
        See Also:
        Constant Field Values
      • MAX_SPECULATIVE_READ_TIMEOUT

        protected static final java.lang.String MAX_SPECULATIVE_READ_TIMEOUT
        See Also:
        Constant Field Values
      • SPECULATIVE_READ_TIMEOUT_BACKOFF_MULTIPLIER

        protected static final java.lang.String SPECULATIVE_READ_TIMEOUT_BACKOFF_MULTIPLIER
        See Also:
        Constant Field Values
      • FIRST_SPECULATIVE_READ_LAC_TIMEOUT

        protected static final java.lang.String FIRST_SPECULATIVE_READ_LAC_TIMEOUT
        See Also:
        Constant Field Values
      • MAX_SPECULATIVE_READ_LAC_TIMEOUT

        protected static final java.lang.String MAX_SPECULATIVE_READ_LAC_TIMEOUT
        See Also:
        Constant Field Values
      • SPECULATIVE_READ_LAC_TIMEOUT_BACKOFF_MULTIPLIER

        protected static final java.lang.String SPECULATIVE_READ_LAC_TIMEOUT_BACKOFF_MULTIPLIER
        See Also:
        Constant Field Values
      • ENABLE_PARALLEL_RECOVERY_READ

        protected static final java.lang.String ENABLE_PARALLEL_RECOVERY_READ
        See Also:
        Constant Field Values
      • RECOVERY_READ_BATCH_SIZE

        protected static final java.lang.String RECOVERY_READ_BATCH_SIZE
        See Also:
        Constant Field Values
      • REORDER_READ_SEQUENCE_ENABLED

        protected static final java.lang.String REORDER_READ_SEQUENCE_ENABLED
        See Also:
        Constant Field Values
      • STICKY_READS_ENABLED

        protected static final java.lang.String STICKY_READS_ENABLED
        See Also:
        Constant Field Values
      • RECOVERY_BATCH_READ_ENABLED

        protected static final java.lang.String RECOVERY_BATCH_READ_ENABLED
        See Also:
        Constant Field Values
      • OPPORTUNISTIC_STRIPING

        protected static final java.lang.String OPPORTUNISTIC_STRIPING
        See Also:
        Constant Field Values
      • DELAY_ENSEMBLE_CHANGE

        protected static final java.lang.String DELAY_ENSEMBLE_CHANGE
        See Also:
        Constant Field Values
      • MAX_ALLOWED_ENSEMBLE_CHANGES

        protected static final java.lang.String MAX_ALLOWED_ENSEMBLE_CHANGES
        See Also:
        Constant Field Values
      • ADD_ENTRY_TIMEOUT_SEC

        protected static final java.lang.String ADD_ENTRY_TIMEOUT_SEC
        See Also:
        Constant Field Values
      • ADD_ENTRY_QUORUM_TIMEOUT_SEC

        protected static final java.lang.String ADD_ENTRY_QUORUM_TIMEOUT_SEC
        See Also:
        Constant Field Values
      • READ_ENTRY_TIMEOUT_SEC

        protected static final java.lang.String READ_ENTRY_TIMEOUT_SEC
        See Also:
        Constant Field Values
      • TIMEOUT_MONITOR_INTERVAL_SEC

        protected static final java.lang.String TIMEOUT_MONITOR_INTERVAL_SEC
        See Also:
        Constant Field Values
      • TIMEOUT_TASK_INTERVAL_MILLIS

        protected static final java.lang.String TIMEOUT_TASK_INTERVAL_MILLIS
        See Also:
        Constant Field Values
      • EXPLICIT_LAC_INTERVAL

        protected static final java.lang.String EXPLICIT_LAC_INTERVAL
        See Also:
        Constant Field Values
      • PCBC_TIMEOUT_TIMER_TICK_DURATION_MS

        protected static final java.lang.String PCBC_TIMEOUT_TIMER_TICK_DURATION_MS
        See Also:
        Constant Field Values
      • PCBC_TIMEOUT_TIMER_NUM_TICKS

        protected static final java.lang.String PCBC_TIMEOUT_TIMER_NUM_TICKS
        See Also:
        Constant Field Values
      • TIMEOUT_TIMER_TICK_DURATION_MS

        protected static final java.lang.String TIMEOUT_TIMER_TICK_DURATION_MS
        See Also:
        Constant Field Values
      • TIMEOUT_TIMER_NUM_TICKS

        protected static final java.lang.String TIMEOUT_TIMER_NUM_TICKS
        See Also:
        Constant Field Values
      • WAIT_TIMEOUT_ON_BACKPRESSURE

        protected static final java.lang.String WAIT_TIMEOUT_ON_BACKPRESSURE
        See Also:
        Constant Field Values
      • BOOKIE_HEALTH_CHECK_ENABLED

        protected static final java.lang.String BOOKIE_HEALTH_CHECK_ENABLED
        See Also:
        Constant Field Values
      • BOOKIE_HEALTH_CHECK_INTERVAL_SECONDS

        protected static final java.lang.String BOOKIE_HEALTH_CHECK_INTERVAL_SECONDS
        See Also:
        Constant Field Values
      • BOOKIE_ERROR_THRESHOLD_PER_INTERVAL

        protected static final java.lang.String BOOKIE_ERROR_THRESHOLD_PER_INTERVAL
        See Also:
        Constant Field Values
      • BOOKIE_QUARANTINE_TIME_SECONDS

        protected static final java.lang.String BOOKIE_QUARANTINE_TIME_SECONDS
        See Also:
        Constant Field Values
      • BOOKIE_QUARANTINE_RATIO

        protected static final java.lang.String BOOKIE_QUARANTINE_RATIO
        See Also:
        Constant Field Values
      • DISK_WEIGHT_BASED_PLACEMENT_ENABLED

        protected static final java.lang.String DISK_WEIGHT_BASED_PLACEMENT_ENABLED
        See Also:
        Constant Field Values
      • GET_BOOKIE_INFO_INTERVAL_SECONDS

        protected static final java.lang.String GET_BOOKIE_INFO_INTERVAL_SECONDS
        See Also:
        Constant Field Values
      • GET_BOOKIE_INFO_RETRY_INTERVAL_SECONDS

        protected static final java.lang.String GET_BOOKIE_INFO_RETRY_INTERVAL_SECONDS
        See Also:
        Constant Field Values
      • BOOKIE_MAX_MULTIPLE_FOR_WEIGHTED_PLACEMENT

        protected static final java.lang.String BOOKIE_MAX_MULTIPLE_FOR_WEIGHTED_PLACEMENT
        See Also:
        Constant Field Values
      • GET_BOOKIE_INFO_TIMEOUT_SECS

        protected static final java.lang.String GET_BOOKIE_INFO_TIMEOUT_SECS
        See Also:
        Constant Field Values
      • START_TLS_TIMEOUT_SECS

        protected static final java.lang.String START_TLS_TIMEOUT_SECS
        See Also:
        Constant Field Values
      • TLS_HOSTNAME_VERIFICATION_ENABLED

        protected static final java.lang.String TLS_HOSTNAME_VERIFICATION_ENABLED
        See Also:
        Constant Field Values
      • NUM_WORKER_THREADS

        protected static final java.lang.String NUM_WORKER_THREADS
        See Also:
        Constant Field Values
      • ENSEMBLE_PLACEMENT_POLICY

        public static final java.lang.String ENSEMBLE_PLACEMENT_POLICY
        See Also:
        Constant Field Values
      • NETWORK_TOPOLOGY_STABILIZE_PERIOD_SECONDS

        protected static final java.lang.String NETWORK_TOPOLOGY_STABILIZE_PERIOD_SECONDS
        See Also:
        Constant Field Values
      • READ_REORDER_THRESHOLD_PENDING_REQUESTS

        protected static final java.lang.String READ_REORDER_THRESHOLD_PENDING_REQUESTS
        See Also:
        Constant Field Values
      • BOOKIE_ADDRESS_RESOLVER_ENABLED

        protected static final java.lang.String BOOKIE_ADDRESS_RESOLVER_ENABLED
        See Also:
        Constant Field Values
      • USE_HOSTNAME_RESOLVE_LOCAL_NODE_PLACEMENT_POLICY

        public static final java.lang.String USE_HOSTNAME_RESOLVE_LOCAL_NODE_PLACEMENT_POLICY
        See Also:
        Constant Field Values
      • ENABLE_TASK_EXECUTION_STATS

        protected static final java.lang.String ENABLE_TASK_EXECUTION_STATS
        See Also:
        Constant Field Values
      • TASK_EXECUTION_WARN_TIME_MICROS

        protected static final java.lang.String TASK_EXECUTION_WARN_TIME_MICROS
        See Also:
        Constant Field Values
      • ENABLE_BOOKIE_FAILURE_TRACKING

        protected static final java.lang.String ENABLE_BOOKIE_FAILURE_TRACKING
        See Also:
        Constant Field Values
      • BOOKIE_FAILURE_HISTORY_EXPIRATION_MS

        protected static final java.lang.String BOOKIE_FAILURE_HISTORY_EXPIRATION_MS
        See Also:
        Constant Field Values
      • FOLLOW_BOOKIE_ADDRESS_TRACKING

        protected static final java.lang.String FOLLOW_BOOKIE_ADDRESS_TRACKING
        See Also:
        Constant Field Values
      • DISABLE_ENSEMBLE_CHANGE_FEATURE_NAME

        protected static final java.lang.String DISABLE_ENSEMBLE_CHANGE_FEATURE_NAME
        See Also:
        Constant Field Values
      • CLIENT_ROLE_STANDARD

        public static final java.lang.String CLIENT_ROLE_STANDARD
        This client will act as a standard client.
        See Also:
        Constant Field Values
      • CLIENT_ROLE_SYSTEM

        public static final java.lang.String CLIENT_ROLE_SYSTEM
        This client will act as a system client, like the Auditor.
        See Also:
        Constant Field Values
      • CLIENT_AUTH_PROVIDER_FACTORY_CLASS

        protected static final java.lang.String CLIENT_AUTH_PROVIDER_FACTORY_CLASS
        See Also:
        Constant Field Values
      • REGISTRATION_CLIENT_CLASS

        protected static final java.lang.String REGISTRATION_CLIENT_CLASS
        See Also:
        Constant Field Values
      • CLIENT_CONNECT_BOOKIE_UNAVAILABLE_LOG_THROTTLING

        protected static final java.lang.String CLIENT_CONNECT_BOOKIE_UNAVAILABLE_LOG_THROTTLING
        See Also:
        Constant Field Values
      • BATCH_READ_ENABLED

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

      • ClientConfiguration

        public ClientConfiguration()
        Construct a default client-side configuration.
      • ClientConfiguration

        public ClientConfiguration​(AbstractConfiguration conf)
        Construct a client-side configuration using a base configuration.
        Parameters:
        conf - Base configuration
    • Method Detail

      • getThrottleValue

        public int getThrottleValue()
        Get throttle value.
        Returns:
        throttle value
        See Also:
        setThrottleValue(int)
      • setThrottleValue

        public ClientConfiguration setThrottleValue​(int throttle)
        Set throttle value.

        Since BookKeeper process requests in asynchronous way, it will holds those pending request in queue. You may easily run it out of memory if producing too many requests than the capability of bookie servers can handle. To prevent that from happening, you can set a throttle value here.

        Setting the throttle value to 0, will disable any throttling.

        Parameters:
        throttle - Throttle Value
        Returns:
        client configuration
      • getEnableDigestTypeAutodetection

        public boolean getEnableDigestTypeAutodetection()
        Get autodetection of digest type.

        Ignores provided digestType, if enabled and uses one from ledger metadata instead. Incompatible with ledger created by bookie versions < 4.2

        It is turned on by default since 4.7.

        Returns:
        flag to enable/disable autodetection of digest type.
      • setEnableDigestTypeAutodetection

        public ClientConfiguration setEnableDigestTypeAutodetection​(boolean enable)
        Enable autodetection of digest type. Ignores provided digestType, if enabled and uses one from ledger metadata instead. Incompatible with ledger created by bookie versions < 4.2
        Returns:
        client configuration.
      • setBookieRecoveryDigestType

        public ClientConfiguration setBookieRecoveryDigestType​(BookKeeper.DigestType digestType)
        Set digest type used in bookkeeper admin.

        Digest Type and Passwd used to open ledgers for admin tool For now, assume that all ledgers were created with the same DigestType and password. In the future, this admin tool will need to know for each ledger, what was the DigestType and password used to create it before it can open it. These values will come from System properties, though fixed defaults are defined here.

        Parameters:
        digestType - Digest Type
        Returns:
        client configuration
      • getBookieRecoveryPasswd

        public byte[] getBookieRecoveryPasswd()
        Get passwd used in bookkeeper admin.
        Returns:
        password
        See Also:
        setBookieRecoveryPasswd(byte[])
      • setBookieRecoveryPasswd

        public ClientConfiguration setBookieRecoveryPasswd​(byte[] passwd)
        Set passwd used in bookkeeper admin.

        Digest Type and Passwd used to open ledgers for admin tool For now, assume that all ledgers were created with the same DigestType and password. In the future, this admin tool will need to know for each ledger, what was the DigestType and password used to create it before it can open it. These values will come from System properties, though fixed defaults are defined here.

        Parameters:
        passwd - Password
        Returns:
        client configuration
      • getClientTcpNoDelay

        public boolean getClientTcpNoDelay()
        Is tcp connection no delay.
        Returns:
        tcp socket nodelay setting
        See Also:
        setClientTcpNoDelay(boolean)
      • setClientTcpNoDelay

        public ClientConfiguration setClientTcpNoDelay​(boolean noDelay)
        Set socket nodelay setting.

        This settings is used to enabled/disabled Nagle's algorithm, which is a means of improving the efficiency of TCP/IP networks by reducing the number of packets that need to be sent over the network. If you are sending many small messages, such that more than one can fit in a single IP packet, setting client.tcpnodelay to false to enable Nagle algorithm can provide better performance.
        Default value is true.

        Parameters:
        noDelay - NoDelay setting
        Returns:
        client configuration
      • getClientSockKeepalive

        public boolean getClientSockKeepalive()
        get socket keepalive.
        Returns:
        socket keepalive setting
      • setClientSockKeepalive

        public ClientConfiguration setClientSockKeepalive​(boolean keepalive)
        Set socket keepalive setting.

        This setting is used to send keep-alive messages on connection-oriented sockets.

        Parameters:
        keepalive - KeepAlive setting
        Returns:
        client configuration
      • getClientSendBufferSize

        public int getClientSendBufferSize()
        Get client netty channel send buffer size.
        Returns:
        client netty channel send buffer size
      • setClientSendBufferSize

        public ClientConfiguration setClientSendBufferSize​(int bufferSize)
        Set client netty channel send buffer size.
        Parameters:
        bufferSize - client netty channel send buffer size.
        Returns:
        client configuration.
      • getClientReceiveBufferSize

        public int getClientReceiveBufferSize()
        Get client netty channel receive buffer size.
        Returns:
        client netty channel receive buffer size.
      • setClientReceiveBufferSize

        public ClientConfiguration setClientReceiveBufferSize​(int bufferSize)
        Set client netty channel receive buffer size.
        Parameters:
        bufferSize - netty channel receive buffer size.
        Returns:
        client configuration.
      • getClientWriteBufferLowWaterMark

        public int getClientWriteBufferLowWaterMark()
        Get client netty channel write buffer low water mark.
        Returns:
        netty channel write buffer low water mark.
      • setClientWriteBufferLowWaterMark

        public ClientConfiguration setClientWriteBufferLowWaterMark​(int waterMark)
        Set client netty channel write buffer low water mark.
        Parameters:
        waterMark - netty channel write buffer low water mark.
        Returns:
        client configuration.
      • getClientWriteBufferHighWaterMark

        public int getClientWriteBufferHighWaterMark()
        Get client netty channel write buffer high water mark.
        Returns:
        netty channel write buffer high water mark.
      • setClientWriteBufferHighWaterMark

        public ClientConfiguration setClientWriteBufferHighWaterMark​(int waterMark)
        Set client netty channel write buffer high water mark.
        Parameters:
        waterMark - netty channel write buffer high water mark.
        Returns:
        client configuration.
      • getTimeoutTimerTickDurationMs

        public long getTimeoutTimerTickDurationMs()
        Get the tick duration in milliseconds that used for timeout timer.
        Returns:
        tick duration in milliseconds
      • setTimeoutTimerTickDurationMs

        public ClientConfiguration setTimeoutTimerTickDurationMs​(long tickDuration)
        Set the tick duration in milliseconds that used for timeout timer.
        Parameters:
        tickDuration - tick duration in milliseconds.
        Returns:
        client configuration.
      • getTimeoutTimerNumTicks

        public int getTimeoutTimerNumTicks()
        Get number of ticks that used for timeout timer.
        Returns:
        number of ticks that used for timeout timer.
      • setTimeoutTimerNumTicks

        public ClientConfiguration setTimeoutTimerNumTicks​(int numTicks)
        Set number of ticks that used for timeout timer.
        Parameters:
        numTicks - number of ticks that used for timeout timer.
        Returns:
        client configuration.
      • getClientConnectTimeoutMillis

        public int getClientConnectTimeoutMillis()
        Get client netty connect timeout in millis.
        Returns:
        client netty connect timeout in millis.
      • setClientConnectTimeoutMillis

        public ClientConfiguration setClientConnectTimeoutMillis​(int connectTimeoutMillis)
        Set client netty connect timeout in millis.
        Parameters:
        connectTimeoutMillis - client netty connect timeout in millis.
        Returns:
        client configuration.
      • getTcpUserTimeoutMillis

        public int getTcpUserTimeoutMillis()
        Get client netty TCP user timeout in millis (only for Epoll channels).
        Returns:
        client netty Epoll user tcp timeout in millis.
        Throws:
        java.util.NoSuchElementException - if the property is not set.
      • setTcpUserTimeoutMillis

        public ClientConfiguration setTcpUserTimeoutMillis​(int tcpUserTimeoutMillis)
        Set client netty TCP user timeout in millis (only for Epoll channels).
        Parameters:
        tcpUserTimeoutMillis - client netty TCP user timeout in millis.
        Returns:
        client configuration.
      • getNumChannelsPerBookie

        public int getNumChannelsPerBookie()
        Get num channels per bookie.
        Returns:
        num channels per bookie.
      • setNumChannelsPerBookie

        public ClientConfiguration setNumChannelsPerBookie​(int numChannelsPerBookie)
        Set num channels per bookie.
        Parameters:
        numChannelsPerBookie - num channels per bookie.
        Returns:
        client configuration.
      • getUseV2WireProtocol

        public boolean getUseV2WireProtocol()
        Use older Bookkeeper wire protocol (no protobuf).
        Returns:
        whether or not to use older Bookkeeper wire protocol (no protobuf)
      • setUseV2WireProtocol

        public ClientConfiguration setUseV2WireProtocol​(boolean useV2WireProtocol)
        Set whether or not to use older Bookkeeper wire protocol (no protobuf).
        Parameters:
        useV2WireProtocol - whether or not to use older Bookkeeper wire protocol (no protobuf)
        Returns:
        client configuration.
      • getReadTimeout

        @Deprecated
        public int getReadTimeout()
        Deprecated.
        Get the socket read timeout. This is the number of seconds we wait without hearing a response from a bookie before we consider it failed.

        The default is 5 seconds.

        Returns:
        the current read timeout in seconds
      • getAddEntryTimeout

        public int getAddEntryTimeout()
        Get the timeout for add request. This is the number of seconds we wait without hearing a response for add request from a bookie before we consider it failed.

        The default value is 5 second for backwards compatibility.

        Returns:
        add entry timeout.
      • setAddEntryTimeout

        public ClientConfiguration setAddEntryTimeout​(int timeout)
        Set timeout for add entry request.
        Parameters:
        timeout - The new add entry timeout in seconds.
        Returns:
        client configuration.
        See Also:
        getAddEntryTimeout()
      • getAddEntryQuorumTimeout

        public int getAddEntryQuorumTimeout()
        Get the timeout for top-level add request. That is, the amount of time we should spend waiting for ack quorum.
        Returns:
        add entry ack quorum timeout.
      • setAddEntryQuorumTimeout

        public ClientConfiguration setAddEntryQuorumTimeout​(int timeout)
        Set timeout for top-level add entry request.
        Parameters:
        timeout - The new add entry ack quorum timeout in seconds.
        Returns:
        client configuration.
        See Also:
        getAddEntryQuorumTimeout()
      • getReadEntryTimeout

        public int getReadEntryTimeout()
        Get the timeout for read entry. This is the number of seconds we wait without hearing a response for read entry request from a bookie before we consider it failed. By default, we use socket timeout specified at getReadTimeout().
        Returns:
        read entry timeout.
      • setReadEntryTimeout

        public ClientConfiguration setReadEntryTimeout​(int timeout)
        Set the timeout for read entry request.
        Parameters:
        timeout - The new read entry timeout in seconds.
        Returns:
        client configuration.
        See Also:
        getReadEntryTimeout()
      • getTimeoutMonitorIntervalSec

        public long getTimeoutMonitorIntervalSec()
        Get the interval between successive executions of the operation timeout monitor. This value is in seconds.
        Returns:
        the interval at which request timeouts will be checked
        See Also:
        setTimeoutMonitorIntervalSec(long)
      • setTimeoutMonitorIntervalSec

        public ClientConfiguration setTimeoutMonitorIntervalSec​(long timeoutInterval)
        Set the interval between successive executions of the operation timeout monitor. The value in seconds. Every X seconds, all outstanding add and read operations are checked to see if they have been running for longer than their configured timeout. Any that have been will be errored out.

        This timeout should be set to a value which is a fraction of the values of getAddEntryQuorumTimeout(), getAddEntryTimeout() and getReadEntryTimeout(), so that these timeouts run in a timely fashion.

        Parameters:
        timeoutInterval - The timeout monitor interval, in seconds
        Returns:
        client configuration
      • getTimeoutTaskIntervalMillis

        @Deprecated
        public long getTimeoutTaskIntervalMillis()
        Deprecated.
        Get the interval between successive executions of the PerChannelBookieClient's TimeoutTask. This value is in milliseconds. Every X milliseconds, the timeout task will be executed and it will error out entries that have timed out.

        We do it more aggressive to not accumulate pending requests due to slow responses.

        Returns:
        the interval at which request timeouts will be checked
      • setTimeoutTaskIntervalMillis

        @Deprecated
        public ClientConfiguration setTimeoutTaskIntervalMillis​(long timeoutMillis)
        Deprecated.
      • getExplictLacInterval

        public int getExplictLacInterval()
        Get the configured interval between explicit LACs to bookies. Generally LACs are piggy-backed on writes, and user can configure the interval between these protocol messages. A value of '0' disables sending any explicit LACs.
        Returns:
        interval between explicit LACs
      • setExplictLacInterval

        public ClientConfiguration setExplictLacInterval​(int interval)
        Set the interval to check the need for sending an explicit LAC.
        Parameters:
        interval - Number of milli seconds between checking the need for sending an explict LAC.
        Returns:
        Client configuration.
      • getPCBCTimeoutTimerTickDurationMs

        @Deprecated
        public long getPCBCTimeoutTimerTickDurationMs()
        Deprecated.
        Get the tick duration in milliseconds that used for the HashedWheelTimer that used by PCBC to timeout requests.
        Returns:
        tick duration in milliseconds
      • setPCBCTimeoutTimerTickDurationMs

        @Deprecated
        public ClientConfiguration setPCBCTimeoutTimerTickDurationMs​(long tickDuration)
        Deprecated.
        Set the tick duration in milliseconds that used for HashedWheelTimer that used by PCBC to timeout requests. Be aware of HashedWheelTimer if you are going to modify this setting.
        Parameters:
        tickDuration - tick duration in milliseconds.
        Returns:
        client configuration.
        See Also:
        getPCBCTimeoutTimerTickDurationMs()
      • getPCBCTimeoutTimerNumTicks

        @Deprecated
        public int getPCBCTimeoutTimerNumTicks()
        Deprecated.
        Get number of ticks that used for HashedWheelTimer that used by PCBC to timeout requests.
        Returns:
        number of ticks that used for timeout timer.
      • setPCBCTimeoutTimerNumTicks

        @Deprecated
        public ClientConfiguration setPCBCTimeoutTimerNumTicks​(int numTicks)
        Deprecated.
        Set number of ticks that used for HashedWheelTimer that used by PCBC to timeout request. Be aware of HashedWheelTimer if you are going to modify this setting.
        Parameters:
        numTicks - number of ticks that used for timeout timer.
        Returns:
        client configuration.
        See Also:
        getPCBCTimeoutTimerNumTicks()
      • getWaitTimeoutOnBackpressureMillis

        public long getWaitTimeoutOnBackpressureMillis()
        Timeout controlling wait on request send in case of unresponsive bookie(s) (i.e. bookie in long GC etc.)
        Returns:
        timeout value negative value disables the feature 0 to allow request to fail immediately Default is -1 (disabled)
      • setWaitTimeoutOnBackpressureMillis

        public ClientConfiguration setWaitTimeoutOnBackpressureMillis​(long value)
        Timeout controlling wait on request send in case of unresponsive bookie(s) (i.e. bookie in long GC etc.)
        Parameters:
        value - negative value disables the feature 0 to allow request to fail immediately Default is -1 (disabled)
        Returns:
        client configuration.
      • getNumWorkerThreads

        public int getNumWorkerThreads()
        Get the number of worker threads. This is the number of worker threads used by bookkeeper client to submit operations.
        Returns:
        the number of worker threads
      • setNumWorkerThreads

        public ClientConfiguration setNumWorkerThreads​(int numThreads)
        Set the number of worker threads.

        NOTE: setting the number of worker threads after BookKeeper object is constructed will not take any effect on the number of threads in the pool.

        Parameters:
        numThreads - number of worker threads used for bookkeeper
        Returns:
        client configuration
        See Also:
        getNumWorkerThreads()
      • getNumIOThreads

        public int getNumIOThreads()
        Get the number of IO threads. This is the number of threads used by Netty to handle TCP connections.
        Returns:
        the number of IO threads
      • setNumIOThreads

        public ClientConfiguration setNumIOThreads​(int numThreads)
        Set the number of IO threads.

        This is the number of threads used by Netty to handle TCP connections.

        NOTE: setting the number of IO threads after BookKeeper object is constructed will not take any effect on the number of threads in the pool.

        Parameters:
        numThreads - number of IO threads used for bookkeeper
        Returns:
        client configuration
        See Also:
        getNumIOThreads()
      • getSpeculativeReadTimeout

        public int getSpeculativeReadTimeout()
        Get the period of time after which a speculative entry read should be triggered. A speculative entry read is sent to the next replica bookie before an error or response has been received for the previous entry read request.

        A speculative entry read is only sent if we have not heard from the current replica bookie during the entire read operation which may comprise of many entries.

        Speculative reads allow the client to avoid having to wait for the connect timeout in the case that a bookie has failed. It induces higher load on the network and on bookies. This should be taken into account before changing this configuration value.

        Returns:
        the speculative read timeout in milliseconds. Default 2000.
        See Also:
        LedgerHandle.asyncReadEntries(long, long, org.apache.bookkeeper.client.AsyncCallback.ReadCallback, java.lang.Object)
      • setSpeculativeReadTimeout

        public ClientConfiguration setSpeculativeReadTimeout​(int timeout)
        Set the speculative read timeout. A lower timeout will reduce read latency in the case of a failed bookie, while increasing the load on bookies and the network.

        The default is 2000 milliseconds. A value of 0 will disable speculative reads completely.

        Parameters:
        timeout - the timeout value, in milliseconds
        Returns:
        client configuration
        See Also:
        getSpeculativeReadTimeout()
      • getFirstSpeculativeReadTimeout

        public int getFirstSpeculativeReadTimeout()
        Get the first speculative read timeout.
        Returns:
        first speculative read timeout.
      • setFirstSpeculativeReadTimeout

        public ClientConfiguration setFirstSpeculativeReadTimeout​(int timeout)
        Set the first speculative read timeout.
        Parameters:
        timeout - first speculative read timeout.
        Returns:
        client configuration.
      • getSpeculativeReadTimeoutBackoffMultiplier

        public float getSpeculativeReadTimeoutBackoffMultiplier()
        Multiplier to use when determining time between successive speculative read requests.
        Returns:
        speculative read timeout backoff multiplier.
      • setSpeculativeReadTimeoutBackoffMultiplier

        public ClientConfiguration setSpeculativeReadTimeoutBackoffMultiplier​(float speculativeReadTimeoutBackoffMultiplier)
        Set the multiplier to use when determining time between successive speculative read requests.
        Parameters:
        speculativeReadTimeoutBackoffMultiplier - multiplier to use when determining time between successive speculative read requests.
        Returns:
        client configuration.
      • getSpeculativeReadLACTimeoutBackoffMultiplier

        public float getSpeculativeReadLACTimeoutBackoffMultiplier()
        Multiplier to use when determining time between successive speculative read LAC requests.
        Returns:
        speculative read LAC timeout backoff multiplier.
      • setSpeculativeReadLACTimeoutBackoffMultiplier

        public ClientConfiguration setSpeculativeReadLACTimeoutBackoffMultiplier​(float speculativeReadLACTimeoutBackoffMultiplier)
        Set the multiplier to use when determining time between successive speculative read LAC requests.
        Parameters:
        speculativeReadLACTimeoutBackoffMultiplier - multiplier to use when determining time between successive speculative read LAC requests.
        Returns:
        client configuration.
      • getMaxSpeculativeReadTimeout

        public int getMaxSpeculativeReadTimeout()
        Get the max speculative read timeout.
        Returns:
        max speculative read timeout.
      • setMaxSpeculativeReadTimeout

        public ClientConfiguration setMaxSpeculativeReadTimeout​(int timeout)
        Set the max speculative read timeout.
        Parameters:
        timeout - max speculative read timeout.
        Returns:
        client configuration.
      • getFirstSpeculativeReadLACTimeout

        public int getFirstSpeculativeReadLACTimeout()
        Get the period of time after which the first speculative read last add confirmed and entry should be triggered. A speculative entry request is sent to the next replica bookie before an error or response has been received for the previous entry read request.

        A speculative entry read is only sent if we have not heard from the current replica bookie during the entire read operation which may comprise of many entries.

        Speculative requests allow the client to avoid having to wait for the connect timeout in the case that a bookie has failed. It induces higher load on the network and on bookies. This should be taken into account before changing this configuration value.

        Returns:
        the speculative request timeout in milliseconds. Default 1500.
      • getMaxSpeculativeReadLACTimeout

        public int getMaxSpeculativeReadLACTimeout()
        Get the maximum interval between successive speculative read last add confirmed and entry requests.
        Returns:
        the max speculative request timeout in milliseconds. Default 5000.
      • setFirstSpeculativeReadLACTimeout

        public ClientConfiguration setFirstSpeculativeReadLACTimeout​(int timeout)
        Set the period of time after which the first speculative read last add confirmed and entry should be triggered. A lower timeout will reduce read latency in the case of a failed bookie, while increasing the load on bookies and the network.

        The default is 1500 milliseconds. A value of 0 will disable speculative reads completely.

        Parameters:
        timeout - the timeout value, in milliseconds
        Returns:
        client configuration
        See Also:
        getSpeculativeReadTimeout()
      • setMaxSpeculativeReadLACTimeout

        public ClientConfiguration setMaxSpeculativeReadLACTimeout​(int timeout)
        Set the maximum interval between successive speculative read last add confirmed and entry requests.
        Parameters:
        timeout - the timeout value, in milliseconds
        Returns:
        client configuration
      • getEnableParallelRecoveryRead

        public boolean getEnableParallelRecoveryRead()
        Whether to enable parallel reading in recovery read.
        Returns:
        true if enable parallel reading in recovery read. otherwise, return false.
      • setEnableParallelRecoveryRead

        public ClientConfiguration setEnableParallelRecoveryRead​(boolean enabled)
        Enable/Disable parallel reading in recovery read.
        Parameters:
        enabled - flag to enable/disable parallel reading in recovery read.
        Returns:
        client configuration.
      • getRecoveryReadBatchSize

        public int getRecoveryReadBatchSize()
        Get Recovery Read Batch Size.
        Returns:
        recovery read batch size.
      • setRecoveryReadBatchSize

        public ClientConfiguration setRecoveryReadBatchSize​(int batchSize)
        Set Recovery Read Batch Size.
        Parameters:
        batchSize - recovery read batch size.
        Returns:
        client configuration.
      • isReorderReadSequenceEnabled

        public boolean isReorderReadSequenceEnabled()
        If reorder read sequence enabled or not.
        Returns:
        true if reorder read sequence is enabled, otherwise false.
      • isStickyReadsEnabled

        public boolean isStickyReadsEnabled()
        If read operation should be sticky to a single bookie or not.
        Returns:
        true if reorder read sequence is enabled, otherwise false.
      • setStickyReadsEnabled

        public ClientConfiguration setStickyReadsEnabled​(boolean enabled)
        Enable/disable having read operations for a ledger to be sticky to a single bookie.

        If this flag is enabled, the client will use one single bookie (by preference) to read all entries for a ledger.

        Having all the read to one bookie will increase the chances that a read request will be fulfilled by Bookie read cache (or OS file system cache) when doing sequential reads.

        Parameters:
        enabled - the flag to enable/disable sticky reads.
        Returns:
        client configuration instance.
      • isRecoveryBatchReadEnabled

        public boolean isRecoveryBatchReadEnabled()
        If recovery batch read enabled or not.
        Returns:
      • setRecoveryBatchReadEnabled

        public ClientConfiguration setRecoveryBatchReadEnabled​(boolean enabled)
        Enable/disable recovery batch read.
        Parameters:
        enabled -
        Returns:
      • getEnsemblePlacementPolicy

        public java.lang.Class<? extends EnsemblePlacementPolicy> getEnsemblePlacementPolicy()
                                                                                      throws org.apache.commons.configuration.ConfigurationException
        Get Ensemble Placement Policy Class.
        Returns:
        ensemble placement policy class.
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • setEnsemblePlacementPolicy

        public ClientConfiguration setEnsemblePlacementPolicy​(java.lang.Class<? extends EnsemblePlacementPolicy> policyClass)
        Set Ensemble Placement Policy Class.
        Parameters:
        policyClass - Ensemble Placement Policy Class.
      • getReorderThresholdPendingRequests

        public int getReorderThresholdPendingRequests()
        Get the threshold for the number of pending requests beyond which to reorder reads. If <= zero, this feature is turned off.
        Returns:
        the threshold for the number of pending requests beyond which to reorder reads.
      • setReorderThresholdPendingRequests

        public ClientConfiguration setReorderThresholdPendingRequests​(int threshold)
        Set the threshold for the number of pending requests beyond which to reorder reads. If zero, this feature is turned off.
        Parameters:
        threshold - The threshold for the number of pending requests beyond which to reorder reads.
      • getNetworkTopologyStabilizePeriodSeconds

        public int getNetworkTopologyStabilizePeriodSeconds()
        Get the network topology stabilize period in seconds. if it is zero, this feature is turned off.
        Returns:
        network topology stabilize period in seconds.
      • setNetworkTopologyStabilizePeriodSeconds

        public ClientConfiguration setNetworkTopologyStabilizePeriodSeconds​(int seconds)
        Set the network topology stabilize period in seconds.
        Parameters:
        seconds - stabilize period in seconds
        Returns:
        client configuration.
        See Also:
        getNetworkTopologyStabilizePeriodSeconds()
      • getBookieAddressResolverEnabled

        public boolean getBookieAddressResolverEnabled()
        Whether to enable BookieAddressResolver.
        Returns:
        flag to enable/disable BookieAddressResolver.
      • setBookieAddressResolverEnabled

        public ClientConfiguration setBookieAddressResolverEnabled​(boolean enabled)
        Enable/Disable BookieAddressResolver.

        If this flag is true, read bookie information from the metadata service (e.g. ZooKeeper) to resolve the address from each bookie ID. If all bookie IDs in the cluster are "address:port" or "hostname:port", you can set this flag to false to reduce requests to the metadata service.

        Parameters:
        enabled - flag to enable/disable BookieAddressResolver.
        Returns:
        client configuration.
      • setUseHostnameResolveLocalNodePlacementPolicy

        public void setUseHostnameResolveLocalNodePlacementPolicy​(boolean useHostnameResolveLocalNodePlacementPolicy)
        Set the flag to use hostname to resolve local node placement policy.
        Parameters:
        useHostnameResolveLocalNodePlacementPolicy -
      • getUseHostnameResolveLocalNodePlacementPolicy

        public boolean getUseHostnameResolveLocalNodePlacementPolicy()
        Get whether to use hostname to resolve local node placement policy.
        Returns:
      • getEnableTaskExecutionStats

        public boolean getEnableTaskExecutionStats()
        Whether to enable recording task execution stats.
        Returns:
        flag to enable/disable recording task execution stats.
      • setEnableTaskExecutionStats

        public ClientConfiguration setEnableTaskExecutionStats​(boolean enabled)
        Enable/Disable recording task execution stats.
        Parameters:
        enabled - flag to enable/disable recording task execution stats.
        Returns:
        client configuration.
      • getTaskExecutionWarnTimeMicros

        public long getTaskExecutionWarnTimeMicros()
        Get task execution duration which triggers a warning.
        Returns:
        time in microseconds which triggers a warning.
      • setTaskExecutionWarnTimeMicros

        public ClientConfiguration setTaskExecutionWarnTimeMicros​(long warnTime)
        Set task execution duration which triggers a warning.
        Parameters:
        warnTime - time in microseconds which triggers a warning.
        Returns:
        client configuration.
      • isBookieHealthCheckEnabled

        public boolean isBookieHealthCheckEnabled()
        Check if bookie health check is enabled.
        Returns:
      • enableBookieHealthCheck

        public ClientConfiguration enableBookieHealthCheck()
        Enables the bookie health check.

        If the number of read/write errors for a bookie exceeds getBookieErrorThresholdPerInterval() per interval, that bookie is quarantined for getBookieQuarantineTimeSeconds() seconds. During this quarantined period, the client will try not to use this bookie when creating new ensembles.

        By default, the bookie health check is disabled.

        Returns:
        client configuration
      • getBookieHealthCheckIntervalSeconds

        public int getBookieHealthCheckIntervalSeconds()
        Get the bookie health check interval in seconds.
        Returns:
      • setBookieHealthCheckInterval

        public ClientConfiguration setBookieHealthCheckInterval​(int interval,
                                                                java.util.concurrent.TimeUnit unit)
        Set the bookie health check interval. Default is 60 seconds.

        Note: Please enableBookieHealthCheck() to use this configuration.

        Parameters:
        interval -
        unit -
        Returns:
        client configuration
      • getBookieErrorThresholdPerInterval

        public long getBookieErrorThresholdPerInterval()
        Get the error threshold for a bookie to be quarantined.
        Returns:
      • setBookieErrorThresholdPerInterval

        public ClientConfiguration setBookieErrorThresholdPerInterval​(long thresholdPerInterval)
        Set the error threshold per interval (getBookieHealthCheckIntervalSeconds()) for a bookie before it is quarantined. Default is 100 errors per minute.

        Note: Please enableBookieHealthCheck() to use this configuration.

        Parameters:
        thresholdPerInterval -
        Returns:
        client configuration
      • getBookieQuarantineTimeSeconds

        public int getBookieQuarantineTimeSeconds()
        Get the time for which a bookie will be quarantined.
        Returns:
      • setBookieQuarantineTime

        public ClientConfiguration setBookieQuarantineTime​(int quarantineTime,
                                                           java.util.concurrent.TimeUnit unit)
        Set the time for which a bookie will be quarantined. Default is 30 minutes.

        Note: Please enableBookieHealthCheck() to use this configuration.

        Parameters:
        quarantineTime -
        unit -
        Returns:
        client configuration
      • getBookieQuarantineRatio

        public double getBookieQuarantineRatio()
        Get the bookie quarantine ratio.
        Returns:
      • setBookieQuarantineRatio

        public ClientConfiguration setBookieQuarantineRatio​(double ratio)
        set the bookie quarantine ratio. default is 1.0.
        Parameters:
        ratio -
        Returns:
        client configuration
      • getGetBookieInfoIntervalSeconds

        public int getGetBookieInfoIntervalSeconds()
        Get the time interval between successive calls for bookie get info. Default is 24 hours.
        Returns:
      • getGetBookieInfoRetryIntervalSeconds

        public int getGetBookieInfoRetryIntervalSeconds()
        Get the time interval between retries on unsuccessful bookie info request. Default is 60s.
        Returns:
      • getDiskWeightBasedPlacementEnabled

        public boolean getDiskWeightBasedPlacementEnabled()
        Return whether disk weight based placement policy is enabled.
        Returns:
      • getBookieMaxWeightMultipleForWeightBasedPlacement

        public int getBookieMaxWeightMultipleForWeightBasedPlacement()
        Returns the max multiple to use for nodes with very high weight.
        Returns:
        max multiple
      • getBookieInfoTimeout

        public int getBookieInfoTimeout()
        Return the timeout value for getBookieInfo request.
        Returns:
      • getStartTLSTimeout

        public int getStartTLSTimeout()
        Return the timeout value for startTLS request.
        Returns:
      • setDiskWeightBasedPlacementEnabled

        public ClientConfiguration setDiskWeightBasedPlacementEnabled​(boolean isEnabled)
        Set whether or not disk weight based placement is enabled.
        Parameters:
        isEnabled - - boolean indicating enabled or not
        Returns:
        client configuration
      • setGetBookieInfoIntervalSeconds

        public ClientConfiguration setGetBookieInfoIntervalSeconds​(int pollInterval,
                                                                   java.util.concurrent.TimeUnit unit)
        Set the time interval between successive polls for bookie get info.
        Parameters:
        pollInterval -
        unit -
        Returns:
        client configuration
      • setGetBookieInfoRetryIntervalSeconds

        public ClientConfiguration setGetBookieInfoRetryIntervalSeconds​(int interval,
                                                                        java.util.concurrent.TimeUnit unit)
        Set the time interval between retries on unsuccessful GetInfo requests.
        Parameters:
        interval -
        unit -
        Returns:
        client configuration
      • setBookieMaxWeightMultipleForWeightBasedPlacement

        public ClientConfiguration setBookieMaxWeightMultipleForWeightBasedPlacement​(int multiple)
        Set the max multiple to use for nodes with very high weight.
        Parameters:
        multiple -
        Returns:
        client configuration
      • setGetBookieInfoTimeout

        public ClientConfiguration setGetBookieInfoTimeout​(int timeoutSecs)
        Set the timeout value in secs for the GET_BOOKIE_INFO request.
        Parameters:
        timeoutSecs -
        Returns:
        client configuration
      • setStartTLSTimeout

        public ClientConfiguration setStartTLSTimeout​(int timeoutSecs)
        Set the timeout value in secs for the START_TLS request.
        Parameters:
        timeoutSecs -
        Returns:
        client configuration
      • getHostnameVerificationEnabled

        public boolean getHostnameVerificationEnabled()
        Whether hostname verification enabled?
        Returns:
        true if hostname verification enabled, otherwise false.
      • setHostnameVerificationEnabled

        public ClientConfiguration setHostnameVerificationEnabled​(boolean enabled)
        Enable/Disable hostname verification for tls connection.
        Parameters:
        enabled - flag to enable/disable tls hostname verification.
        Returns:
        client configuration.
      • setClientRole

        public ClientConfiguration setClientRole​(java.lang.String role)
        Set the client role.
        Parameters:
        role - defines how the client will act
        Returns:
        client configuration
      • getClientRole

        public java.lang.String getClientRole()
        Get the role of the client.
        Returns:
        the type of client
      • getTLSKeyStoreType

        public java.lang.String getTLSKeyStoreType()
        Get the keystore type for client. Default is JKS.
        Returns:
      • setTLSKeyStoreType

        public ClientConfiguration setTLSKeyStoreType​(java.lang.String arg)
        Set the keystore type for client.
        Returns:
      • getTLSKeyStore

        public java.lang.String getTLSKeyStore()
        Get the keystore path for the client.
        Returns:
      • setTLSKeyStore

        public ClientConfiguration setTLSKeyStore​(java.lang.String arg)
        Set the keystore path for the client.
        Returns:
      • getTLSKeyStorePasswordPath

        public java.lang.String getTLSKeyStorePasswordPath()
        Get the path to file containing keystore password, if the client keystore is password protected. Default is null.
        Returns:
      • setTLSKeyStorePasswordPath

        public ClientConfiguration setTLSKeyStorePasswordPath​(java.lang.String arg)
        Set the path to file containing keystore password, if the client keystore is password protected.
        Returns:
      • getTLSTrustStoreType

        public java.lang.String getTLSTrustStoreType()
        Get the truststore type for client. Default is JKS.
        Returns:
      • setTLSTrustStoreType

        public ClientConfiguration setTLSTrustStoreType​(java.lang.String arg)
        Set the truststore type for client.
        Returns:
      • getTLSTrustStore

        public java.lang.String getTLSTrustStore()
        Get the truststore path for the client.
        Returns:
      • setTLSTrustStore

        public ClientConfiguration setTLSTrustStore​(java.lang.String arg)
        Set the truststore path for the client.
        Returns:
      • getTLSTrustStorePasswordPath

        public java.lang.String getTLSTrustStorePasswordPath()
        Get the path to file containing truststore password, if the client truststore is password protected. Default is null.
        Returns:
      • setTLSTrustStorePasswordPath

        public ClientConfiguration setTLSTrustStorePasswordPath​(java.lang.String arg)
        Set the path to file containing truststore password, if the client truststore is password protected.
        Returns:
      • getTLSCertificatePath

        public java.lang.String getTLSCertificatePath()
        Get the path to file containing TLS Certificate.
        Returns:
      • setTLSCertificatePath

        public ClientConfiguration setTLSCertificatePath​(java.lang.String arg)
        Set the path to file containing TLS Certificate.
        Returns:
      • getOpportunisticStriping

        public boolean getOpportunisticStriping()
        Whether to allow opportunistic striping.
        Returns:
        true if opportunistic striping is enabled
      • setOpportunisticStriping

        public ClientConfiguration setOpportunisticStriping​(boolean enabled)
        Enable/Disable opportunistic striping.

        If set to true, when you are creating a ledger with a given ensemble size, the system will automatically handle the lack of enough bookies, reducing ensemble size up to the write quorum size. This way in little clusters you can try to use striping (ensemble size > write quorum size) in case that you have enough bookies up and running, and degrade automatically to the minimum requested replication count.

        Parameters:
        enabled - flag to enable/disable opportunistic striping.
        Returns:
        client configuration.
      • getDelayEnsembleChange

        public boolean getDelayEnsembleChange()
        Whether to delay ensemble change or not?
        Returns:
        true if to delay ensemble change, otherwise false.
      • setDelayEnsembleChange

        public ClientConfiguration setDelayEnsembleChange​(boolean enabled)
        Enable/Disable delaying ensemble change.

        If set to true, ensemble change only happens when it can't meet ack quorum requirement. If set to false, ensemble change happens immediately when it received a failed write.

        Parameters:
        enabled - flag to enable/disable delaying ensemble change.
        Returns:
        client configuration.
      • getEnableBookieAddressTracking

        public boolean getEnableBookieAddressTracking()
        Whether to enable bookie address changes tracking.
        Returns:
        flag to enable/disable bookie address changes tracking
      • setEnableBookieAddressTracking

        public ClientConfiguration setEnableBookieAddressTracking​(boolean value)
        Enable/Disable bookie address changes tracking.
        Parameters:
        value - flag to enable/disable bookie address changes tracking
        Returns:
        client configuration.
      • getEnableBookieFailureTracking

        public boolean getEnableBookieFailureTracking()
        Whether to enable bookie failure tracking.
        Returns:
        flag to enable/disable bookie failure tracking
      • setEnableBookieFailureTracking

        public ClientConfiguration setEnableBookieFailureTracking​(boolean enabled)
        Enable/Disable bookie failure tracking.
        Parameters:
        enabled - flag to enable/disable bookie failure tracking
        Returns:
        client configuration.
      • getBookieFailureHistoryExpirationMSec

        public int getBookieFailureHistoryExpirationMSec()
        Get the bookie failure tracking expiration timeout.
        Returns:
        bookie failure tracking expiration timeout.
      • setBookieFailureHistoryExpirationMSec

        public ClientConfiguration setBookieFailureHistoryExpirationMSec​(int expirationMSec)
        Set the bookie failure tracking expiration timeout.
        Parameters:
        expirationMSec - bookie failure tracking expiration timeout.
        Returns:
        client configuration.
      • getDisableEnsembleChangeFeatureName

        public java.lang.String getDisableEnsembleChangeFeatureName()
        Get the name of the dynamic feature that disables ensemble change.
        Returns:
        name of the dynamic feature that disables ensemble change
      • setDisableEnsembleChangeFeatureName

        public ClientConfiguration setDisableEnsembleChangeFeatureName​(java.lang.String disableEnsembleChangeFeatureName)
        Set the name of the dynamic feature that disables ensemble change.
        Parameters:
        disableEnsembleChangeFeatureName - name of the dynamic feature that disables ensemble change
        Returns:
        client configuration.
      • getMaxAllowedEnsembleChanges

        public int getMaxAllowedEnsembleChanges()
        Get the max allowed ensemble change number.
        Returns:
        value of MaxAllowedEnsembleChanges, default MAX_VALUE, indicating feature is disable.
      • setMaxAllowedEnsembleChanges

        public ClientConfiguration setMaxAllowedEnsembleChanges​(int num)
        Set the max allowed ensemble change number.
        Parameters:
        num - value of MaxAllowedEnsembleChanges
        Returns:
        client configuration.
      • setRegistrationClientClass

        @Deprecated
        public ClientConfiguration setRegistrationClientClass​(java.lang.Class<? extends RegistrationClient> regClientClass)
        Deprecated.
        since 4.7.0
        Set registration manager class.
        Parameters:
        regClientClass - ClientClass
      • getRegistrationClientClass

        @Deprecated
        public java.lang.Class<? extends RegistrationClient> getRegistrationClientClass()
                                                                                 throws org.apache.commons.configuration.ConfigurationException
        Deprecated.
        since 4.7.0
        Get Registration Client Class.
        Returns:
        registration manager class.
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • setStoreSystemtimeAsLedgerCreationTime

        public ClientConfiguration setStoreSystemtimeAsLedgerCreationTime​(boolean enabled)
        Enable the client to use system time as the ledger creation time.

        If this is enabled, the client will write a ctime field into the ledger metadata. Otherwise, nothing will be written. The creation time of this ledger will be the ctime of the metadata record in metadata store.

        Parameters:
        enabled - flag to enable/disable client using system time as the ledger creation time.
      • getStoreSystemtimeAsLedgerCreationTime

        public boolean getStoreSystemtimeAsLedgerCreationTime()
        Return the flag that indicates whether client is using system time as the ledger creation time when creating ledgers.
        Returns:
        the flag that indicates whether client is using system time as the ledger creation time when creating ledgers.
      • setClientConnectBookieUnavailableLogThrottling

        public ClientConfiguration setClientConnectBookieUnavailableLogThrottling​(int throttleValue,
                                                                                  java.util.concurrent.TimeUnit unit)
        Set the log frequency when a bookie is unavailable, in order to limit log filesize.
        Parameters:
        throttleValue -
        unit -
        Returns:
        client configuration.
      • getClientConnectBookieUnavailableLogThrottlingMs

        public long getClientConnectBookieUnavailableLogThrottlingMs()
        Get the log frequency when a bookie is unavailable, in milliseconds.
        Returns:
        log frequency when a bookie is unavailable, in milliseconds.
      • isBatchReadEnabled

        public boolean isBatchReadEnabled()