Class ServerConfiguration

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

    public class ServerConfiguration
    extends AbstractConfiguration<ServerConfiguration>
    Configuration manages server-side settings.
    • Field Detail

      • LEDGER_STORAGE_CLASS

        protected static final java.lang.String LEDGER_STORAGE_CLASS
        See Also:
        Constant Field Values
      • LEDGER_STORAGE_CLASS_KEY

        protected static final org.apache.bookkeeper.common.conf.ConfigKey LEDGER_STORAGE_CLASS_KEY
      • ENTRY_LOG_SIZE_LIMIT

        protected static final java.lang.String ENTRY_LOG_SIZE_LIMIT
        See Also:
        Constant Field Values
      • ENTRY_LOG_SIZE_LIMIT_KEY

        protected static final org.apache.bookkeeper.common.conf.ConfigKey ENTRY_LOG_SIZE_LIMIT_KEY
      • ENTRY_LOG_FILE_PREALLOCATION_ENABLED

        protected static final java.lang.String ENTRY_LOG_FILE_PREALLOCATION_ENABLED
        See Also:
        Constant Field Values
      • FORCE_ALLOW_COMPACTION

        protected static final java.lang.String FORCE_ALLOW_COMPACTION
        See Also:
        Constant Field Values
      • MINOR_COMPACTION_INTERVAL

        protected static final java.lang.String MINOR_COMPACTION_INTERVAL
        See Also:
        Constant Field Values
      • MINOR_COMPACTION_THRESHOLD

        protected static final java.lang.String MINOR_COMPACTION_THRESHOLD
        See Also:
        Constant Field Values
      • MINOR_COMPACTION_MAX_TIME_MILLIS

        protected static final java.lang.String MINOR_COMPACTION_MAX_TIME_MILLIS
        See Also:
        Constant Field Values
      • MAJOR_COMPACTION_INTERVAL

        protected static final java.lang.String MAJOR_COMPACTION_INTERVAL
        See Also:
        Constant Field Values
      • MAJOR_COMPACTION_THRESHOLD

        protected static final java.lang.String MAJOR_COMPACTION_THRESHOLD
        See Also:
        Constant Field Values
      • MAJOR_COMPACTION_MAX_TIME_MILLIS

        protected static final java.lang.String MAJOR_COMPACTION_MAX_TIME_MILLIS
        See Also:
        Constant Field Values
      • IS_THROTTLE_BY_BYTES

        protected static final java.lang.String IS_THROTTLE_BY_BYTES
        See Also:
        Constant Field Values
      • COMPACTION_MAX_OUTSTANDING_REQUESTS

        protected static final java.lang.String COMPACTION_MAX_OUTSTANDING_REQUESTS
        See Also:
        Constant Field Values
      • COMPACTION_RATE

        protected static final java.lang.String COMPACTION_RATE
        See Also:
        Constant Field Values
      • COMPACTION_RATE_BY_ENTRIES

        protected static final java.lang.String COMPACTION_RATE_BY_ENTRIES
        See Also:
        Constant Field Values
      • COMPACTION_RATE_BY_BYTES

        protected static final java.lang.String COMPACTION_RATE_BY_BYTES
        See Also:
        Constant Field Values
      • IS_FORCE_GC_ALLOW_WHEN_NO_SPACE

        protected static final java.lang.String IS_FORCE_GC_ALLOW_WHEN_NO_SPACE
        See Also:
        Constant Field Values
      • GC_OVERREPLICATED_LEDGER_WAIT_TIME

        protected static final java.lang.String GC_OVERREPLICATED_LEDGER_WAIT_TIME
        See Also:
        Constant Field Values
      • GC_OVERREPLICATED_LEDGER_MAX_CONCURRENT_REQUESTS

        protected static final java.lang.String GC_OVERREPLICATED_LEDGER_MAX_CONCURRENT_REQUESTS
        See Also:
        Constant Field Values
      • USE_TRANSACTIONAL_COMPACTION

        protected static final java.lang.String USE_TRANSACTIONAL_COMPACTION
        See Also:
        Constant Field Values
      • VERIFY_METADATA_ON_GC

        protected static final java.lang.String VERIFY_METADATA_ON_GC
        See Also:
        Constant Field Values
      • GC_ENTRYLOGMETADATA_CACHE_ENABLED

        protected static final java.lang.String GC_ENTRYLOGMETADATA_CACHE_ENABLED
        See Also:
        Constant Field Values
      • GC_ENTRYLOG_METADATA_CACHE_PATH

        protected static final java.lang.String GC_ENTRYLOG_METADATA_CACHE_PATH
        See Also:
        Constant Field Values
      • LOCAL_SCRUB_PERIOD

        protected static final java.lang.String LOCAL_SCRUB_PERIOD
        See Also:
        Constant Field Values
      • LOCAL_SCRUB_RATE_LIMIT

        protected static final java.lang.String LOCAL_SCRUB_RATE_LIMIT
        See Also:
        Constant Field Values
      • FLUSH_ENTRYLOG_INTERVAL_BYTES

        protected static final java.lang.String FLUSH_ENTRYLOG_INTERVAL_BYTES
        See Also:
        Constant Field Values
      • DEATH_WATCH_INTERVAL

        protected static final java.lang.String DEATH_WATCH_INTERVAL
        See Also:
        Constant Field Values
      • OPEN_FILE_LIMIT

        protected static final java.lang.String OPEN_FILE_LIMIT
        See Also:
        Constant Field Values
      • FILEINFO_CACHE_INITIAL_CAPACITY

        protected static final java.lang.String FILEINFO_CACHE_INITIAL_CAPACITY
        See Also:
        Constant Field Values
      • FILEINFO_MAX_IDLE_TIME

        protected static final java.lang.String FILEINFO_MAX_IDLE_TIME
        See Also:
        Constant Field Values
      • FILEINFO_FORMAT_VERSION_TO_WRITE

        protected static final java.lang.String FILEINFO_FORMAT_VERSION_TO_WRITE
        See Also:
        Constant Field Values
      • MAX_JOURNAL_SIZE

        protected static final java.lang.String MAX_JOURNAL_SIZE
        See Also:
        Constant Field Values
      • MAX_BACKUP_JOURNALS

        protected static final java.lang.String MAX_BACKUP_JOURNALS
        See Also:
        Constant Field Values
      • JOURNAL_SYNC_DATA

        protected static final java.lang.String JOURNAL_SYNC_DATA
        See Also:
        Constant Field Values
      • JOURNAL_WRITE_DATA

        protected static final java.lang.String JOURNAL_WRITE_DATA
        See Also:
        Constant Field Values
      • JOURNAL_ADAPTIVE_GROUP_WRITES

        protected static final java.lang.String JOURNAL_ADAPTIVE_GROUP_WRITES
        See Also:
        Constant Field Values
      • JOURNAL_MAX_GROUP_WAIT_MSEC

        protected static final java.lang.String JOURNAL_MAX_GROUP_WAIT_MSEC
        See Also:
        Constant Field Values
      • JOURNAL_BUFFERED_WRITES_THRESHOLD

        protected static final java.lang.String JOURNAL_BUFFERED_WRITES_THRESHOLD
        See Also:
        Constant Field Values
      • JOURNAL_BUFFERED_ENTRIES_THRESHOLD

        protected static final java.lang.String JOURNAL_BUFFERED_ENTRIES_THRESHOLD
        See Also:
        Constant Field Values
      • JOURNAL_FLUSH_WHEN_QUEUE_EMPTY

        protected static final java.lang.String JOURNAL_FLUSH_WHEN_QUEUE_EMPTY
        See Also:
        Constant Field Values
      • JOURNAL_REMOVE_FROM_PAGE_CACHE

        protected static final java.lang.String JOURNAL_REMOVE_FROM_PAGE_CACHE
        See Also:
        Constant Field Values
      • JOURNAL_PRE_ALLOC_SIZE

        protected static final java.lang.String JOURNAL_PRE_ALLOC_SIZE
        See Also:
        Constant Field Values
      • JOURNAL_WRITE_BUFFER_SIZE

        protected static final java.lang.String JOURNAL_WRITE_BUFFER_SIZE
        See Also:
        Constant Field Values
      • JOURNAL_ALIGNMENT_SIZE

        protected static final java.lang.String JOURNAL_ALIGNMENT_SIZE
        See Also:
        Constant Field Values
      • NUM_JOURNAL_CALLBACK_THREADS

        protected static final java.lang.String NUM_JOURNAL_CALLBACK_THREADS
        See Also:
        Constant Field Values
      • JOURNAL_FORMAT_VERSION_TO_WRITE

        protected static final java.lang.String JOURNAL_FORMAT_VERSION_TO_WRITE
        See Also:
        Constant Field Values
      • JOURNAL_QUEUE_SIZE

        protected static final java.lang.String JOURNAL_QUEUE_SIZE
        See Also:
        Constant Field Values
      • JOURNAL_MAX_MEMORY_SIZE_MB

        protected static final java.lang.String JOURNAL_MAX_MEMORY_SIZE_MB
        See Also:
        Constant Field Values
      • JOURNAL_PAGECACHE_FLUSH_INTERVAL_MSEC

        protected static final java.lang.String JOURNAL_PAGECACHE_FLUSH_INTERVAL_MSEC
        See Also:
        Constant Field Values
      • JOURNAL_CHANNEL_PROVIDER

        protected static final java.lang.String JOURNAL_CHANNEL_PROVIDER
        See Also:
        Constant Field Values
      • JOURNAL_REUSE_FILES

        protected static final java.lang.String JOURNAL_REUSE_FILES
        See Also:
        Constant Field Values
      • MAX_ADDS_IN_PROGRESS_LIMIT

        protected static final java.lang.String MAX_ADDS_IN_PROGRESS_LIMIT
        See Also:
        Constant Field Values
      • MAX_READS_IN_PROGRESS_LIMIT

        protected static final java.lang.String MAX_READS_IN_PROGRESS_LIMIT
        See Also:
        Constant Field Values
      • CLOSE_CHANNEL_ON_RESPONSE_TIMEOUT

        protected static final java.lang.String CLOSE_CHANNEL_ON_RESPONSE_TIMEOUT
        See Also:
        Constant Field Values
      • WAIT_TIMEOUT_ON_RESPONSE_BACKPRESSURE

        protected static final java.lang.String WAIT_TIMEOUT_ON_RESPONSE_BACKPRESSURE
        See Also:
        Constant Field Values
      • LISTENING_INTERFACE

        protected static final java.lang.String LISTENING_INTERFACE
        See Also:
        Constant Field Values
      • ADVERTISED_ADDRESS

        protected static final java.lang.String ADVERTISED_ADDRESS
        See Also:
        Constant Field Values
      • ALLOW_EPHEMERAL_PORTS

        protected static final java.lang.String ALLOW_EPHEMERAL_PORTS
        See Also:
        Constant Field Values
      • ALLOW_STORAGE_EXPANSION

        protected static final java.lang.String ALLOW_STORAGE_EXPANSION
        See Also:
        Constant Field Values
      • SERVER_TCP_NODELAY

        protected static final java.lang.String SERVER_TCP_NODELAY
        See Also:
        Constant Field Values
      • SERVER_SOCK_KEEPALIVE

        protected static final java.lang.String SERVER_SOCK_KEEPALIVE
        See Also:
        Constant Field Values
      • SERVER_SOCK_LINGER

        protected static final java.lang.String SERVER_SOCK_LINGER
        See Also:
        Constant Field Values
      • SERVER_WRITEBUFFER_LOW_WATER_MARK

        protected static final java.lang.String SERVER_WRITEBUFFER_LOW_WATER_MARK
        See Also:
        Constant Field Values
      • SERVER_WRITEBUFFER_HIGH_WATER_MARK

        protected static final java.lang.String SERVER_WRITEBUFFER_HIGH_WATER_MARK
        See Also:
        Constant Field Values
      • SERVER_NUM_ACCEPTOR_THREADS

        protected static final java.lang.String SERVER_NUM_ACCEPTOR_THREADS
        See Also:
        Constant Field Values
      • SERVER_NUM_IO_THREADS

        protected static final java.lang.String SERVER_NUM_IO_THREADS
        See Also:
        Constant Field Values
      • ZK_RETRY_BACKOFF_START_MS

        protected static final java.lang.String ZK_RETRY_BACKOFF_START_MS
        See Also:
        Constant Field Values
      • ZK_RETRY_BACKOFF_MAX_MS

        protected static final java.lang.String ZK_RETRY_BACKOFF_MAX_MS
        See Also:
        Constant Field Values
      • OPEN_LEDGER_REREPLICATION_GRACE_PERIOD

        protected static final java.lang.String OPEN_LEDGER_REREPLICATION_GRACE_PERIOD
        See Also:
        Constant Field Values
      • LOCK_RELEASE_OF_FAILED_LEDGER_GRACE_PERIOD

        protected static final java.lang.String LOCK_RELEASE_OF_FAILED_LEDGER_GRACE_PERIOD
        See Also:
        Constant Field Values
      • READ_ONLY_MODE_ENABLED

        protected static final java.lang.String READ_ONLY_MODE_ENABLED
        See Also:
        Constant Field Values
      • READ_ONLY_MODE_ON_ANY_DISK_FULL_ENABLED

        protected static final java.lang.String READ_ONLY_MODE_ON_ANY_DISK_FULL_ENABLED
        See Also:
        Constant Field Values
      • FORCE_READ_ONLY_BOOKIE

        protected static final java.lang.String FORCE_READ_ONLY_BOOKIE
        See Also:
        Constant Field Values
      • PERSIST_BOOKIE_STATUS_ENABLED

        protected static final java.lang.String PERSIST_BOOKIE_STATUS_ENABLED
        See Also:
        Constant Field Values
      • DISK_USAGE_THRESHOLD

        protected static final java.lang.String DISK_USAGE_THRESHOLD
        See Also:
        Constant Field Values
      • DISK_USAGE_WARN_THRESHOLD

        protected static final java.lang.String DISK_USAGE_WARN_THRESHOLD
        See Also:
        Constant Field Values
      • DISK_USAGE_LWM_THRESHOLD

        protected static final java.lang.String DISK_USAGE_LWM_THRESHOLD
        See Also:
        Constant Field Values
      • DISK_CHECK_INTERVAL

        protected static final java.lang.String DISK_CHECK_INTERVAL
        See Also:
        Constant Field Values
      • AUDITOR_PERIODIC_CHECK_INTERVAL

        protected static final java.lang.String AUDITOR_PERIODIC_CHECK_INTERVAL
        See Also:
        Constant Field Values
      • AUDITOR_PERIODIC_BOOKIE_CHECK_INTERVAL

        protected static final java.lang.String AUDITOR_PERIODIC_BOOKIE_CHECK_INTERVAL
        See Also:
        Constant Field Values
      • AUDITOR_PERIODIC_PLACEMENT_POLICY_CHECK_INTERVAL

        protected static final java.lang.String AUDITOR_PERIODIC_PLACEMENT_POLICY_CHECK_INTERVAL
        See Also:
        Constant Field Values
      • REPAIRED_PLACEMENT_POLICY_NOT_ADHERING_BOOKIE_ENABLED

        protected static final java.lang.String REPAIRED_PLACEMENT_POLICY_NOT_ADHERING_BOOKIE_ENABLED
        See Also:
        Constant Field Values
      • AUDITOR_LEDGER_VERIFICATION_PERCENTAGE

        protected static final java.lang.String AUDITOR_LEDGER_VERIFICATION_PERCENTAGE
        See Also:
        Constant Field Values
      • AUTO_RECOVERY_DAEMON_ENABLED

        protected static final java.lang.String AUTO_RECOVERY_DAEMON_ENABLED
        See Also:
        Constant Field Values
      • LOST_BOOKIE_RECOVERY_DELAY

        protected static final java.lang.String LOST_BOOKIE_RECOVERY_DELAY
        See Also:
        Constant Field Values
      • RW_REREPLICATE_BACKOFF_MS

        protected static final java.lang.String RW_REREPLICATE_BACKOFF_MS
        See Also:
        Constant Field Values
      • UNDERREPLICATED_LEDGER_RECOVERY_GRACE_PERIOD

        protected static final java.lang.String UNDERREPLICATED_LEDGER_RECOVERY_GRACE_PERIOD
        See Also:
        Constant Field Values
      • AUDITOR_REPLICAS_CHECK_INTERVAL

        protected static final java.lang.String AUDITOR_REPLICAS_CHECK_INTERVAL
        See Also:
        Constant Field Values
      • AUDITOR_MAX_NUMBER_OF_CONCURRENT_OPEN_LEDGER_OPERATIONS

        protected static final java.lang.String AUDITOR_MAX_NUMBER_OF_CONCURRENT_OPEN_LEDGER_OPERATIONS
        See Also:
        Constant Field Values
      • AUDITOR_ACQUIRE_CONCURRENT_OPEN_LEDGER_OPERATIONS_TIMEOUT_MSEC

        protected static final java.lang.String AUDITOR_ACQUIRE_CONCURRENT_OPEN_LEDGER_OPERATIONS_TIMEOUT_MSEC
        See Also:
        Constant Field Values
      • IN_FLIGHT_READ_ENTRY_NUM_IN_LEDGER_CHECKER

        protected static final java.lang.String IN_FLIGHT_READ_ENTRY_NUM_IN_LEDGER_CHECKER
        See Also:
        Constant Field Values
      • NUM_ADD_WORKER_THREADS

        protected static final java.lang.String NUM_ADD_WORKER_THREADS
        See Also:
        Constant Field Values
      • NUM_READ_WORKER_THREADS

        protected static final java.lang.String NUM_READ_WORKER_THREADS
        See Also:
        Constant Field Values
      • MAX_PENDING_READ_REQUESTS_PER_THREAD

        protected static final java.lang.String MAX_PENDING_READ_REQUESTS_PER_THREAD
        See Also:
        Constant Field Values
      • MAX_PENDING_ADD_REQUESTS_PER_THREAD

        protected static final java.lang.String MAX_PENDING_ADD_REQUESTS_PER_THREAD
        See Also:
        Constant Field Values
      • NUM_LONG_POLL_WORKER_THREADS

        protected static final java.lang.String NUM_LONG_POLL_WORKER_THREADS
        See Also:
        Constant Field Values
      • NUM_HIGH_PRIORITY_WORKER_THREADS

        protected static final java.lang.String NUM_HIGH_PRIORITY_WORKER_THREADS
        See Also:
        Constant Field Values
      • READ_WORKER_THREADS_THROTTLING_ENABLED

        protected static final java.lang.String READ_WORKER_THREADS_THROTTLING_ENABLED
        See Also:
        Constant Field Values
      • REQUEST_TIMER_TICK_DURATION_MILLISEC

        protected static final java.lang.String REQUEST_TIMER_TICK_DURATION_MILLISEC
        See Also:
        Constant Field Values
      • REQUEST_TIMER_NO_OF_TICKS

        protected static final java.lang.String REQUEST_TIMER_NO_OF_TICKS
        See Also:
        Constant Field Values
      • READ_BUFFER_SIZE

        protected static final java.lang.String READ_BUFFER_SIZE
        See Also:
        Constant Field Values
      • WRITE_BUFFER_SIZE

        protected static final java.lang.String WRITE_BUFFER_SIZE
        See Also:
        Constant Field Values
      • USE_HOST_NAME_AS_BOOKIE_ID

        protected static final java.lang.String USE_HOST_NAME_AS_BOOKIE_ID
        See Also:
        Constant Field Values
      • USE_SHORT_HOST_NAME

        protected static final java.lang.String USE_SHORT_HOST_NAME
        See Also:
        Constant Field Values
      • ENABLE_LOCAL_TRANSPORT

        protected static final java.lang.String ENABLE_LOCAL_TRANSPORT
        See Also:
        Constant Field Values
      • DISABLE_SERVER_SOCKET_BIND

        protected static final java.lang.String DISABLE_SERVER_SOCKET_BIND
        See Also:
        Constant Field Values
      • SORTED_LEDGER_STORAGE_ENABLED

        protected static final java.lang.String SORTED_LEDGER_STORAGE_ENABLED
        See Also:
        Constant Field Values
      • SKIP_LIST_SIZE_LIMIT

        protected static final java.lang.String SKIP_LIST_SIZE_LIMIT
        See Also:
        Constant Field Values
      • SKIP_LIST_CHUNK_SIZE_ENTRY

        protected static final java.lang.String SKIP_LIST_CHUNK_SIZE_ENTRY
        See Also:
        Constant Field Values
      • SKIP_LIST_MAX_ALLOC_ENTRY

        protected static final java.lang.String SKIP_LIST_MAX_ALLOC_ENTRY
        See Also:
        Constant Field Values
      • ENABLE_STATISTICS

        protected static final java.lang.String ENABLE_STATISTICS
        See Also:
        Constant Field Values
      • STATS_PROVIDER_CLASS

        protected static final java.lang.String STATS_PROVIDER_CLASS
        See Also:
        Constant Field Values
      • BYTEBUF_ALLOCATOR_SIZE_INITIAL

        protected static final java.lang.String BYTEBUF_ALLOCATOR_SIZE_INITIAL
        See Also:
        Constant Field Values
      • BYTEBUF_ALLOCATOR_SIZE_MIN

        protected static final java.lang.String BYTEBUF_ALLOCATOR_SIZE_MIN
        See Also:
        Constant Field Values
      • BYTEBUF_ALLOCATOR_SIZE_MAX

        protected static final java.lang.String BYTEBUF_ALLOCATOR_SIZE_MAX
        See Also:
        Constant Field Values
      • BOOKIE_AUTH_PROVIDER_FACTORY_CLASS

        protected static final java.lang.String BOOKIE_AUTH_PROVIDER_FACTORY_CLASS
        See Also:
        Constant Field Values
      • MIN_USABLESIZE_FOR_INDEXFILE_CREATION

        protected static final java.lang.String MIN_USABLESIZE_FOR_INDEXFILE_CREATION
        See Also:
        Constant Field Values
      • MIN_USABLESIZE_FOR_ENTRYLOG_CREATION

        protected static final java.lang.String MIN_USABLESIZE_FOR_ENTRYLOG_CREATION
        See Also:
        Constant Field Values
      • MIN_USABLESIZE_FOR_HIGH_PRIORITY_WRITES

        protected static final java.lang.String MIN_USABLESIZE_FOR_HIGH_PRIORITY_WRITES
        See Also:
        Constant Field Values
      • ALLOW_MULTIPLEDIRS_UNDER_SAME_DISKPARTITION

        protected static final java.lang.String ALLOW_MULTIPLEDIRS_UNDER_SAME_DISKPARTITION
        See Also:
        Constant Field Values
      • HTTP_SERVER_ENABLED

        protected static final java.lang.String HTTP_SERVER_ENABLED
        See Also:
        Constant Field Values
      • HTTP_SERVER_PORT

        protected static final java.lang.String HTTP_SERVER_PORT
        See Also:
        Constant Field Values
      • HTTP_SERVER_HOST

        protected static final java.lang.String HTTP_SERVER_HOST
        See Also:
        Constant Field Values
      • HTTP_SERVER_TLS_ENABLE

        protected static final java.lang.String HTTP_SERVER_TLS_ENABLE
        See Also:
        Constant Field Values
      • HTTP_SERVER_KEY_STORE_PATH

        protected static final java.lang.String HTTP_SERVER_KEY_STORE_PATH
        See Also:
        Constant Field Values
      • HTTP_SERVER_KEY_STORE_PASSWORD

        protected static final java.lang.String HTTP_SERVER_KEY_STORE_PASSWORD
        See Also:
        Constant Field Values
      • HTTP_SERVER_TRUST_STORE_PATH

        protected static final java.lang.String HTTP_SERVER_TRUST_STORE_PATH
        See Also:
        Constant Field Values
      • HTTP_SERVER_TRUST_STORE_PASSWORD

        protected static final java.lang.String HTTP_SERVER_TRUST_STORE_PASSWORD
        See Also:
        Constant Field Values
      • EXTRA_SERVER_COMPONENTS

        protected static final java.lang.String EXTRA_SERVER_COMPONENTS
        See Also:
        Constant Field Values
      • IGNORE_EXTRA_SERVER_COMPONENTS_STARTUP_FAILURES

        protected static final java.lang.String IGNORE_EXTRA_SERVER_COMPONENTS_STARTUP_FAILURES
        See Also:
        Constant Field Values
      • REGISTRATION_MANAGER_CLASS

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

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

        protected static final java.lang.String ENTRY_LOG_PER_LEDGER_ENABLED
        See Also:
        Constant Field Values
      • NUMBER_OF_MEMTABLE_FLUSH_THREADS

        protected static final java.lang.String NUMBER_OF_MEMTABLE_FLUSH_THREADS
        See Also:
        Constant Field Values
      • ENTRYLOGMAP_ACCESS_EXPIRYTIME_INSECONDS

        protected static final java.lang.String ENTRYLOGMAP_ACCESS_EXPIRYTIME_INSECONDS
        See Also:
        Constant Field Values
      • MAXIMUM_NUMBER_OF_ACTIVE_ENTRYLOGS

        protected static final java.lang.String MAXIMUM_NUMBER_OF_ACTIVE_ENTRYLOGS
        See Also:
        Constant Field Values
      • ENTRY_LOG_PER_LEDGER_COUNTER_LIMITS_MULT_FACTOR

        protected static final java.lang.String ENTRY_LOG_PER_LEDGER_COUNTER_LIMITS_MULT_FACTOR
        See Also:
        Constant Field Values
      • LOCAL_CONSISTENCY_CHECK_ON_STARTUP

        protected static final java.lang.String LOCAL_CONSISTENCY_CHECK_ON_STARTUP
        See Also:
        Constant Field Values
      • AUTHORIZED_ROLES

        protected static final java.lang.String AUTHORIZED_ROLES
        See Also:
        Constant Field Values
      • DATA_INTEGRITY_CHECKING_ENABLED

        protected static final java.lang.String DATA_INTEGRITY_CHECKING_ENABLED
        See Also:
        Constant Field Values
      • DATA_INTEGRITY_COOKIE_STAMPING_ENABLED

        protected static final java.lang.String DATA_INTEGRITY_COOKIE_STAMPING_ENABLED
        See Also:
        Constant Field Values
      • DEFAULT_ROCKSDB_CONF

        protected static final java.lang.String DEFAULT_ROCKSDB_CONF
        See Also:
        Constant Field Values
      • ENTRY_LOCATION_ROCKSDB_CONF

        protected static final java.lang.String ENTRY_LOCATION_ROCKSDB_CONF
        See Also:
        Constant Field Values
      • LEDGER_METADATA_ROCKSDB_CONF

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

      • ServerConfiguration

        public ServerConfiguration()
        Construct a default configuration object.
      • ServerConfiguration

        public ServerConfiguration​(AbstractConfiguration conf)
        Construct a configuration based on other configuration.
        Parameters:
        conf - Other configuration
    • Method Detail

      • getEntryLogSizeLimit

        public long getEntryLogSizeLimit()
        Get entry logger size limitation.
        Returns:
        entry logger size limitation
      • setEntryLogSizeLimit

        public ServerConfiguration setEntryLogSizeLimit​(long logSizeLimit)
        Set entry logger size limitation.
        Parameters:
        logSizeLimit - new log size limitation
      • isEntryLogFilePreAllocationEnabled

        public boolean isEntryLogFilePreAllocationEnabled()
        Is entry log file preallocation enabled.
        Returns:
        whether entry log file preallocation is enabled or not.
      • setEntryLogFilePreAllocationEnabled

        public ServerConfiguration setEntryLogFilePreAllocationEnabled​(boolean enabled)
        Enable/disable entry log file preallocation.
        Parameters:
        enabled - enable/disable entry log file preallocation.
        Returns:
        server configuration object.
      • getGcWaitTime

        public long getGcWaitTime()
        Get Garbage collection wait time. Default value is 10 minutes. The guideline is not to set a too low value for this, if using zookeeper based ledger manager. And it would be nice to align with the average lifecyle time of ledgers in the system.
        Returns:
        gc wait time
      • setGcWaitTime

        public ServerConfiguration setGcWaitTime​(long gcWaitTime)
        Set garbage collection wait time.
        Parameters:
        gcWaitTime - gc wait time
        Returns:
        server configuration
      • getGcOverreplicatedLedgerWaitTimeMillis

        public long getGcOverreplicatedLedgerWaitTimeMillis()
        Get wait time in millis for garbage collection of overreplicated ledgers.
        Returns:
        gc wait time
      • setGcOverreplicatedLedgerWaitTime

        public ServerConfiguration setGcOverreplicatedLedgerWaitTime​(long gcWaitTime,
                                                                     java.util.concurrent.TimeUnit unit)
        Set wait time for garbage collection of overreplicated ledgers. Default: 1 day

        A ledger can be overreplicated under the following circumstances: 1. The ledger with few entries has bk1 and bk2 as its ensemble. 2. bk1 crashes. 3. bk3 replicates the ledger from bk2 and updates the ensemble to bk2 and bk3. 4. bk1 comes back up. 5. Now there are 3 copies of the ledger.

        Parameters:
        gcWaitTime -
        Returns:
        server configuration
      • getGcOverreplicatedLedgerMaxConcurrentRequests

        public int getGcOverreplicatedLedgerMaxConcurrentRequests()
        Max number of concurrent requests in garbage collection of overreplicated ledgers.
        Returns:
        max number of concurrent requests
      • setGcOverreplicatedLedgerMaxConcurrentRequests

        public ServerConfiguration setGcOverreplicatedLedgerMaxConcurrentRequests​(int gcOverreplicatedLedgerMaxConcurrentRequests)
        Max number of concurrent requests in garbage collection of overreplicated ledgers. Default: 1000
        Parameters:
        gcOverreplicatedLedgerMaxConcurrentRequests -
        Returns:
        server configuration
      • getUseTransactionalCompaction

        public boolean getUseTransactionalCompaction()
        Get whether to use transactional compaction and using a separate log for compaction or not.
        Returns:
        use transactional compaction
      • setUseTransactionalCompaction

        public ServerConfiguration setUseTransactionalCompaction​(boolean useTransactionalCompaction)
        Set whether to use transactional compaction and using a separate log for compaction or not.
        Parameters:
        useTransactionalCompaction -
        Returns:
        server configuration
      • getVerifyMetadataOnGC

        public boolean getVerifyMetadataOnGC()
        Get whether the bookie is configured to double check prior to gc.
        Returns:
        use transactional compaction
      • setVerifyMetadataOnGc

        public ServerConfiguration setVerifyMetadataOnGc​(boolean verifyMetadataOnGC)
        Set whether the bookie is configured to double check prior to gc.
        Parameters:
        verifyMetadataOnGC -
        Returns:
        server configuration
      • isGcEntryLogMetadataCacheEnabled

        public boolean isGcEntryLogMetadataCacheEnabled()
        Get whether the bookie is configured to use persistent entrylogMetadataMap.
        Returns:
        use persistent entry-log metadata map
      • setGcEntryLogMetadataCacheEnabled

        public ServerConfiguration setGcEntryLogMetadataCacheEnabled​(boolean gcEntryLogMetadataCacheEnabled)
        Set whether the bookie is configured to use persistent entrylogMetadataMap.
        Parameters:
        gcEntryLogMetadataCacheEnabled -
        Returns:
        server configuration
      • getGcEntryLogMetadataCachePath

        public java.lang.String getGcEntryLogMetadataCachePath()
        Get directory to persist Entrylog metadata if gcPersistentEntrylogMetadataMapEnabled is true.
        Returns:
        entrylog metadata-map persistent store dir path.(default: it creates a sub-directory under each ledger directory with name "metadata-cache". If it set, it only works for one ledger directory configured for ledgerDirectories).
      • setGcEntryLogMetadataCachePath

        public ServerConfiguration setGcEntryLogMetadataCachePath​(java.lang.String gcEntrylogMetadataCachePath)
        Set directory to persist Entrylog metadata if gcPersistentEntrylogMetadataMapEnabled is true. If it set, it only works for one ledger directory configured for ledgerDirectories. For multi ledgerDirectory configured, keep the default value is the best practice.
        Parameters:
        gcEntrylogMetadataCachePath -
        Returns:
        server configuration.
      • isLocalScrubEnabled

        public boolean isLocalScrubEnabled()
        Get whether local scrub is enabled.
        Returns:
        Whether local scrub is enabled.
      • getLocalScrubPeriod

        public long getLocalScrubPeriod()
        Get local scrub interval.
        Returns:
        Number of seconds between scrubs, <=0 for disabled.
      • setLocalScrubPeriod

        public void setLocalScrubPeriod​(long period)
        Set local scrub period in seconds (<=0 for disabled). Scrub will be scheduled at delays chosen from the interval (.5 * interval, 1.5 * interval)
      • getLocalScrubRateLimit

        public double getLocalScrubRateLimit()
        Get local scrub rate limit (entries/second).
        Returns:
        Max number of entries to scrub per second, 0 for disabled.
      • setLocalScrubRateLimit

        public void setLocalScrubRateLimit​(double scrubRateLimit)
        Get local scrub rate limit (entries/second).
        Parameters:
        scrubRateLimit - Max number of entries per second to scan.
      • getFlushInterval

        public int getFlushInterval()
        Get flush interval. Default value is 10 second. It isn't useful to decrease this value, since ledger storage only checkpoints when an entry logger file is rolled.
        Returns:
        flush interval
      • setFlushInterval

        public ServerConfiguration setFlushInterval​(int flushInterval)
        Set flush interval.
        Parameters:
        flushInterval - Flush Interval
        Returns:
        server configuration
      • getFlushIntervalInBytes

        public long getFlushIntervalInBytes()
        Set entry log flush interval in bytes.

        Default is 0. 0 or less disables this feature and effectively flush happens on log rotation.

        Flushing in smaller chunks but more frequently reduces spikes in disk I/O. Flushing too frequently may also affect performance negatively.

        Returns:
        Entry log flush interval in bytes
      • setFlushIntervalInBytes

        public ServerConfiguration setFlushIntervalInBytes​(long flushInterval)
        Set entry log flush interval in bytes.
        Parameters:
        flushInterval - in bytes
        Returns:
        server configuration
      • getDeathWatchInterval

        public int getDeathWatchInterval()
        Get bookie death watch interval.
        Returns:
        watch interval
      • getOpenFileLimit

        public int getOpenFileLimit()
        Get open file limit. Default value is 20000.
        Returns:
        max number of files to open
      • setOpenFileLimit

        public ServerConfiguration setOpenFileLimit​(int fileLimit)
        Set limitation of number of open files.
        Parameters:
        fileLimit - Limitation of number of open files.
        Returns:
        server configuration
      • getPageLimit

        public int getPageLimit()
        Get limitation number of index pages in ledger cache.
        Returns:
        max number of index pages in ledger cache
      • setPageLimit

        public ServerConfiguration setPageLimit​(int pageLimit)
        Set limitation number of index pages in ledger cache.
        Parameters:
        pageLimit - Limitation of number of index pages in ledger cache.
        Returns:
        server configuration
      • getPageSize

        public int getPageSize()
        Get page size.
        Returns:
        page size in ledger cache
      • setPageSize

        public ServerConfiguration setPageSize​(int pageSize)
        Set page size.
        Parameters:
        pageSize - Page Size
        Returns:
        Server Configuration
        See Also:
        getPageSize()
      • getFileInfoCacheInitialCapacity

        public int getFileInfoCacheInitialCapacity()
        Get the minimum total size for the internal file info cache tables. Providing a large enough estimate at construction time avoids the need for expensive resizing operations later, but setting this value unnecessarily high wastes memory.
        Returns:
        minimum size of initial file info cache.
      • setFileInfoCacheInitialCapacity

        public ServerConfiguration setFileInfoCacheInitialCapacity​(int initialCapacity)
        Set the minimum total size for the internal file info cache tables for initialization.
        Parameters:
        initialCapacity - Initial capacity of file info cache table.
        Returns:
        server configuration instance.
      • getFileInfoMaxIdleTime

        public long getFileInfoMaxIdleTime()
        Get the max idle time allowed for a open file info existed in file info cache. If the file info is idle for a long time, exceed the given time period. The file info will be evicted and closed. If the value is zero, the file info is evicted only when opened files reached openFileLimit.
        Returns:
        max idle time of a file info in the file info cache.
        See Also:
        getOpenFileLimit()
      • setFileInfoMaxIdleTime

        public ServerConfiguration setFileInfoMaxIdleTime​(long idleTime)
        Set the max idle time allowed for a open file info existed in file info cache.
        Parameters:
        idleTime - Idle time, in seconds.
        Returns:
        server configuration object.
        See Also:
        getFileInfoMaxIdleTime()
      • getFileInfoFormatVersionToWrite

        public int getFileInfoFormatVersionToWrite()
        Get fileinfo format version to write.
        Returns:
        fileinfo format version to write.
      • setFileInfoFormatVersionToWrite

        public ServerConfiguration setFileInfoFormatVersionToWrite​(int version)
        Set fileinfo format version to write.
        Parameters:
        version - fileinfo format version to write.
        Returns:
        server configuration.
      • getMaxJournalSizeMB

        public long getMaxJournalSizeMB()
        Max journal file size.
        Returns:
        max journal file size
      • setMaxJournalSizeMB

        public ServerConfiguration setMaxJournalSizeMB​(long maxJournalSize)
        Set new max journal file size.
        Parameters:
        maxJournalSize - new max journal file size
        Returns:
        server configuration
      • getJournalPreAllocSizeMB

        public int getJournalPreAllocSizeMB()
        How much space should we pre-allocate at a time in the journal.
        Returns:
        journal pre-allocation size in MB
      • getJournalWriteBufferSizeKB

        public int getJournalWriteBufferSizeKB()
        Size of the write buffers used for the journal.
        Returns:
        journal write buffer size in KB
      • setJournalWriteBufferSizeKB

        public ServerConfiguration setJournalWriteBufferSizeKB​(int bufferSizeKB)
        Set the size of the write buffers used for the journal.
        Parameters:
        bufferSizeKB - the size of the write buffer used for the journal, in KB.
        Returns:
        server configuration
      • getMaxBackupJournals

        public int getMaxBackupJournals()
        Max number of older journal files kept.
        Returns:
        max number of older journal files to kept
      • setMaxBackupJournals

        public ServerConfiguration setMaxBackupJournals​(int maxBackupJournals)
        Set max number of older journal files to kept.
        Parameters:
        maxBackupJournals - Max number of older journal files
        Returns:
        server configuration
      • getJournalAlignmentSize

        public int getJournalAlignmentSize()
        All the journal writes and commits should be aligned to given size. If not, zeros will be padded to align to given size.
        Returns:
        journal alignment size
      • setJournalAlignmentSize

        public ServerConfiguration setJournalAlignmentSize​(int size)
        Set journal alignment size.
        Parameters:
        size - journal alignment size.
        Returns:
        server configuration.
      • getJournalFormatVersionToWrite

        public int getJournalFormatVersionToWrite()
        Get journal format version to write.
        Returns:
        journal format version to write.
      • setJournalFormatVersionToWrite

        public ServerConfiguration setJournalFormatVersionToWrite​(int version)
        Set journal format version to write.
        Parameters:
        version - journal format version to write.
        Returns:
        server configuration.
      • setJournalQueueSize

        public ServerConfiguration setJournalQueueSize​(int journalQueueSize)
        Set the size of the journal queue.
        Parameters:
        journalQueueSize - the max size of journal queue
        Returns:
        server configuration.
      • getJournalQueueSize

        public int getJournalQueueSize()
        Get size of journal queue.
        Returns:
        the max size of journal queue.
      • setJournalMaxMemorySizeMb

        public ServerConfiguration setJournalMaxMemorySizeMb​(long journalMaxMemorySizeMb)
        Set the max amount of memory that can be used by the journal.
        Parameters:
        journalMaxMemorySizeMb - the max amount of memory for the journal
        Returns:
        server configuration.
      • getJournalMaxMemorySizeMb

        public long getJournalMaxMemorySizeMb()
        Get the max amount of memory that can be used by the journal.
        Returns:
        the max amount of memory for the journal
      • setJournalPageCacheFlushIntervalMSec

        public ServerConfiguration setJournalPageCacheFlushIntervalMSec​(long journalPageCacheFlushIntervalMSec)
        Set PageCache flush interval in second.
        Returns:
        server configuration.
      • getJournalPageCacheFlushIntervalMSec

        public long getJournalPageCacheFlushIntervalMSec()
        Get journal pageCache flush interval.
        Returns:
        journal pageCache flush interval.
      • setJournalChannelProvider

        public ServerConfiguration setJournalChannelProvider​(java.lang.String journalChannelProvider)
        Set JournalChannelProvider classname.
        Parameters:
        journalChannelProvider - The JournalChannelProvider classname. The class must implements FileChannelProvider and no args constructor is needed.
        Returns:
      • getJournalChannelProvider

        public java.lang.String getJournalChannelProvider()
        Returns:
      • getJournalReuseFiles

        public boolean getJournalReuseFiles()
        Get reuse journal files.
        Returns:
      • setJournalReuseFiles

        public ServerConfiguration setJournalReuseFiles​(boolean journalReuseFiles)
        Set reuse journal files.
        Parameters:
        journalReuseFiles -
        Returns:
      • getMaxAddsInProgressLimit

        public int getMaxAddsInProgressLimit()
        Get max number of adds in progress. 0 == unlimited.
        Returns:
        Max number of adds in progress.
      • setMaxAddsInProgressLimit

        public ServerConfiguration setMaxAddsInProgressLimit​(int value)
        Set max number of adds in progress. 0 == unlimited.
        Parameters:
        value - max number of adds in progress.
        Returns:
        server configuration.
      • getMaxReadsInProgressLimit

        public int getMaxReadsInProgressLimit()
        Get max number of reads in progress. 0 == unlimited.
        Returns:
        Max number of reads in progress.
      • setMaxReadsInProgressLimit

        public ServerConfiguration setMaxReadsInProgressLimit​(int value)
        Set max number of reads in progress. 0 == unlimited.
        Parameters:
        value - max number of reads in progress.
        Returns:
        server configuration.
      • getCloseChannelOnResponseTimeout

        public boolean getCloseChannelOnResponseTimeout()
        Configures action in case if server timed out sending response to the client. true == close the channel and drop response false == drop response Requires waitTimeoutOnBackpressureMs >= 0 otherwise ignored.
        Returns:
        value indicating if channel should be closed.
      • setCloseChannelOnResponseTimeout

        public ServerConfiguration setCloseChannelOnResponseTimeout​(boolean value)
        Configures action in case if server timed out sending response to the client. true == close the channel and drop response false == drop response Requires waitTimeoutOnBackpressureMs >= 0 otherwise ignored.
        Parameters:
        value -
        Returns:
        server configuration.
      • getWaitTimeoutOnResponseBackpressureMillis

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

        public ServerConfiguration setWaitTimeoutOnResponseBackpressureMillis​(long value)
        Timeout controlling wait on response send in case of unresponsive client (i.e. client 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.
      • getBookiePort

        public int getBookiePort()
        Get bookie port that bookie server listen on.
        Returns:
        bookie port
      • setBookiePort

        public ServerConfiguration setBookiePort​(int port)
        Set new bookie port that bookie server listen on.
        Parameters:
        port - Port to listen on
        Returns:
        server configuration
      • getListeningInterface

        public java.lang.String getListeningInterface()
        Get the network interface that the bookie should listen for connections on. If this is null, then the bookie will listen for connections on all interfaces.
        Returns:
        the network interface to listen on, e.g. eth0, or null if none is specified
      • setListeningInterface

        public ServerConfiguration setListeningInterface​(java.lang.String iface)
        Set the network interface that the bookie should listen on. If not set, the bookie will listen on all interfaces.
        Parameters:
        iface - the interface to listen on
      • getAllowLoopback

        public boolean getAllowLoopback()
        Is the bookie allowed to use a loopback interface as its primary interface(i.e. the interface it uses to establish its identity)?

        By default, loopback interfaces are not allowed as the primary interface.

        Using a loopback interface as the primary interface usually indicates a configuration error. For example, its fairly common in some VPS setups to not configure a hostname, or to have the hostname resolve to 127.0.0.1. If this is the case, then all bookies in the cluster will establish their identities as 127.0.0.1:3181, and only one will be able to join the cluster. For VPSs configured like this, you should explicitly set the listening interface.

        Returns:
        whether a loopback interface can be used as the primary interface
        See Also:
        setListeningInterface(String)
      • setAllowLoopback

        public ServerConfiguration setAllowLoopback​(boolean allow)
        Configure the bookie to allow loopback interfaces to be used as the primary bookie interface.
        Parameters:
        allow - whether to allow loopback interfaces
        Returns:
        server configuration
        See Also:
        getAllowLoopback()
      • getBookieId

        public java.lang.String getBookieId()
        Get the configured BookieId for the bookie.

        If present, this setting will take precedence over the automatic BookieId generation, based on Network Addresses.

        Returns:
        the configure address to be advertised
        See Also:
        setBookieId(java.lang.String), getAdvertisedAddress()
      • setBookieId

        public ServerConfiguration setBookieId​(java.lang.String bookieId)
        Configure the bookie to advertise a specific BookieId.

        By default, a bookie will advertise a BookieId computed from the primary network endpoint addresss.

        Parameters:
        bookieId - the bookie id
        Returns:
        server configuration
        See Also:
        getBookieId(), setAdvertisedAddress(java.lang.String)
      • setAdvertisedAddress

        public ServerConfiguration setAdvertisedAddress​(java.lang.String advertisedAddress)
        Configure the bookie to advertise a specific address.

        By default, a bookie will advertise either its own IP or hostname, depending on the getUseHostNameAsBookieID() setting.

        When the advertised is set to a non-empty string, the bookie will register and advertise using this address.

        If present, this setting will take precedence over the setListeningInterface(String) and setUseHostNameAsBookieID(boolean).

        Parameters:
        advertisedAddress - whether to allow loopback interfaces
        Returns:
        server configuration
        See Also:
        getAdvertisedAddress()
      • getAllowEphemeralPorts

        public boolean getAllowEphemeralPorts()
        Is the bookie allowed to use an ephemeral port (port 0) as its server port.

        By default, an ephemeral port is not allowed. Using an ephemeral port as the service port usually indicates a configuration error. However, in unit tests, using ephemeral port will address port conflicts problem and allow running tests in parallel.

        Returns:
        whether is allowed to use an ephemeral port.
      • setAllowEphemeralPorts

        public ServerConfiguration setAllowEphemeralPorts​(boolean allow)
        Configure the bookie to allow using an ephemeral port.
        Parameters:
        allow - whether to allow using an ephemeral port.
        Returns:
        server configuration
      • getAllowStorageExpansion

        public boolean getAllowStorageExpansion()
        Return whether we should allow addition of ledger/index dirs to an existing bookie.
        Returns:
        true if the addition is allowed; false otherwise
      • setAllowStorageExpansion

        public ServerConfiguration setAllowStorageExpansion​(boolean val)
        Change the setting of whether or not we should allow ledger/index dirs to be added to the current set of dirs.
        Parameters:
        val - - true if new ledger/index dirs can be added; false otherwise.
        Returns:
        server configuration
      • getJournalDirNames

        public java.lang.String[] getJournalDirNames()
        Get dir names to store journal files.
        Returns:
        journal dir name
      • getJournalDirName

        @Deprecated
        public java.lang.String getJournalDirName()
        Deprecated.
        Get dir name to store journal files.
        Returns:
        journal dir name
      • getJournalDirNameWithoutDefault

        public java.lang.String getJournalDirNameWithoutDefault()
        Get dir name to store journal files.
        Returns:
        journal dir name
      • setJournalDirName

        public ServerConfiguration setJournalDirName​(java.lang.String journalDir)
        Set dir name to store journal files.
        Parameters:
        journalDir - Dir to store journal files
        Returns:
        server configuration
      • setJournalDirsName

        public ServerConfiguration setJournalDirsName​(java.lang.String[] journalDirs)
        Set dir names to store journal files.
        Parameters:
        journalDirs - Dir to store journal files
        Returns:
        server configuration
      • getJournalDirs

        public java.io.File[] getJournalDirs()
        Get dirs to store journal files.
        Returns:
        journal dirs, if no journal dir provided return null
      • getLedgerDirWithoutDefault

        public java.lang.String[] getLedgerDirWithoutDefault()
        Get dir names to store ledger data.
        Returns:
        ledger dir names, if not provided return null
      • getLedgerDirNames

        public java.lang.String[] getLedgerDirNames()
        Get dir names to store ledger data.
        Returns:
        ledger dir names, if not provided return null
      • setLedgerDirNames

        public ServerConfiguration setLedgerDirNames​(java.lang.String[] ledgerDirs)
        Set dir names to store ledger data.
        Parameters:
        ledgerDirs - Dir names to store ledger data
        Returns:
        server configuration
      • getLedgerDirs

        public java.io.File[] getLedgerDirs()
        Get dirs that stores ledger data.
        Returns:
        ledger dirs
      • getIndexDirNames

        public java.lang.String[] getIndexDirNames()
        Get dir name to store index files.
        Returns:
        ledger index dir name, if no index dirs provided return null
      • setIndexDirName

        public ServerConfiguration setIndexDirName​(java.lang.String[] indexDirs)
        Set dir name to store index files.
        Parameters:
        indexDirs - Index dir names
        Returns:
        server configuration.
      • getIndexDirs

        public java.io.File[] getIndexDirs()
        Get index dir to store ledger index files.
        Returns:
        index dirs, if no index dirs provided return null
      • getServerTcpNoDelay

        public boolean getServerTcpNoDelay()
        Is tcp connection no delay.
        Returns:
        tcp socket nodelay setting
      • setServerTcpNoDelay

        public ServerConfiguration setServerTcpNoDelay​(boolean noDelay)
        Set socket nodelay setting.
        Parameters:
        noDelay - NoDelay setting
        Returns:
        server configuration
      • getServerNumIOThreads

        public int getServerNumIOThreads()
        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
      • getServerNumAcceptorThreads

        public int getServerNumAcceptorThreads()
        Get the number of Acceptor threads.
        Returns:
        the number of Acceptor threads
      • setServerNumIOThreads

        public ServerConfiguration setServerNumIOThreads​(int numThreads)
        Set the number of IO threads.

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

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

        public int getServerSockLinger()
        Timeout to drain the socket on close.
        Returns:
        socket linger setting
      • setServerSockLinger

        public ServerConfiguration setServerSockLinger​(int linger)
        Set socket linger timeout on close.

        When enabled, a close or shutdown will not return until all queued messages for the socket have been successfully sent or the linger timeout has been reached. Otherwise, the call returns immediately and the closing is done in the background.

        Parameters:
        linger - NoDelay setting
        Returns:
        server configuration
      • getServerSockKeepalive

        public boolean getServerSockKeepalive()
        Get socket keepalive.
        Returns:
        socket keepalive setting
      • setServerSockKeepalive

        public ServerConfiguration setServerSockKeepalive​(boolean keepalive)
        Set socket keepalive setting.

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

        Parameters:
        keepalive - KeepAlive setting
        Returns:
        server configuration
      • getZkRetryBackoffStartMs

        public int getZkRetryBackoffStartMs()
        Get zookeeper client backoff retry start time in millis.
        Returns:
        zk backoff retry start time in millis.
      • setZkRetryBackoffStartMs

        public ServerConfiguration setZkRetryBackoffStartMs​(int retryMs)
        Set zookeeper client backoff retry start time in millis.
        Parameters:
        retryMs - backoff retry start time in millis.
        Returns:
        server configuration.
      • getZkRetryBackoffMaxMs

        public int getZkRetryBackoffMaxMs()
        Get zookeeper client backoff retry max time in millis.
        Returns:
        zk backoff retry max time in millis.
      • setZkRetryBackoffMaxMs

        public ServerConfiguration setZkRetryBackoffMaxMs​(int retryMs)
        Set zookeeper client backoff retry max time in millis.
        Parameters:
        retryMs - backoff retry max time in millis.
        Returns:
        server configuration.
      • isStatisticsEnabled

        public boolean isStatisticsEnabled()
        Is statistics enabled.
        Returns:
        is statistics enabled
      • setStatisticsEnabled

        public ServerConfiguration setStatisticsEnabled​(boolean enabled)
        Turn on/off statistics.
        Parameters:
        enabled - Whether statistics enabled or not.
        Returns:
        server configuration
      • setForceAllowCompaction

        public ServerConfiguration setForceAllowCompaction​(boolean enable)
        Allow manually force compact the entry log or not.
        Parameters:
        enable - whether allow manually force compact the entry log or not.
        Returns:
        service configuration.
      • isForceAllowCompaction

        public boolean isForceAllowCompaction()
        The force compaction is allowed or not when disabling the entry log compaction.
        Returns:
        the force compaction is allowed or not when disabling the entry log compaction.
      • getMinorCompactionThreshold

        public double getMinorCompactionThreshold()
        Get threshold of minor compaction.

        For those entry log files whose remaining size percentage reaches below this threshold will be compacted in a minor compaction.

        If it is set to less than zero, the minor compaction is disabled.

        Returns:
        threshold of minor compaction
      • setMinorCompactionThreshold

        public ServerConfiguration setMinorCompactionThreshold​(double threshold)
        Set threshold of minor compaction.
        Parameters:
        threshold - Threshold for minor compaction
        Returns:
        server configuration
        See Also:
        getMinorCompactionThreshold()
      • getMajorCompactionThreshold

        public double getMajorCompactionThreshold()
        Get threshold of major compaction.

        For those entry log files whose remaining size percentage reaches below this threshold will be compacted in a major compaction.

        If it is set to less than zero, the major compaction is disabled.

        Returns:
        threshold of major compaction
      • setMajorCompactionThreshold

        public ServerConfiguration setMajorCompactionThreshold​(double threshold)
        Set threshold of major compaction.
        Parameters:
        threshold - Threshold of major compaction
        Returns:
        server configuration
        See Also:
        getMajorCompactionThreshold()
      • getMajorCompactionMaxTimeMillis

        public long getMajorCompactionMaxTimeMillis()
        Get the maximum milliseconds to run major compaction. If <=0 the thread will run until all compaction is completed.
        Returns:
        limit The number of milliseconds to run compaction.
      • setMajorCompactionMaxTimeMillis

        public ServerConfiguration setMajorCompactionMaxTimeMillis​(long majorCompactionMaxTimeMillis)
        Set the maximum milliseconds to run major compaction. If <=0 the thread will run until all compaction is completed.
        Parameters:
        majorCompactionMaxTimeMillis - The number of milliseconds to run compaction.
        Returns:
        server configuration
        See Also:
        getMajorCompactionMaxTimeMillis()
      • getMinorCompactionInterval

        public long getMinorCompactionInterval()
        Get interval to run minor compaction, in seconds.

        If it is set to less than zero, the minor compaction is disabled.

        Returns:
        threshold of minor compaction
      • setMinorCompactionInterval

        public ServerConfiguration setMinorCompactionInterval​(long interval)
        Set interval to run minor compaction.
        Parameters:
        interval - Interval to run minor compaction
        Returns:
        server configuration
        See Also:
        getMinorCompactionInterval()
      • getMajorCompactionInterval

        public long getMajorCompactionInterval()
        Get interval to run major compaction, in seconds.

        If it is set to less than zero, the major compaction is disabled.

        Returns:
        high water mark
      • setMajorCompactionInterval

        public ServerConfiguration setMajorCompactionInterval​(long interval)
        Set interval to run major compaction.
        Parameters:
        interval - Interval to run major compaction
        Returns:
        server configuration
        See Also:
        getMajorCompactionInterval()
      • getMinorCompactionMaxTimeMillis

        public long getMinorCompactionMaxTimeMillis()
        Get the maximum milliseconds to run minor compaction. If <=0 the thread will run until all compaction is completed.
        Returns:
        limit The number of milliseconds to run compaction.
      • setMinorCompactionMaxTimeMillis

        public ServerConfiguration setMinorCompactionMaxTimeMillis​(long minorCompactionMaxTimeMillis)
        Set the maximum milliseconds to run minor compaction. If <=0 the thread will run until all compaction is completed.
        Parameters:
        minorCompactionMaxTimeMillis - The number of milliseconds to run compaction.
        Returns:
        server configuration
        See Also:
        getMinorCompactionMaxTimeMillis()
      • getIsForceGCAllowWhenNoSpace

        public boolean getIsForceGCAllowWhenNoSpace()
        Get whether force compaction is allowed when disk full or almost full.

        Force GC may get some space back, but may also fill up disk space more quickly. This is because new log files are created before GC, while old garbage log files deleted after GC.

        Returns:
        true - do force GC when disk full, false - suspend GC when disk full.
      • setIsForceGCAllowWhenNoSpace

        public ServerConfiguration setIsForceGCAllowWhenNoSpace​(boolean force)
        Set whether force GC is allowed when disk full or almost full.
        Parameters:
        force - true to allow force GC; false to suspend GC
        Returns:
        ServerConfiguration
      • setOpenLedgerRereplicationGracePeriod

        public void setOpenLedgerRereplicationGracePeriod​(java.lang.String waitTime)
        Set the grace period which the rereplication worker will wait before fencing and rereplicating a ledger fragment which is still being written to, on bookie failure.

        The grace period allows the writer to detect the bookie failure, and and start writing to another ledger fragment. If the writer writes nothing during the grace period, the rereplication worker assumes that it has crashed and therefore fences the ledger, preventing any further writes to that ledger.

        Parameters:
        waitTime - time to wait before replicating ledger fragment
        See Also:
        BookKeeper.openLedger(long, org.apache.bookkeeper.client.BookKeeper.DigestType, byte[])
      • getOpenLedgerRereplicationGracePeriod

        public long getOpenLedgerRereplicationGracePeriod()
        Get the grace period which the rereplication worker to wait before fencing and rereplicating a ledger fragment which is still being written to, on bookie failure.
        Returns:
        long
      • setLockReleaseOfFailedLedgerGracePeriod

        public void setLockReleaseOfFailedLedgerGracePeriod​(java.lang.String waitTime)
        Set the grace period, in milliseconds, which the replication worker has to wait before releasing the lock after it failed to replicate a ledger. For the first ReplicationWorker.NUM_OF_EXPONENTIAL_BACKOFF_RETRIALS failures it will do exponential backoff then it will bound at LOCK_RELEASE_OF_FAILED_LEDGER_GRACE_PERIOD.

        On replication failure, instead of releasing the lock immediately after failed attempt, it will hold under replicated ledger lock for the grace period and then it will release the lock.

        Parameters:
        waitTime -
      • getLockReleaseOfFailedLedgerGracePeriod

        public long getLockReleaseOfFailedLedgerGracePeriod()
        Get the grace period, in milliseconds, which the replication worker has to wait before releasing the lock after it failed to replicate a ledger. For the first ReplicationWorker.NUM_OF_EXPONENTIAL_BACKOFF_RETRIALS failures it will do exponential backoff then it will bound at LOCK_RELEASE_OF_FAILED_LEDGER_GRACE_PERIOD.
        Returns:
      • getReadBufferBytes

        public int getReadBufferBytes()
        Get the number of bytes we should use as capacity for org.apache.bookkeeper.bookie.BufferedReadChannel. Default is 512 bytes
        Returns:
        read buffer size
      • setReadBufferBytes

        public ServerConfiguration setReadBufferBytes​(int readBufferSize)
        Set the number of bytes we should use as capacity for org.apache.bookkeeper.bookie.BufferedReadChannel.
        Parameters:
        readBufferSize - Read Buffer Size
        Returns:
        server configuration
      • setNumAddWorkerThreads

        public ServerConfiguration setNumAddWorkerThreads​(int numThreads)
        Set the number of threads that would handle write requests.
        Parameters:
        numThreads - number of threads to handle write requests.
        Returns:
        server configuration
      • getNumAddWorkerThreads

        public int getNumAddWorkerThreads()
        Get the number of threads that should handle write requests.
        Returns:
        the number of threads that handle write requests.
      • setNumLongPollWorkerThreads

        public ServerConfiguration setNumLongPollWorkerThreads​(int numThreads)
        Set the number of threads that should handle long poll requests.
        Parameters:
        numThreads - number of threads to handle long poll requests.
        Returns:
        server configuration
      • getNumLongPollWorkerThreads

        public int getNumLongPollWorkerThreads()
        Get the number of threads that should handle long poll requests.

        If the number of threads is zero or negative, bookie will fallback to use read threads. If there is no read threads used, it will create a thread pool with Runtime.availableProcessors() threads.

        Returns:
        the number of threads that should handle long poll requests, default value is 0.
      • setNumHighPriorityWorkerThreads

        public ServerConfiguration setNumHighPriorityWorkerThreads​(int numThreads)
        Set the number of threads that should be used for high priority requests (i.e. recovery reads and adds, and fencing)
        Parameters:
        numThreads - number of threads to handle high priority requests.
        Returns:
        server configuration
      • getNumHighPriorityWorkerThreads

        public int getNumHighPriorityWorkerThreads()
        Get the number of threads that should be used for high priority requests (i.e. recovery reads and adds, and fencing)
        Returns:
      • setReadWorkerThreadsThrottlingEnabled

        public ServerConfiguration setReadWorkerThreadsThrottlingEnabled​(boolean throttle)
        Use auto-throttling of the read-worker threads. This is done to ensure the bookie is not using unlimited amount of memory to respond to read-requests.
        Parameters:
        throttle - whether to throttle the read workers threads
        Returns:
        server configuration
      • isReadWorkerThreadsThrottlingEnabled

        public boolean isReadWorkerThreadsThrottlingEnabled()
        Get the auto-throttling status of the read-worker threads.
        Returns:
      • setNumReadWorkerThreads

        public ServerConfiguration setNumReadWorkerThreads​(int numThreads)
        Set the number of threads that would handle read requests.
        Parameters:
        numThreads - Number of threads to handle read requests.
        Returns:
        server configuration
      • getNumReadWorkerThreads

        public int getNumReadWorkerThreads()
        Get the number of threads that should handle read requests.
      • setRequestTimerTickDurationMs

        public ServerConfiguration setRequestTimerTickDurationMs​(int tickDuration)
        Set the tick duration in milliseconds.
        Parameters:
        tickDuration - tick duration in milliseconds.
        Returns:
        server configuration
      • setMaxPendingReadRequestPerThread

        public ServerConfiguration setMaxPendingReadRequestPerThread​(int maxPendingReadRequestsPerThread)
        Set the max number of pending read requests for each read worker thread. After the quota is reached, new requests will be failed immediately.
        Parameters:
        maxPendingReadRequestsPerThread -
        Returns:
        server configuration
      • getMaxPendingReadRequestPerThread

        public int getMaxPendingReadRequestPerThread()
        If read workers threads are enabled, limit the number of pending requests, to avoid the executor queue to grow indefinitely (default: 10000 entries).
      • setMaxPendingAddRequestPerThread

        public ServerConfiguration setMaxPendingAddRequestPerThread​(int maxPendingAddRequestsPerThread)
        Set the max number of pending add requests for each add worker thread. After the quota is reached, new requests will be failed immediately.
        Parameters:
        maxPendingAddRequestsPerThread -
        Returns:
        server configuration
      • getMaxPendingAddRequestPerThread

        public int getMaxPendingAddRequestPerThread()
        If add workers threads are enabled, limit the number of pending requests, to avoid the executor queue to grow indefinitely (default: 10000 entries).
      • getRequestTimerTickDurationMs

        public int getRequestTimerTickDurationMs()
        Get the tick duration in milliseconds.
        Returns:
      • setRequestTimerNumTicks

        public ServerConfiguration setRequestTimerNumTicks​(int tickCount)
        Set the number of ticks per wheel for the request timer.
        Parameters:
        tickCount - number of ticks per wheel for the request timer.
        Returns:
        server configuration
      • getRequestTimerNumTicks

        public int getRequestTimerNumTicks()
        Get the number of ticks per wheel for the request timer.
        Returns:
      • getWriteBufferBytes

        public int getWriteBufferBytes()
        Get the number of bytes used as capacity for the write buffer. Default is 64KB. NOTE: Make sure this value is greater than the maximum message size.
        Returns:
        the size of the write buffer in bytes
      • setWriteBufferBytes

        public ServerConfiguration setWriteBufferBytes​(int writeBufferBytes)
        Set the number of bytes used as capacity for the write buffer.
        Parameters:
        writeBufferBytes - Write Buffer Bytes
        Returns:
        server configuration
      • setNumJournalCallbackThreads

        public ServerConfiguration setNumJournalCallbackThreads​(int numThreads)
        Set the number of threads that would handle journal callbacks.
        Parameters:
        numThreads - number of threads to handle journal callbacks.
        Returns:
        server configuration
      • getNumJournalCallbackThreads

        public int getNumJournalCallbackThreads()
        Get the number of threads that should handle journal callbacks.
        Returns:
        the number of threads that handle journal callbacks.
      • setSortedLedgerStorageEnabled

        public ServerConfiguration setSortedLedgerStorageEnabled​(boolean enabled)
        Deprecated.
        Use setLedgerStorageClass(String) to configure the implementation class
        Set sorted-ledger storage enabled or not.
        Parameters:
        enabled -
      • getSortedLedgerStorageEnabled

        public boolean getSortedLedgerStorageEnabled()
        Check if sorted-ledger storage enabled (default true).
        Returns:
        true if sorted ledger storage is enabled, false otherwise
      • getSkipListSizeLimit

        public long getSkipListSizeLimit()
        Get skip list data size limitation (default 64MB). Max value is 1,073,741,823
        Returns:
        skip list data size limitation
      • setSkipListSizeLimit

        public ServerConfiguration setSkipListSizeLimit​(int size)
        Set skip list size limit.
        Parameters:
        size - skip list size limit.
        Returns:
        server configuration object.
      • getSkipListArenaChunkSize

        public int getSkipListArenaChunkSize()
        Get the number of bytes we should use as chunk allocation for org.apache.bookkeeper.bookie.SkipListArena. Default is 4 MB
        Returns:
        the number of bytes to use for each chunk in the skiplist arena
      • setSkipListArenaChunkSize

        public ServerConfiguration setSkipListArenaChunkSize​(int size)
        Set the number of bytes we used as chunk allocation for org.apache.bookkeeper.bookie.SkipListArena.
        Parameters:
        size - chunk size.
        Returns:
        server configuration object.
      • getSkipListArenaMaxAllocSize

        public int getSkipListArenaMaxAllocSize()
        Get the max size we should allocate from the skiplist arena. Allocations larger than this should be allocated directly by the VM to avoid fragmentation.
        Returns:
        max size allocatable from the skiplist arena (Default is 128 KB)
      • setSkipListArenaMaxAllocSize

        public ServerConfiguration setSkipListArenaMaxAllocSize​(int size)
        Set the max size we should allocate from the skiplist arena. Allocations larger than this should be allocated directly by the VM to avoid fragmentation.
        Parameters:
        size - max alloc size.
        Returns:
        server configuration object.
      • getJournalSyncData

        public boolean getJournalSyncData()
        Should the data be fsynced on journal before acknowledgment.

        Default is true

        Returns:
      • getJournalWriteData

        public boolean getJournalWriteData()
        Should the data be written to journal before acknowledgment.

        Default is true

        Returns:
      • setJournalWriteData

        public ServerConfiguration setJournalWriteData​(boolean journalWriteData)
        Should the data be written to journal before acknowledgment.

        Default is true

        Returns:
      • setJournalSyncData

        public ServerConfiguration setJournalSyncData​(boolean syncData)
        Enable or disable journal syncs.

        By default, data sync is enabled to guarantee durability of writes.

        Beware: while disabling data sync in the Bookie journal might improve the bookie write performance, it will also introduce the possibility of data loss. With no sync, the journal entries are written in the OS page cache but not flushed to disk. In case of power failure, the affected bookie might lose the unflushed data. If the ledger is replicated to multiple bookies, the chances of data loss are reduced though still present.

        Parameters:
        syncData - whether to sync data on disk before acknowledgement
        Returns:
        server configuration object
      • getJournalAdaptiveGroupWrites

        public boolean getJournalAdaptiveGroupWrites()
        Should we group journal force writes.
        Returns:
        group journal force writes
      • setJournalAdaptiveGroupWrites

        public ServerConfiguration setJournalAdaptiveGroupWrites​(boolean enabled)
        Enable/disable group journal force writes.
        Parameters:
        enabled - flag to enable/disable group journal force writes
      • getJournalMaxGroupWaitMSec

        public long getJournalMaxGroupWaitMSec()
        Maximum latency to impose on a journal write to achieve grouping. Default is 2ms.
        Returns:
        max wait for grouping
      • setJournalMaxGroupWaitMSec

        public ServerConfiguration setJournalMaxGroupWaitMSec​(long journalMaxGroupWaitMSec)
        Sets the maximum latency to impose on a journal write to achieve grouping.
        Parameters:
        journalMaxGroupWaitMSec - maximum time to wait in milliseconds.
        Returns:
        server configuration.
      • getJournalBufferedWritesThreshold

        public long getJournalBufferedWritesThreshold()
        Maximum bytes to buffer to impose on a journal write to achieve grouping.
        Returns:
        max bytes to buffer
      • setJournalBufferedWritesThreshold

        public ServerConfiguration setJournalBufferedWritesThreshold​(long maxBytes)
        Set maximum bytes to buffer to impose on a journal write to achieve grouping.
        Parameters:
        maxBytes - maximum bytes to buffer to impose on a journal write
        Returns:
        max bytes to buffer
      • getJournalBufferedEntriesThreshold

        public long getJournalBufferedEntriesThreshold()
        Maximum entries to buffer to impose on a journal write to achieve grouping. Use getJournalBufferedWritesThreshold() if this is set to zero or less than zero.
        Returns:
        max entries to buffer.
      • setJournalBufferedEntriesThreshold

        public ServerConfiguration setJournalBufferedEntriesThreshold​(int maxEntries)
        Set maximum entries to buffer to impose on a journal write to achieve grouping. Use getJournalBufferedWritesThreshold() set this to zero or less than zero.
        Parameters:
        maxEntries - maximum entries to buffer.
        Returns:
        server configuration.
      • setJournalFlushWhenQueueEmpty

        public ServerConfiguration setJournalFlushWhenQueueEmpty​(boolean enabled)
        Set if we should flush the journal when queue is empty.
      • getJournalFlushWhenQueueEmpty

        public boolean getJournalFlushWhenQueueEmpty()
        Should we flush the journal when queue is empty.
        Returns:
        flush when queue is empty
      • setReadOnlyModeEnabled

        public ServerConfiguration setReadOnlyModeEnabled​(boolean enabled)
        Set whether the bookie is able to go into read-only mode. If this is set to false, the bookie will shutdown on encountering an error condition.
        Parameters:
        enabled - whether to enable read-only mode.
        Returns:
        ServerConfiguration
      • isReadOnlyModeEnabled

        public boolean isReadOnlyModeEnabled()
        Get whether read-only mode is enabled. The default is true.
        Returns:
        boolean
      • setReadOnlyModeOnAnyDiskFullEnabled

        public ServerConfiguration setReadOnlyModeOnAnyDiskFullEnabled​(boolean enabled)
        Set whether the bookie is able to go into read-only mode when any disk is full. If this set to false, it will behave to READ_ONLY_MODE_ENABLED flag.
        Parameters:
        enabled - whether to enable read-only mode when any disk is full.
        Returns:
      • isReadOnlyModeOnAnyDiskFullEnabled

        public boolean isReadOnlyModeOnAnyDiskFullEnabled()
        Get whether read-only mode is enable when any disk is full. The default is false.
        Returns:
        boolean
      • setDiskUsageWarnThreshold

        public ServerConfiguration setDiskUsageWarnThreshold​(float threshold)
        Set the warning threshold for disk usage.
        Parameters:
        threshold - warning threshold to force gc.
        Returns:
        ServerConfiguration
      • getDiskUsageWarnThreshold

        public float getDiskUsageWarnThreshold()
        Returns the warning threshold for disk usage. If disk usage goes beyond this, a garbage collection cycle will be forced.
        Returns:
        the percentage at which a disk usage warning will trigger
      • setPersistBookieStatusEnabled

        public ServerConfiguration setPersistBookieStatusEnabled​(boolean enabled)
        Whether to persist the bookie status so that when bookie server restarts, it will continue using the previous status.
        Parameters:
        enabled - - true if persist the bookie status. Otherwise false.
        Returns:
        ServerConfiguration
      • isPersistBookieStatusEnabled

        public boolean isPersistBookieStatusEnabled()
        Get whether to persist the bookie status so that when bookie server restarts, it will continue using the previous status.
        Returns:
        true - if need to start a bookie in read only mode. Otherwise false.
      • setDiskUsageThreshold

        public ServerConfiguration setDiskUsageThreshold​(float threshold)
        Set the Disk free space threshold as a fraction of the total after which disk will be considered as full during disk check.
        Parameters:
        threshold - threshold to declare a disk full
        Returns:
        ServerConfiguration
      • getDiskUsageThreshold

        public float getDiskUsageThreshold()
        Returns disk free space threshold. By default it is 0.95.
        Returns:
        the percentage at which a disk will be considered full
      • setDiskLowWaterMarkUsageThreshold

        public ServerConfiguration setDiskLowWaterMarkUsageThreshold​(float threshold)
        Set the disk free space low water mark threshold. Disk is considered full when usage threshold is exceeded. Disk returns back to non-full state when usage is below low water mark threshold. This prevents it from going back and forth between these states frequently when concurrent writes and compaction are happening. This also prevent bookie from switching frequently between read-only and read-writes states in the same cases.
        Parameters:
        threshold - threshold to declare a disk full
        Returns:
        ServerConfiguration
      • getDiskLowWaterMarkUsageThreshold

        public float getDiskLowWaterMarkUsageThreshold()
        Returns disk free space low water mark threshold. By default it is the same as usage threshold (for backwards-compatibility).
        Returns:
        the percentage below which a disk will NOT be considered full
      • setDiskCheckInterval

        public ServerConfiguration setDiskCheckInterval​(int interval)
        Set the disk checker interval to monitor ledger disk space.
        Parameters:
        interval - interval between disk checks for space.
        Returns:
        ServerConfiguration
      • getDiskCheckInterval

        public int getDiskCheckInterval()
        Get the disk checker interval.
        Returns:
        int
      • setAuditorPeriodicCheckInterval

        public void setAuditorPeriodicCheckInterval​(long interval)
        Set the regularity at which the auditor will run a check of all ledgers. This should not be run very often, and at most, once a day. Setting this to 0 will completely disable the periodic check.
        Parameters:
        interval - The interval in seconds. e.g. 86400 = 1 day, 604800 = 1 week
      • getAuditorPeriodicCheckInterval

        public long getAuditorPeriodicCheckInterval()
        Get the regularity at which the auditor checks all ledgers.
        Returns:
        The interval in seconds. Default is 604800 (1 week).
      • setAuditorPeriodicBookieCheckInterval

        public void setAuditorPeriodicBookieCheckInterval​(long interval)
        Set the interval between auditor bookie checks. The auditor bookie check, checks ledger metadata to see which bookies contain entries for each ledger. If a bookie which should contain entries is unavailable, then the ledger containing that entry is marked for recovery. Setting this to 0 disabled the periodic check. Bookie checks will still run when a bookie fails.
        Parameters:
        interval - The period in seconds.
      • getAuditorPeriodicBookieCheckInterval

        public long getAuditorPeriodicBookieCheckInterval()
        Get the interval between auditor bookie check runs.
        Returns:
        the interval between bookie check runs, in seconds. Default is 86400 (= 1 day)
        See Also:
        setAuditorPeriodicBookieCheckInterval(long)
      • setAuditorPeriodicPlacementPolicyCheckInterval

        public void setAuditorPeriodicPlacementPolicyCheckInterval​(long interval)
        Sets the regularity/interval at which the auditor will run a placement policy check of all ledgers, which are closed. This should not be run very often, and should be run at most once a day. Setting this to 0 will completely disable the periodic metadata check.
        Parameters:
        interval - The interval in seconds. e.g. 86400 = 1 day, 604800 = 1 week
      • getAuditorPeriodicPlacementPolicyCheckInterval

        public long getAuditorPeriodicPlacementPolicyCheckInterval()
        Get the regularity at which the auditor does placement policy check of all ledgers, which are closed.
        Returns:
        The interval in seconds. By default, it is disabled.
      • setRepairedPlacementPolicyNotAdheringBookieEnable

        public void setRepairedPlacementPolicyNotAdheringBookieEnable​(boolean enabled)
      • isRepairedPlacementPolicyNotAdheringBookieEnable

        public boolean isRepairedPlacementPolicyNotAdheringBookieEnable()
        Now the feature only support RackawareEnsemblePlacementPolicy. In Auditor, it combines with getAuditorPeriodicPlacementPolicyCheckInterval(), to control is marked ledger id to under replication managed when found a ledger ensemble not adhere to placement policy. In ReplicationWorker, to control is to repair the ledger which the ensemble does not adhere to the placement policy. By default, it is disabled. If you want to enable this feature, there maybe lots of ledger will be mark underreplicated. The replicationWorker will replicate lots of ledger, it will increase read request and write request in bookie server. You should set a suitable rereplicationEntryBatchSize to avoid bookie server pressure.
      • setUnderreplicatedLedgerRecoveryGracePeriod

        public void setUnderreplicatedLedgerRecoveryGracePeriod​(long gracePeriod)
        Sets the grace period (in seconds) for underreplicated ledgers recovery. If ledger is marked underreplicated for more than this period then it will be reported by placementPolicyCheck in Auditor. Setting this to 0 will disable this check.
        Parameters:
        gracePeriod - The interval in seconds. e.g. 3600 = 1 hour
      • getUnderreplicatedLedgerRecoveryGracePeriod

        public long getUnderreplicatedLedgerRecoveryGracePeriod()
        Gets the grace period (in seconds) for underreplicated ledgers recovery. If ledger is marked underreplicated for more than this period then it will be reported by placementPolicyCheck in Auditor. Setting this to 0 will disable this check.
        Returns:
        The interval in seconds. By default it is disabled.
      • setAuditorPeriodicReplicasCheckInterval

        public void setAuditorPeriodicReplicasCheckInterval​(long interval)
        Sets the interval at which the auditor will run a replicas check of all ledgers. This should not be run very often since it validates availability of replicas of all ledgers by querying bookies. Setting this to 0 will disable the periodic replicas check.
        Parameters:
        interval - The interval in seconds. e.g. 86400 = 1 day, 604800 = 1 week
      • getAuditorPeriodicReplicasCheckInterval

        public long getAuditorPeriodicReplicasCheckInterval()
        Get the interval at which the auditor does replicas check of all ledgers.
        Returns:
        The interval in seconds. By default it is disabled.
      • getAuditorMaxNumberOfConcurrentOpenLedgerOperations

        public int getAuditorMaxNumberOfConcurrentOpenLedgerOperations()
        Get the semaphore limit value of getting ledger from zookeeper in auto recovery.
        Returns:
        The semaphore value. By default it is 500.
      • setAuditorMaxNumberOfConcurrentOpenLedgerOperations

        public void setAuditorMaxNumberOfConcurrentOpenLedgerOperations​(int semaphore)
        Set the semaphore limit value for getting ledger from zookeeper in auto recovery.
        Parameters:
        semaphore -
      • getAuditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec

        public int getAuditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec()
        Get the acquire concurrent open ledger operations timeout.
        Returns:
        The timeout values. By default it is 120000ms
      • setAuditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec

        public void setAuditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec​(int timeoutMs)
        Set the acquire concurrent open ledger operations timeout.
        Parameters:
        timeoutMs -
      • setAuditorLedgerVerificationPercentage

        public ServerConfiguration setAuditorLedgerVerificationPercentage​(long auditorLedgerVerificationPercentage)
        Set what percentage of a ledger (fragment)'s entries will be verified. 0 - only the first and last entry of each ledger fragment would be verified 100 - the entire ledger fragment would be verified anything else - randomly picked entries from over the fragment would be verifiec
        Parameters:
        auditorLedgerVerificationPercentage - The verification proportion as a percentage
        Returns:
        ServerConfiguration
      • getAuditorLedgerVerificationPercentage

        public long getAuditorLedgerVerificationPercentage()
        Get what percentage of a ledger (fragment)'s entries will be verified.
        Returns:
        percentage of a ledger (fragment)'s entries will be verified. Default is 0.
        See Also:
        setAuditorLedgerVerificationPercentage(long)
      • setAutoRecoveryDaemonEnabled

        public ServerConfiguration setAutoRecoveryDaemonEnabled​(boolean enabled)
        Sets that whether the auto-recovery service can start along with Bookie server itself or not.
        Parameters:
        enabled - - true if need to start auto-recovery service. Otherwise false.
        Returns:
        ServerConfiguration
      • isAutoRecoveryDaemonEnabled

        public boolean isAutoRecoveryDaemonEnabled()
        Get whether the Bookie itself can start auto-recovery service also or not.
        Returns:
        true - if Bookie should start auto-recovery service along with it. false otherwise.
      • getLostBookieRecoveryDelay

        public int getLostBookieRecoveryDelay()
        Get how long to delay the recovery of ledgers of a lost bookie.
        Returns:
        delay interval in seconds
      • setLostBookieRecoveryDelay

        public void setLostBookieRecoveryDelay​(int interval)
        Set the delay interval for starting recovery of a lost bookie.
      • getRwRereplicateBackoffMs

        public int getRwRereplicateBackoffMs()
        Get how long to backoff when encountering exception on rereplicating a ledger.
        Returns:
        backoff time in milliseconds
      • setRwRereplicateBackoffMs

        public void setRwRereplicateBackoffMs​(int backoffMs)
        Set how long to backoff when encountering exception on rereplicating a ledger.
        Parameters:
        backoffMs - backoff time in milliseconds
      • setForceReadOnlyBookie

        public ServerConfiguration setForceReadOnlyBookie​(boolean enabled)
        Sets that whether force start a bookie in readonly mode.
        Parameters:
        enabled - - true if need to start a bookie in read only mode. Otherwise false.
        Returns:
        ServerConfiguration
      • isForceReadOnlyBookie

        public boolean isForceReadOnlyBookie()
        Get whether the Bookie is force started in read only mode or not.
        Returns:
        true - if need to start a bookie in read only mode. Otherwise false.
      • getIsThrottleByBytes

        public boolean getIsThrottleByBytes()
        Get whether use bytes to throttle garbage collector compaction or not.
        Returns:
        true - use Bytes, false - use Entries.
      • setIsThrottleByBytes

        public ServerConfiguration setIsThrottleByBytes​(boolean byBytes)
        Set whether use bytes to throttle garbage collector compaction or not.
        Parameters:
        byBytes - true to use by bytes; false to use by entries
        Returns:
        ServerConfiguration
      • getCompactionMaxOutstandingRequests

        public int getCompactionMaxOutstandingRequests()
        Get the maximum number of entries which can be compacted without flushing. Default is 100,000.
        Returns:
        the maximum number of unflushed entries
      • setCompactionMaxOutstandingRequests

        public ServerConfiguration setCompactionMaxOutstandingRequests​(int maxOutstandingRequests)
        Set the maximum number of entries which can be compacted without flushing.

        When compacting, the entries are written to the entrylog and the new offsets are cached in memory. Once the entrylog is flushed the index is updated with the new offsets. This parameter controls the number of entries added to the entrylog before a flush is forced. A higher value for this parameter means more memory will be used for offsets. Each offset consists of 3 longs.

        This parameter should _not_ be modified unless you know what you're doing. The default is 100,000.

        Parameters:
        maxOutstandingRequests - number of entries to compact before flushing
        Returns:
        ServerConfiguration
      • getCompactionRate

        @Deprecated
        public int getCompactionRate()
        Deprecated.
        Get the rate of compaction adds. Default is 1,000.
        Returns:
        rate of compaction (adds per second)
      • setCompactionRate

        public ServerConfiguration setCompactionRate​(int rate)
        Set the rate of compaction adds.
        Parameters:
        rate - rate of compaction adds (adds entries per second)
        Returns:
        ServerConfiguration
      • getCompactionRateByEntries

        public int getCompactionRateByEntries()
        Get the rate of compaction adds. Default is 1,000.
        Returns:
        rate of compaction (adds entries per second)
      • setCompactionRateByEntries

        public ServerConfiguration setCompactionRateByEntries​(int rate)
        Set the rate of compaction adds.
        Parameters:
        rate - rate of compaction adds (adds entries per second)
        Returns:
        ServerConfiguration
      • getCompactionRateByBytes

        public int getCompactionRateByBytes()
        Get the rate of compaction adds. Default is 1,000,000.
        Returns:
        rate of compaction (adds bytes per second)
      • setCompactionRateByBytes

        public ServerConfiguration setCompactionRateByBytes​(int rate)
        Set the rate of compaction adds.
        Parameters:
        rate - rate of compaction adds (adds bytes per second)
        Returns:
        ServerConfiguration
      • getJournalRemovePagesFromCache

        @Beta
        public boolean getJournalRemovePagesFromCache()
        Should we remove pages from page cache after force write.
        Returns:
        remove pages from cache
      • setJournalRemovePagesFromCache

        public ServerConfiguration setJournalRemovePagesFromCache​(boolean enabled)
        Sets that whether should we remove pages from page cache after force write.
        Parameters:
        enabled - - true if we need to remove pages from page cache. otherwise, false
        Returns:
        ServerConfiguration
      • getLedgerStorageClass

        public java.lang.String getLedgerStorageClass()
      • setLedgerStorageClass

        public ServerConfiguration setLedgerStorageClass​(java.lang.String ledgerStorageClass)
        Set the LedgerStorage implementation class name.
        Parameters:
        ledgerStorageClass - the class name
        Returns:
        ServerConfiguration
      • getUseHostNameAsBookieID

        public boolean getUseHostNameAsBookieID()
        Get whether bookie is using hostname for registration and in ledger metadata. Defaults to false.
        Returns:
        true, then bookie will be registered with its hostname and hostname will be used in ledger metadata. Otherwise bookie will use its ipaddress
      • setUseHostNameAsBookieID

        public ServerConfiguration setUseHostNameAsBookieID​(boolean useHostName)
        Configure the bookie to use its hostname to register with the co-ordination service(eg: zookeeper) and in ledger metadata.
        Parameters:
        useHostName - whether to use hostname for registration and in ledgermetadata
        Returns:
        server configuration
        See Also:
        getUseHostNameAsBookieID()
      • getUseShortHostName

        public boolean getUseShortHostName()
        If bookie is using hostname for registration and in ledger metadata then whether to use short hostname or FQDN hostname. Defaults to false.
        Returns:
        true, then bookie will be registered with its short hostname and short hostname will be used in ledger metadata. Otherwise bookie will use its FQDN hostname
      • setUseShortHostName

        public ServerConfiguration setUseShortHostName​(boolean useShortHostName)
        Configure the bookie to use its short hostname or FQDN hostname to register with the co-ordination service(eg: zookeeper) and in ledger metadata.
        Parameters:
        useShortHostName - whether to use short hostname for registration and in ledgermetadata
        Returns:
        server configuration
        See Also:
        getUseShortHostName()
      • isEnableLocalTransport

        public boolean isEnableLocalTransport()
        Get whether to listen for local JVM clients. Defaults to false.
        Returns:
        true, then bookie will be listen for local JVM clients
      • setEnableLocalTransport

        public ServerConfiguration setEnableLocalTransport​(boolean enableLocalTransport)
        Configure the bookie to listen for BookKeeper clients executed on the local JVM.
        Parameters:
        enableLocalTransport - whether to use listen for local JVM clients
        Returns:
        server configuration
        See Also:
        isEnableLocalTransport()
      • isDisableServerSocketBind

        public boolean isDisableServerSocketBind()
        Get whether to disable bind of server-side sockets. Defaults to false.
        Returns:
        true, then bookie will not listen for network connections
      • setDisableServerSocketBind

        public ServerConfiguration setDisableServerSocketBind​(boolean disableServerSocketBind)
        Configure the bookie to disable bind on network interfaces, this bookie will be available only to BookKeeper clients executed on the local JVM.
        Parameters:
        disableServerSocketBind - whether to disable binding on network interfaces
        Returns:
        server configuration
        See Also:
        isDisableServerSocketBind()
      • getStatsProviderClass

        public java.lang.Class<? extends StatsProvider> getStatsProviderClass()
                                                                       throws org.apache.commons.configuration.ConfigurationException
        Get the stats provider used by bookie.
        Returns:
        stats provider class
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • setStatsProviderClass

        public ServerConfiguration setStatsProviderClass​(java.lang.Class<? extends StatsProvider> providerClass)
        Set the stats provider used by bookie.
        Parameters:
        providerClass - stats provider class
        Returns:
        server configuration
      • validate

        public void validate()
                      throws org.apache.commons.configuration.ConfigurationException
        Validate the configuration.
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • getRecvByteBufAllocatorSizeInitial

        public int getRecvByteBufAllocatorSizeInitial()
        Get Recv ByteBuf allocator initial buf size.
        Returns:
        initial byteBuf size
      • setRecvByteBufAllocatorSizeInitial

        public void setRecvByteBufAllocatorSizeInitial​(int size)
        Set Recv ByteBuf allocator initial buf size.
        Parameters:
        size - buffer size
      • getRecvByteBufAllocatorSizeMin

        public int getRecvByteBufAllocatorSizeMin()
        Get Recv ByteBuf allocator min buf size.
        Returns:
        min byteBuf size
      • setRecvByteBufAllocatorSizeMin

        public void setRecvByteBufAllocatorSizeMin​(int size)
        Set Recv ByteBuf allocator min buf size.
        Parameters:
        size - buffer size
      • getRecvByteBufAllocatorSizeMax

        public int getRecvByteBufAllocatorSizeMax()
        Get Recv ByteBuf allocator max buf size.
        Returns:
        max byteBuf size
      • setRecvByteBufAllocatorSizeMax

        public void setRecvByteBufAllocatorSizeMax​(int size)
        Set Recv ByteBuf allocator max buf size.
        Parameters:
        size - buffer size
      • setBookieAuthProviderFactoryClass

        public void setBookieAuthProviderFactoryClass​(java.lang.String factoryClass)
        Set the bookie authentication provider factory class name. If this is not set, no authentication will be used.
        Parameters:
        factoryClass - the bookie authentication provider factory class name
      • getBookieAuthProviderFactoryClass

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

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

        public ServerConfiguration 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 ServerConfiguration 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 ServerConfiguration setTLSKeyStorePasswordPath​(java.lang.String arg)
        Set the path to file containing keystore password, if the client keystore is password protected.
        Returns:
      • getTLSKeyStoreType

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

        public ServerConfiguration 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 ServerConfiguration 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 ServerConfiguration 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 ServerConfiguration setTLSCertificatePath​(java.lang.String arg)
        Set the path to file containing TLS Certificate.
        Returns:
      • getEnableTaskExecutionStats

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

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

        public long getMinUsableSizeForIndexFileCreation()
        Gets the minimum safe Usable size to be available in index directory for Bookie to create Index File while replaying journal at the time of Bookie Start in Readonly Mode (in bytes).
        Returns:
        minimum safe usable size to be available in index directory for bookie to create index files.
        See Also:
        setMinUsableSizeForIndexFileCreation(long)
      • setMinUsableSizeForIndexFileCreation

        public ServerConfiguration setMinUsableSizeForIndexFileCreation​(long minUsableSizeForIndexFileCreation)
        Sets the minimum safe Usable size to be available in index directory for Bookie to create Index File while replaying journal at the time of Bookie Start in Readonly Mode (in bytes).

        This parameter allows creating index files when there are enough disk spaces, even when the bookie is running at readonly mode because of the disk usage is exceeding getDiskUsageThreshold(). Because compaction, journal replays can still write index files to disks when a bookie is readonly.

        Parameters:
        minUsableSizeForIndexFileCreation - min usable size for index file creation
        Returns:
        server configuration
      • getMinUsableSizeForEntryLogCreation

        public long getMinUsableSizeForEntryLogCreation()
        Gets the minimum safe usable size to be available in ledger directory for Bookie to create entry log files.
        Returns:
        minimum safe usable size to be available in ledger directory for entry log file creation.
        See Also:
        setMinUsableSizeForEntryLogCreation(long)
      • setMinUsableSizeForEntryLogCreation

        public ServerConfiguration setMinUsableSizeForEntryLogCreation​(long minUsableSizeForEntryLogCreation)
        Sets the minimum safe usable size to be available in ledger directory for Bookie to create entry log files.

        This parameter allows creating entry log files when there are enough disk spaces, even when the bookie is running at readonly mode because of the disk usage is exceeding getDiskUsageThreshold(). Because compaction, journal replays can still write data to disks when a bookie is readonly.

        Parameters:
        minUsableSizeForEntryLogCreation - minimum safe usable size to be available in ledger directory
        Returns:
        server configuration
      • getMinUsableSizeForHighPriorityWrites

        public long getMinUsableSizeForHighPriorityWrites()
        Gets the minimum safe usable size to be available in ledger directory for Bookie to accept high priority writes.

        If not set, it is the value of getMinUsableSizeForEntryLogCreation().

        Returns:
        the minimum safe usable size per ledger directory for bookie to accept high priority writes.
      • setMinUsableSizeForHighPriorityWrites

        public ServerConfiguration setMinUsableSizeForHighPriorityWrites​(long minUsableSizeForHighPriorityWrites)
        Sets the minimum safe usable size to be available in ledger directory for Bookie to accept high priority writes.
        Parameters:
        minUsableSizeForHighPriorityWrites - minimum safe usable size per ledger directory for Bookie to accept high priority writes
        Returns:
        server configuration.
      • isAllowMultipleDirsUnderSameDiskPartition

        public boolean isAllowMultipleDirsUnderSameDiskPartition()
        returns whether it is allowed to have multiple ledger/index/journal Directories in the same filesystem diskpartition.
        Returns:
      • setAllowMultipleDirsUnderSameDiskPartition

        public ServerConfiguration setAllowMultipleDirsUnderSameDiskPartition​(boolean allow)
        Configure the Bookie to allow/disallow multiple ledger/index/journal directories in the same filesystem diskpartition.
        Parameters:
        allow -
        Returns:
        server configuration object.
      • isHttpServerEnabled

        public boolean isHttpServerEnabled()
        Get whether to start the http server or not.
        Returns:
        true - if http server should start
      • setHttpServerEnabled

        public ServerConfiguration setHttpServerEnabled​(boolean enabled)
        Set whether to start the http server or not.
        Parameters:
        enabled - - true if we should start http server
        Returns:
        ServerConfiguration
      • getHttpServerPort

        public int getHttpServerPort()
        Get the http server port.
        Returns:
        http server port
      • setHttpServerPort

        public ServerConfiguration setHttpServerPort​(int port)
        Set Http server port listening on.
        Parameters:
        port - Port to listen on
        Returns:
        server configuration
      • getHttpServerHost

        public java.lang.String getHttpServerHost()
        Get the http server host.
        Returns:
        http server host
      • setHttpServerHost

        public ServerConfiguration setHttpServerHost​(java.lang.String host)
        Set Http server host listening on.
        Parameters:
        host - host to listen on
        Returns:
        server configuration
      • isHttpServerTlsEnable

        public boolean isHttpServerTlsEnable()
        Get if Http Server Tls enable.
        Returns:
      • setHttpServerTlsEnable

        public ServerConfiguration setHttpServerTlsEnable​(boolean tlsEnable)
        Set if Http Server Tls enable.
        Parameters:
        tlsEnable -
        Returns:
        server configuration
      • getHttpServerKeystorePath

        public java.lang.String getHttpServerKeystorePath()
        Get the http server keystore path.
        Returns:
        http server keystore path
      • setHttpServerKeystorePath

        public ServerConfiguration setHttpServerKeystorePath​(java.lang.String keystorePath)
        Set Http server keystore path.
        Parameters:
        keystorePath - http server keystore path
        Returns:
        server configuration
      • getHttpServerKeystorePassword

        public java.lang.String getHttpServerKeystorePassword()
        Get the http server keyStore password.
        Returns:
        http server keyStore password
      • setHttpServerKeyStorePassword

        public ServerConfiguration setHttpServerKeyStorePassword​(java.lang.String keyStorePassword)
        Set Http server keyStore password.
        Parameters:
        keyStorePassword - http server keyStore password
        Returns:
        server configuration
      • getHttpServerTrustStorePath

        public java.lang.String getHttpServerTrustStorePath()
        Get the http server trustStore path.
        Returns:
        http server trustStore path
      • setHttpServerTrustStorePath

        public ServerConfiguration setHttpServerTrustStorePath​(java.lang.String trustStorePath)
        Set Http server trustStore path.
        Parameters:
        trustStorePath - http server trustStore path
        Returns:
        server configuration
      • getHttpServerTrustStorePassword

        public java.lang.String getHttpServerTrustStorePassword()
        Get the http server trustStore password.
        Returns:
        http server trustStore password
      • setHttpServerTrustStorePasswordPassword

        public ServerConfiguration setHttpServerTrustStorePasswordPassword​(java.lang.String trustStorePassword)
        Set Http server trustStore password.
        Parameters:
        trustStorePassword - http server trustStore password
        Returns:
        server configuration
      • getExtraServerComponents

        public java.lang.String[] getExtraServerComponents()
        Get the extra list of server lifecycle components to enable on a bookie server.
        Returns:
        the extra list of server lifecycle components to enable on a bookie server.
      • setExtraServerComponents

        public ServerConfiguration setExtraServerComponents​(java.lang.String[] componentClasses)
        Set the extra list of server lifecycle components to enable on a bookie server.
        Parameters:
        componentClasses - the list of server lifecycle components to enable on a bookie server.
        Returns:
        server configuration.
      • getIgnoreExtraServerComponentsStartupFailures

        public boolean getIgnoreExtraServerComponentsStartupFailures()
        Return the flag whether to ignore startup failures on loading server components specified at getExtraServerComponents().
        Returns:
        the flag whether to ignore startup failures on loading server components specified at getExtraServerComponents(). The default value is false.
      • setIgnoreExtraServerComponentsStartupFailures

        public ServerConfiguration setIgnoreExtraServerComponentsStartupFailures​(boolean enabled)
        Set the flag whether to ignore startup failures on loading server components specified at getExtraServerComponents().
        Parameters:
        enabled - flag to enable/disable ignoring startup failures on loading server components.
        Returns:
        server configuration.
      • getServerWriteBufferLowWaterMark

        public int getServerWriteBufferLowWaterMark()
        Get server netty channel write buffer low water mark.
        Returns:
        netty channel write buffer low water mark.
      • setServerWriteBufferLowWaterMark

        public ServerConfiguration setServerWriteBufferLowWaterMark​(int waterMark)
        Set server netty channel write buffer low water mark.
        Parameters:
        waterMark - netty channel write buffer low water mark.
        Returns:
        client configuration.
      • getServerWriteBufferHighWaterMark

        public int getServerWriteBufferHighWaterMark()
        Get server netty channel write buffer high water mark.
        Returns:
        netty channel write buffer high water mark.
      • setServerWriteBufferHighWaterMark

        public ServerConfiguration setServerWriteBufferHighWaterMark​(int waterMark)
        Set server netty channel write buffer high water mark.
        Parameters:
        waterMark - netty channel write buffer high water mark.
        Returns:
        client configuration.
      • setRegistrationManagerClass

        @Deprecated
        public void setRegistrationManagerClass​(java.lang.Class<? extends org.apache.bookkeeper.discover.RegistrationManager> regManagerClass)
        Deprecated.
        Set registration manager class.
        Parameters:
        regManagerClass - ManagerClass
      • getRegistrationManagerClass

        @Deprecated
        public java.lang.Class<? extends org.apache.bookkeeper.discover.RegistrationManager> getRegistrationManagerClass()
                                                                                                                  throws org.apache.commons.configuration.ConfigurationException
        Deprecated.
        since 4.7.0, in favor of using AbstractConfiguration.getMetadataServiceUri()
        Get Registration Manager Class.
        Returns:
        registration manager class.
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • isEntryLogPerLedgerEnabled

        public boolean isEntryLogPerLedgerEnabled()
      • setEntryLogPerLedgerEnabled

        public ServerConfiguration setEntryLogPerLedgerEnabled​(boolean entryLogPerLedgerEnabled)
      • getNumOfMemtableFlushThreads

        public int getNumOfMemtableFlushThreads()
      • setNumOfMemtableFlushThreads

        public ServerConfiguration setNumOfMemtableFlushThreads​(int numOfMemtableFlushThreads)
      • getEntrylogMapAccessExpiryTimeInSeconds

        public int getEntrylogMapAccessExpiryTimeInSeconds()
      • setEntrylogMapAccessExpiryTimeInSeconds

        public ServerConfiguration setEntrylogMapAccessExpiryTimeInSeconds​(int entrylogMapAccessExpiryTimeInSeconds)
      • getMaximumNumberOfActiveEntryLogs

        public int getMaximumNumberOfActiveEntryLogs()
      • setMaximumNumberOfActiveEntryLogs

        public ServerConfiguration setMaximumNumberOfActiveEntryLogs​(int maximumNumberOfActiveEntryLogs)
      • getEntryLogPerLedgerCounterLimitsMultFactor

        public int getEntryLogPerLedgerCounterLimitsMultFactor()
      • setEntryLogPerLedgerCounterLimitsMultFactor

        public ServerConfiguration setEntryLogPerLedgerCounterLimitsMultFactor​(int entryLogPerLedgerCounterLimitsMultFactor)
      • isLocalConsistencyCheckOnStartup

        public boolean isLocalConsistencyCheckOnStartup()
        True if a local consistency check should be performed on startup.
      • getAuthorizedRoles

        public java.lang.String[] getAuthorizedRoles()
        Get the authorized roles.
        Returns:
        String array of configured auth roles.
      • setAuthorizedRoles

        public ServerConfiguration setAuthorizedRoles​(java.lang.String roles)
        Set authorized roles.
        Returns:
        Configuration Object with roles set
      • getInFlightReadEntryNumInLedgerChecker

        public int getInFlightReadEntryNumInLedgerChecker()
        Get in flight read entry number when ledger checker. Default value is -1 which it is unlimited when ledger checker.
        Returns:
        read entry number of in flight.
      • setDataIntegrityCheckingEnabled

        public ServerConfiguration setDataIntegrityCheckingEnabled​(boolean enabled)
        Enabled data integrity checker. The data integrity checker checks that the bookie has all the entries which ledger metadata asserts it has. The checker runs on startup (periodic will be added later). The changes how cookies are handled. If a directory is found to be missing a cookie, the check runs. The check is divided into two parts, preboot and full. The preboot check ensures that it is safe to boot the bookie; the bookie will not vote in any operation that contradicts a previous vote. The full check ensures that any ledger that claims to have entries on the bookie, truly does have data on the bookie. Any missing entries are copies from available replicas.
      • setDataIntegrityStampMissingCookiesEnabled

        public ServerConfiguration setDataIntegrityStampMissingCookiesEnabled​(boolean enabled)
        When this config is set to true and the data integrity checker is also enabled then any missing cookie files in the ledger directories do not prevent the bookie from booting. Missing cookie files usually indicate an empty disk has been mounted, which might be after a disk failure (all data lost) or a provisioning error (wrong disk mounted). If there are missing cookie files then: - a new cookie is stamped (written to each ledger directory and to the co-ordination service, eg: zookeeper). - the data integrity checker will attempt to repair any lost data by sourcing the lost entries from other bookies If any cookies do not match the master cookie, then cookie validation still fails as normal.
      • getDefaultRocksDBConf

        public java.lang.String getDefaultRocksDBConf()
        Get default rocksdb conf.
        Returns:
        String configured default rocksdb conf.
      • setDefaultRocksDBConf

        public ServerConfiguration setDefaultRocksDBConf​(java.lang.String defaultRocksdbConf)
        Set default rocksdb conf.
        Returns:
        Configuration Object with default rocksdb conf
      • getEntryLocationRocksdbConf

        public java.lang.String getEntryLocationRocksdbConf()
        Get entry Location rocksdb conf.
        Returns:
        String configured entry Location rocksdb conf.
      • setEntryLocationRocksdbConf

        public ServerConfiguration setEntryLocationRocksdbConf​(java.lang.String entryLocationRocksdbConf)
        Set entry Location rocksdb conf.
        Returns:
        Configuration Object with entry Location rocksdb conf
      • getLedgerMetadataRocksdbConf

        public java.lang.String getLedgerMetadataRocksdbConf()
        Get ledger metadata rocksdb conf.
        Returns:
        String configured ledger metadata rocksdb conf.
      • setLedgerMetadataRocksdbConf

        public ServerConfiguration setLedgerMetadataRocksdbConf​(java.lang.String ledgerMetadataRocksdbConf)
        Set ledger metadata rocksdb conf.
        Returns:
        Configuration Object with ledger metadata rocksdb conf