Class ServerConfiguration
- All Implemented Interfaces:
Cloneable,org.apache.commons.configuration2.Configuration,org.apache.commons.configuration2.event.EventSource,org.apache.commons.configuration2.ImmutableConfiguration,org.apache.commons.configuration2.sync.SynchronizerSupport
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final intprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final ConfigKeyprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final ConfigKeyprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class org.apache.bookkeeper.conf.AbstractConfiguration
ALLOCATOR_EXIT_ON_OUT_OF_MEMORY, ALLOCATOR_LEAK_DETECTION_POLICY, ALLOCATOR_OOM_POLICY, ALLOCATOR_POOLING_CONCURRENCY, ALLOCATOR_POOLING_POLICY, ALLOW_SHADED_LEDGER_MANAGER_FACTORY_CLASS, AVAILABLE_NODE, DEFAULT_ENTRY_FORMATTER, DEFAULT_LEDGERID_FORMATTER, DEFAULT_LOADER, DEFAULT_NETTY_MAX_FRAME_SIZE, DESIRED_NUM_ZONES_PER_WRITE_QUORUM, ENABLE_BUSY_WAIT, ENABLE_HEALTH_CHECK, ENFORCE_MIN_NUM_FAULT_DOMAINS_FOR_WRITE, ENFORCE_MIN_NUM_RACKS_PER_WRITE_QUORUM, ENFORCE_STRICT_ZONEAWARE_PLACEMENT, ENTRY_FORMATTER_CLASS, IGNORE_LOCAL_NODE_IN_PLACEMENT_POLICY, LEDGER_MANAGER_FACTORY_CLASS, LEDGER_MANAGER_FACTORY_DISABLE_CLASS_CHECK, LEDGER_MANAGER_TYPE, LEDGER_METADATA_FORMAT_VERSION, LEDGERID_FORMATTER_CLASS, LIMIT_STATS_LOGGING, METADATA_SERVICE_URI, METASTORE_IMPL_CLASS, METASTORE_MAX_ENTRIES_PER_SCAN, MIN_NUM_RACKS_PER_WRITE_QUORUM, MIN_NUM_ZONES_PER_WRITE_QUORUM, NETTY_MAX_FRAME_SIZE, PERMITTED_STARTUP_USERS, PRESERVE_MDC_FOR_TASK_EXECUTION, READ_SYSTEM_PROPERTIES_PROPERTY, REPLICATION_RATE_BY_BYTES, REREPLICATION_ENTRY_BATCH_SIZE, SHADED_LEDGER_MANAGER_FACTORY_CLASS_PREFIX, STORE_SYSTEMTIME_AS_LEDGER_CREATION_TIME, STORE_SYSTEMTIME_AS_LEDGER_UNDERREPLICATED_MARK_TIME, TLS_CERT_FILES_REFRESH_DURATION_SECONDS, TLS_CERTIFICATE_PATH, TLS_CLIENT_AUTHENTICATION, TLS_ENABLED_CIPHER_SUITES, TLS_ENABLED_PROTOCOLS, TLS_KEYSTORE, TLS_KEYSTORE_PASSWORD_PATH, TLS_KEYSTORE_TYPE, TLS_PROVIDER, TLS_PROVIDER_FACTORY_CLASS, TLS_TRUSTSTORE, TLS_TRUSTSTORE_PASSWORD_PATH, TLS_TRUSTSTORE_TYPE, ZK_ENABLE_SECURITY, ZK_LEDGERS_ROOT_PATH, ZK_REPLICATION_TASK_RATE_LIMIT, ZK_REQUEST_RATE_LIMIT, ZK_RETRY_BACKOFF_MAX_RETRIES, ZK_SERVERS, ZK_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a default configuration object.Construct a configuration based on other configuration. -
Method Summary
Modifier and TypeMethodDescriptionGet the configured advertised address for the bookie.booleanIs the bookie allowed to use an ephemeral port (port 0) as its server port.booleanIs the bookie allowed to use a loopback interface as its primary interface(i.e.booleanReturn whether we should allow addition of ledger/index dirs to an existing bookie.intGet the acquire concurrent open ledger operations timeout.longGet what percentage of a ledger (fragment)'s entries will be verified.intGet the semaphore limit value of getting ledger from zookeeper in auto recovery.longGet the interval between auditor bookie check runs.longGet the regularity at which the auditor checks all ledgers.longGet the regularity at which the auditor does placement policy check of all ledgers, which are closed.longGet the interval at which the auditor does replicas check of all ledgers.String[]Get the authorized roles.Get the bookie authentication provider factory class name.Get the configured BookieId for the bookie.intGet bookie port that bookie server listen on.booleanConfigures action in case if server timed out sending response to the client.intGet the maximum number of entries which can be compacted without flushing.intDeprecated.intGet the rate of compaction adds.intGet the rate of compaction adds.intGet bookie death watch interval.Get default rocksdb conf.intGet the disk checker interval.floatReturns disk free space low water mark threshold.floatReturns disk free space threshold.floatReturns the warning threshold for disk usage.booleanWhether to enable recording task execution stats.longGet interval to run entry location compaction, in seconds.Get entry Location rocksdb conf.intintlongGet entry logger size limitation.String[]Get the extra list of server lifecycle components to enable on a bookie server.intGet the minimum total size for the internal file info cache tables.intGet fileinfo format version to write.longGet the max idle time allowed for a open file info existed in file info cache.intGet flush interval.longSet entry log flush interval in bytes.Get directory to persist Entrylog metadata if gcPersistentEntrylogMetadataMapEnabled is true.intGet the rate limit of metadata operations in garbage collection.intMax number of concurrent requests in garbage collection of overreplicated ledgers.longGet wait time in millis for garbage collection of overreplicated ledgers.longGet Garbage collection wait time.Get the http server host.Get the http server keyStore password.Get the http server keystore path.intGet the http server port.Get the http server trustStore password.Get the http server trustStore path.booleanReturn the flag whether to ignore startup failures on loading server components specified atgetExtraServerComponents().String[]Get dir name to store index files.File[]Get index dir to store ledger index files.intGet in flight read entry number when ledger checker.booleanGet whether force compaction is allowed when disk full or almost full.booleanGet whether use bytes to throttle garbage collector compaction or not.booleanShould we group journal force writes.intAll the journal writes and commits should be aligned to given size.longMaximum entries to buffer to impose on a journal write to achieve grouping.longMaximum bytes to buffer to impose on a journal write to achieve grouping.Deprecated.String[]Get dir names to store journal files.Get dir name to store journal files.File[]Get dirs to store journal files.booleanShould we flush the journal when queue is empty.intGet journal format version to write.longMaximum latency to impose on a journal write to achieve grouping.longGet the max amount of memory that can be used by the journal.longGet journal pageCache flush interval.intHow much space should we pre-allocate at a time in the journal.intGet size of journal queue.booleanShould we remove pages from page cache after force write.booleanGet reuse journal files.booleanShould the data be fsynced on journal before acknowledgment.intSize of the write buffers used for the journal.booleanShould the data be written to journal before acknowledgment.String[]Get dir names to store ledger data.File[]Get dirs that stores ledger data.String[]Get dir names to store ledger data.Get ledger metadata rocksdb conf.Get the network interface that the bookie should listen for connections on.longGet local scrub interval.doubleGet local scrub rate limit (entries/second).longGet the grace period, in milliseconds, which the replication worker has to wait before releasing the lock after it failed to replicate a ledger.intGet how long to delay the recovery of ledgers of a lost bookie.longGet interval to run major compaction, in seconds.longGet the maximum milliseconds to run major compaction.doubleGet threshold of major compaction.intGet max number of adds in progress.intMax number of older journal files kept.longGet the max batch read size.intlongMax journal file size.intGet the max operation numbers in a single rocksdb write batch.intIf add workers threads are enabled, limit the number of pending requests, to avoid the executor queue to grow indefinitely (default: 10000 entries).intIf read workers threads are enabled, limit the number of pending requests, to avoid the executor queue to grow indefinitely (default: 10000 entries).intGet max number of reads in progress.longGet interval to run minor compaction, in seconds.longGet the maximum milliseconds to run minor compaction.doubleGet threshold of minor compaction.longGets the minimum safe usable size to be available in ledger directory for Bookie to create entry log files.longGets the minimum safe usable size to be available in ledger directory for Bookie to accept high priority writes.longGets 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).intGet the number of threads that should handle write requests.intGet the number of threads that should be used for high priority requests (i.e.intDeprecated.intGet the number of threads that should handle long poll requests.intintGet the number of threads that should handle read requests.intGet open file limit.longGet 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.intGet limitation number of index pages in ledger cache.intGet page size.intGet the number of bytes we should use as capacity for org.apache.bookkeeper.bookie.BufferedReadChannel.intGet Recv ByteBuf allocator initial buf size.intGet Recv ByteBuf allocator max buf size.intGet Recv ByteBuf allocator min buf size.Class<? extends RegistrationManager>Deprecated.since 4.7.0, in favor of usingAbstractConfiguration.getMetadataServiceUri()intGet the number of ticks per wheel for the request timer.intGet the tick duration in milliseconds.intGet how long to backoff when encountering exception on rereplicating a ledger.intGet the number of Acceptor threads.intGet the number of IO threads.booleanGet socket keepalive.intTimeout to drain the socket on close.booleanIs tcp connection no delay.intGet server netty channel write buffer high water mark.intGet server netty channel write buffer low water mark.intGet the number of bytes we should use as chunk allocation for org.apache.bookkeeper.bookie.SkipListArena.intGet the max size we should allocate from the skiplist arena.longGet skip list data size limitation (default 64MB).booleanCheck if sorted-ledger storage enabled (default true).Class<? extends StatsProvider>Get the stats provider used by bookie.protected ServerConfigurationgetThis()Trickery to allow inheritance with fluent style.Get the path to file containing TLS Certificate.Get the keystore path for the client.Get the path to file containing keystore password if the client keystore is password protected.Get the keystore type for client.Get the truststore path for the client.Get the path to file containing truststore password if the client truststore is password protected.Get the truststore type for client.longGets the grace period (in seconds) for underreplicated ledgers recovery.booleanGet whether bookie is using hostname for registration and in ledger metadata.booleanIf bookie is using hostname for registration and in ledger metadata then whether to use short hostname or FQDN hostname.booleanGet whether to use transactional compaction and using a separate log for compaction or not.booleanGet whether the bookie is configured to double check prior to gc.longTimeout controlling wait on response send in case of unresponsive client (i.e.intGet the number of bytes used as capacity for the write buffer.intGet zookeeper client backoff retry max time in millis.intGet zookeeper client backoff retry start time in millis.booleanreturns whether it is allowed to have multiple ledger/index/journal Directories in the same filesystem diskpartition.booleanGet whether the Bookie itself can start auto-recovery service also or not.booleanbooleanbooleanGet whether to disable bind of server-side sockets.booleanGet whether to listen for local JVM clients.booleanIs entry log file preallocation enabled.booleanbooleanThe force compaction is allowed or not when disabling the entry log compaction.booleanGet whether the Bookie is force started in read only mode or not.booleanGet whether the bookie is configured to use persistent entrylogMetadataMap.booleanGet whether to start the http server or not.booleanGet if Http Server Tls enable.booleanTrue if a local consistency check should be performed on startup.booleanGet whether local scrub is enabled.booleanGet whether to persist the bookie status so that when bookie server restarts, it will continue using the previous status.booleanGet whether read-only mode is enabled.booleanGet whether read-only mode is enable when any disk is full.booleanGet the auto-throttling status of the read-worker threads.booleanNow the feature only support RackawareEnsemblePlacementPolicy.booleanFlag to enable sanity check metrics in bookie stats.booleanbooleanIs statistics enabled.booleanRemove the configured BookieId for the bookie.setAdvertisedAddress(String advertisedAddress) Configure the bookie to advertise a specific address.setAllowEphemeralPorts(boolean allow) Configure the bookie to allow using an ephemeral port.setAllowLoopback(boolean allow) Configure the bookie to allow loopback interfaces to be used as the primary bookie interface.setAllowMultipleDirsUnderSameDiskPartition(boolean allow) Configure the Bookie to allow/disallow multiple ledger/index/journal directories in the same filesystem diskpartition.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.voidsetAuditorAcquireConcurrentOpenLedgerOperationsTimeoutMSec(int timeoutMs) Set the acquire concurrent open ledger operations timeout.setAuditorLedgerVerificationPercentage(long auditorLedgerVerificationPercentage) Set what percentage of a ledger (fragment)'s entries will be verified.voidsetAuditorMaxNumberOfConcurrentOpenLedgerOperations(int semaphore) Set the semaphore limit value for getting ledger from zookeeper in auto recovery.voidsetAuditorPeriodicBookieCheckInterval(long interval) Set the interval between auditor bookie checks.voidsetAuditorPeriodicCheckInterval(long interval) Set the regularity at which the auditor will run a check of all ledgers.voidsetAuditorPeriodicPlacementPolicyCheckInterval(long interval) Sets the regularity/interval at which the auditor will run a placement policy check of all ledgers, which are closed.voidsetAuditorPeriodicReplicasCheckInterval(long interval) Sets the interval at which the auditor will run a replicas check of all ledgers.setAuthorizedRoles(String roles) Set authorized roles.setAutoRecoveryDaemonEnabled(boolean enabled) Sets that whether the auto-recovery service can start along with Bookie server itself or not.voidsetBookieAuthProviderFactoryClass(String factoryClass) Set the bookie authentication provider factory class name.setBookieId(String bookieId) Configure the bookie to advertise a specific BookieId.setBookiePort(int port) Set new bookie port that bookie server listen on.setCloseChannelOnResponseTimeout(boolean value) Configures action in case if server timed out sending response to the client.setCompactionMaxOutstandingRequests(int maxOutstandingRequests) Set the maximum number of entries which can be compacted without flushing.setCompactionRate(int rate) Set the rate of compaction adds.setCompactionRateByBytes(int rate) Set the rate of compaction adds.setCompactionRateByEntries(int rate) Set the rate of compaction adds.setDataIntegrityCheckingEnabled(boolean enabled) Enabled data integrity checker.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.setDefaultRocksDBConf(String defaultRocksdbConf) Set default rocksdb conf.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.setDiskCheckInterval(int interval) Set the disk checker interval to monitor ledger disk space.setDiskLowWaterMarkUsageThreshold(float threshold) Set the disk free space low water mark threshold.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.setDiskUsageWarnThreshold(float threshold) Set the warning threshold for disk usage.setEnableLocalTransport(boolean enableLocalTransport) Configure the bookie to listen for BookKeeper clients executed on the local JVM.setEnableTaskExecutionStats(boolean enabled) Enable/Disable recording task execution stats.setEntryLocationCompactionInterval(long interval) Set interval to run entry location compaction.setEntryLocationRocksdbConf(String entryLocationRocksdbConf) Set entry Location rocksdb conf.setEntryLogFilePreAllocationEnabled(boolean enabled) Enable/disable entry log file preallocation.setEntrylogMapAccessExpiryTimeInSeconds(int entrylogMapAccessExpiryTimeInSeconds) setEntryLogPerLedgerCounterLimitsMultFactor(int entryLogPerLedgerCounterLimitsMultFactor) setEntryLogPerLedgerEnabled(boolean entryLogPerLedgerEnabled) setEntryLogSizeLimit(long logSizeLimit) Set entry logger size limitation.setExtraServerComponents(String[] componentClasses) Set the extra list of server lifecycle components to enable on a bookie server.setFileInfoCacheInitialCapacity(int initialCapacity) Set the minimum total size for the internal file info cache tables for initialization.setFileInfoFormatVersionToWrite(int version) Set fileinfo format version to write.setFileInfoMaxIdleTime(long idleTime) Set the max idle time allowed for a open file info existed in file info cache.setFlushInterval(int flushInterval) Set flush interval.setFlushIntervalInBytes(long flushInterval) Set entry log flush interval in bytes.setForceAllowCompaction(boolean enable) Allow manually force compact the entry log or not.setForceReadOnlyBookie(boolean enabled) Sets that whether force start a bookie in readonly mode.setGcEntryLogMetadataCacheEnabled(boolean gcEntryLogMetadataCacheEnabled) Set whether the bookie is configured to use persistent entrylogMetadataMap.setGcEntryLogMetadataCachePath(String gcEntrylogMetadataCachePath) Set directory to persist Entrylog metadata if gcPersistentEntrylogMetadataMapEnabled is true.setGcMetadataOpRateLimit(int gcRateLimit) Set the rate limit of metadata operations in garbage collection.setGcOverreplicatedLedgerMaxConcurrentRequests(int gcOverreplicatedLedgerMaxConcurrentRequests) Max number of concurrent requests in garbage collection of overreplicated ledgers.setGcOverreplicatedLedgerWaitTime(long gcWaitTime, TimeUnit unit) Set wait time for garbage collection of overreplicated ledgers.setGcWaitTime(long gcWaitTime) Set garbage collection wait time.setHttpServerEnabled(boolean enabled) Set whether to start the http server or not.setHttpServerHost(String host) Set Http server host listening on.setHttpServerKeyStorePassword(String keyStorePassword) Set Http server keyStore password.setHttpServerKeystorePath(String keystorePath) Set Http server keystore path.setHttpServerPort(int port) Set Http server port listening on.setHttpServerTlsEnable(boolean tlsEnable) Set if Http Server Tls enable.setHttpServerTrustStorePasswordPassword(String trustStorePassword) Set Http server trustStore password.setHttpServerTrustStorePath(String trustStorePath) Set Http server trustStore path.setIgnoreExtraServerComponentsStartupFailures(boolean enabled) Set the flag whether to ignore startup failures on loading server components specified atgetExtraServerComponents().setIndexDirName(String[] indexDirs) Set dir name to store index files.setIsForceGCAllowWhenNoSpace(boolean force) Set whether force GC is allowed when disk full or almost full.setIsThrottleByBytes(boolean byBytes) Set whether use bytes to throttle garbage collector compaction or not.setJournalAdaptiveGroupWrites(boolean enabled) Enable/disable group journal force writes.setJournalAlignmentSize(int size) Set journal alignment size.setJournalBufferedEntriesThreshold(int maxEntries) Set maximum entries to buffer to impose on a journal write to achieve grouping.setJournalBufferedWritesThreshold(long maxBytes) Set maximum bytes to buffer to impose on a journal write to achieve grouping.setJournalChannelProvider(String journalChannelProvider) Set JournalChannelProvider classname.setJournalDirName(String journalDir) Set dir name to store journal files.setJournalDirsName(String[] journalDirs) Set dir names to store journal files.setJournalFlushWhenQueueEmpty(boolean enabled) Set if we should flush the journal when queue is empty.setJournalFormatVersionToWrite(int version) Set journal format version to write.setJournalMaxGroupWaitMSec(long journalMaxGroupWaitMSec) Sets the maximum latency to impose on a journal write to achieve grouping.setJournalMaxMemorySizeMb(long journalMaxMemorySizeMb) Set the max amount of memory that can be used by the journal.setJournalPageCacheFlushIntervalMSec(long journalPageCacheFlushIntervalMSec) Set PageCache flush interval in second.setJournalQueueSize(int journalQueueSize) Set the size of the journal queue.setJournalRemovePagesFromCache(boolean enabled) Sets that whether should we remove pages from page cache after force write.setJournalReuseFiles(boolean journalReuseFiles) Set reuse journal files.setJournalSyncData(boolean syncData) Enable or disable journal syncs.setJournalWriteBufferSizeKB(int bufferSizeKB) Set the size of the write buffers used for the journal.setJournalWriteData(boolean journalWriteData) Should the data be written to journal before acknowledgment.setLedgerDirNames(String[] ledgerDirs) Set dir names to store ledger data.setLedgerMetadataRocksdbConf(String ledgerMetadataRocksdbConf) Set ledger metadata rocksdb conf.setLedgerStorageClass(String ledgerStorageClass) Set theLedgerStorageimplementation class name.setListeningInterface(String iface) Set the network interface that the bookie should listen on.voidsetLocalScrubPeriod(long period) Set local scrub period in seconds (<=0 for disabled).voidsetLocalScrubRateLimit(double scrubRateLimit) Get local scrub rate limit (entries/second).voidSet the grace period, in milliseconds, which the replication worker has to wait before releasing the lock after it failed to replicate a ledger.voidsetLostBookieRecoveryDelay(int interval) Set the delay interval for starting recovery of a lost bookie.setMajorCompactionInterval(long interval) Set interval to run major compaction.setMajorCompactionMaxTimeMillis(long majorCompactionMaxTimeMillis) Set the maximum milliseconds to run major compaction.setMajorCompactionThreshold(double threshold) Set threshold of major compaction.setMaxAddsInProgressLimit(int value) Set max number of adds in progress.setMaxBackupJournals(int maxBackupJournals) Set max number of older journal files to kept.setMaxBatchReadSize(long maxBatchReadSize) Set the max batch read size.setMaximumNumberOfActiveEntryLogs(int maximumNumberOfActiveEntryLogs) setMaxJournalSizeMB(long maxJournalSize) Set new max journal file size.setMaxPendingAddRequestPerThread(int maxPendingAddRequestsPerThread) Set the max number of pending add requests for each add worker thread.setMaxPendingReadRequestPerThread(int maxPendingReadRequestsPerThread) Set the max number of pending read requests for each read worker thread.setMaxReadsInProgressLimit(int value) Set max number of reads in progress.setMinorCompactionInterval(long interval) Set interval to run minor compaction.setMinorCompactionMaxTimeMillis(long minorCompactionMaxTimeMillis) Set the maximum milliseconds to run minor compaction.setMinorCompactionThreshold(double threshold) Set threshold of minor compaction.setMinUsableSizeForEntryLogCreation(long minUsableSizeForEntryLogCreation) Sets the minimum safe usable size to be available in ledger directory for Bookie to create entry log files.setMinUsableSizeForHighPriorityWrites(long minUsableSizeForHighPriorityWrites) Sets the minimum safe usable size to be available in ledger directory for Bookie to accept high priority writes.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).setNettyMaxFrameSizeBytes(int maxSize) Set the max number of bytes a single message can be that is read by the bookie.setNumAddWorkerThreads(int numThreads) Set the number of threads that would handle write requests.setNumHighPriorityWorkerThreads(int numThreads) Set the number of threads that should be used for high priority requests (i.e.setNumJournalCallbackThreads(int numThreads) Deprecated.setNumLongPollWorkerThreads(int numThreads) Set the number of threads that should handle long poll requests.setNumOfMemtableFlushThreads(int numOfMemtableFlushThreads) setNumReadWorkerThreads(int numThreads) Set the number of threads that would handle read requests.setOpenFileLimit(int fileLimit) Set limitation of number of open files.voidsetOpenLedgerRereplicationGracePeriod(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.setOperationMaxNumbersInSingleRocksDBWriteBatch(int maxNumbersInSingleRocksDBBatch) Set the max operation numbers in a single rocksdb write batch.setPageLimit(int pageLimit) Set limitation number of index pages in ledger cache.setPageSize(int pageSize) Set page size.setPersistBookieStatusEnabled(boolean enabled) Whether to persist the bookie status so that when bookie server restarts, it will continue using the previous status.setReadBufferBytes(int readBufferSize) Set the number of bytes we should use as capacity for org.apache.bookkeeper.bookie.BufferedReadChannel.setReadOnlyModeEnabled(boolean enabled) Set whether the bookie is able to go into read-only mode.setReadOnlyModeOnAnyDiskFullEnabled(boolean enabled) Set whether the bookie is able to go into read-only mode when any disk is full.setReadWorkerThreadsThrottlingEnabled(boolean throttle) Use auto-throttling of the read-worker threads.voidsetRecvByteBufAllocatorSizeInitial(int size) Set Recv ByteBuf allocator initial buf size.voidsetRecvByteBufAllocatorSizeMax(int size) Set Recv ByteBuf allocator max buf size.voidsetRecvByteBufAllocatorSizeMin(int size) Set Recv ByteBuf allocator min buf size.voidsetRegistrationManagerClass(Class<? extends RegistrationManager> regManagerClass) Deprecated.since 4.7.0, in favor of usingAbstractConfiguration.setMetadataServiceUri(String)voidsetRepairedPlacementPolicyNotAdheringBookieEnable(boolean enabled) setRequestTimerNumTicks(int tickCount) Set the number of ticks per wheel for the request timer.setRequestTimerTickDurationMs(int tickDuration) Set the tick duration in milliseconds.voidsetRwRereplicateBackoffMs(int backoffMs) Set how long to backoff when encountering exception on rereplicating a ledger.setSanityCheckMetricsEnabled(boolean sanityCheckMetricsEnabled) Enable sanity check metrics in bookie stats.setServerNumIOThreads(int numThreads) Set the number of IO threads.setServerSockKeepalive(boolean keepalive) Set socket keepalive setting.setServerSockLinger(int linger) Set socket linger timeout on close.setServerTcpNoDelay(boolean noDelay) Set socket nodelay setting.setServerWriteBufferHighWaterMark(int waterMark) Set server netty channel write buffer high water mark.setServerWriteBufferLowWaterMark(int waterMark) Set server netty channel write buffer low water mark.setSkipListArenaChunkSize(int size) Set the number of bytes we used as chunk allocation for org.apache.bookkeeper.bookie.SkipListArena.setSkipListArenaMaxAllocSize(int size) Set the max size we should allocate from the skiplist arena.setSkipListSizeLimit(int size) Set skip list size limit.setSkipReplayJournalInvalidRecord(boolean skipReplayJournalInvalidRecord) When this config is set to true,if we replay journal failed, we will skip.setSortedLedgerStorageEnabled(boolean enabled) Deprecated.UsesetLedgerStorageClass(String)to configure the implementation classsetStatisticsEnabled(boolean enabled) Turn on/off statistics.setStatsProviderClass(Class<? extends StatsProvider> providerClass) Set the stats provider used by bookie.Set the path to file containing TLS Certificate.setTLSKeyStore(String arg) Set the keystore path for the client.Set the path to file containing keystore password, if the client keystore is password protected.setTLSKeyStoreType(String arg) Set the keystore type for client.setTLSTrustStore(String arg) Set the truststore path for the client.Set the path to file containing truststore password, if the client truststore is password protected.Set the truststore type for client.voidsetUnderreplicatedLedgerRecoveryGracePeriod(long gracePeriod) Sets the grace period (in seconds) for underreplicated ledgers recovery.setUseHostNameAsBookieID(boolean useHostName) Configure the bookie to use its hostname to register with the co-ordination service(eg: zookeeper) and in ledger metadata.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.setUseTargetEntryLogSizeForGc(boolean useTargetEntryLogSizeForGc) setUseTransactionalCompaction(boolean useTransactionalCompaction) Set whether to use transactional compaction and using a separate log for compaction or not.setVerifyMetadataOnGc(boolean verifyMetadataOnGC) Set whether the bookie is configured to double check prior to gc.setWaitTimeoutOnResponseBackpressureMillis(long value) Timeout controlling wait on response send in case of unresponsive client (i.e.setWriteBufferBytes(int writeBufferBytes) Set the number of bytes used as capacity for the write buffer.setZkRetryBackoffMaxMs(int retryMs) Set zookeeper client backoff retry max time in millis.setZkRetryBackoffStartMs(int retryMs) Set zookeeper client backoff retry start time in millis.voidvalidate()Validate the configuration.Methods inherited from class org.apache.bookkeeper.conf.AbstractConfiguration
asJson, exitOnOutOfMemory, getAllocatorLeakDetectionPolicy, getAllocatorOutOfMemoryPolicy, getAllocatorPoolingConcurrency, getAllocatorPoolingPolicy, getClientAuthProviderFactoryClass, getDesiredNumZonesPerWriteQuorum, getEnforceMinNumFaultDomainsForWrite, getEnforceMinNumRacksPerWriteQuorum, getEnforceStrictZoneawarePlacement, getEntryFormatterClass, getFeature, getIgnoreLocalNodeInPlacementPolicy, getLedgerIdFormatterClass, getLedgerManagerFactoryClass, getLedgerManagerFactoryClassName, getLedgerManagerLayoutStringFromFactoryClass, getLedgerManagerType, getLedgerMetadataFormatVersion, getLimitStatsLogging, getMetadataServiceUri, getMetadataServiceUriUnchecked, getMetastoreImplClass, getMetastoreMaxEntriesPerScan, getMinNumRacksPerWriteQuorum, getMinNumZonesPerWriteQuorum, getNettyMaxFrameSizeBytes, getPermittedStartupUsers, getPreserveMdcForTaskExecution, getReplicationRateByBytes, getRereplicationEntryBatchSize, getShadedLedgerManagerFactoryClassPrefix, getStoreSystemTimeAsLedgerUnderreplicatedMarkTime, getTLSCertFilesRefreshDurationSeconds, getTLSClientAuthentication, getTLSEnabledCipherSuites, getTLSEnabledProtocols, getTLSProvider, getTLSProviderFactoryClass, getZkAvailableBookiesPath, getZkLedgersRootPath, getZkReplicationTaskRateLimit, getZkRequestRateLimit, getZkRetryBackoffMaxRetries, getZkServers, getZkTimeout, isBusyWaitEnabled, isShadedLedgerManagerFactoryClassAllowed, isZkEnableSecurity, loadConf, loadConf, setAllocatorLeakDetectionPolicy, setAllocatorOutOfMemoryPolicy, setAllocatorPoolingConcurrency, setAllocatorPoolingPolicy, setAllowShadedLedgerManagerFactoryClass, setBusyWaitEnabled, setClientAuthProviderFactoryClass, setDesiredNumZonesPerWriteQuorum, setEnforceMinNumFaultDomainsForWrite, setEnforceMinNumRacksPerWriteQuorum, setEnforceStrictZoneawarePlacement, setEntryFormatterClass, setExitOnOutOfMemory, setFeature, setIgnoreLocalNodeInPlacementPolicy, setLedgerIdFormatterClass, setLedgerManagerFactoryClass, setLedgerManagerFactoryClassName, setLedgerManagerType, setLedgerMetadataFormatVersion, setLimitStatsLogging, setMetadataServiceUri, setMetastoreImplClass, setMetastoreMaxEntriesPerScan, setMinNumRacksPerWriteQuorum, setMinNumZonesPerWriteQuorum, setPermittedStartupUsers, setPreserveMdcForTaskExecution, setReplicationRateByBytes, setRereplicationEntryBatchSize, setShadedLedgerManagerFactoryClassPrefix, setStoreSystemTimeAsLedgerUnderreplicatedMarkTime, setTLSCertFilesRefreshDurationSeconds, setTLSClientAuthentication, setTLSEnabledCipherSuites, setTLSEnabledProtocols, setTLSProvider, setTLSProviderFactoryClass, setZkEnableSecurity, setZkLedgersRootPath, setZkReplicationTaskRateLimit, setZkRequestRateLimit, setZkRetryBackoffMaxRetries, setZkServers, setZkTimeoutMethods inherited from class org.apache.commons.configuration2.CompositeConfiguration
addConfiguration, addConfiguration, addConfigurationFirst, addConfigurationFirst, addPropertyDirect, clearInternal, clearPropertyDirect, clone, containsKeyInternal, containsValueInternal, getConfiguration, getInMemoryConfiguration, getKeysInternal, getKeysInternal, getKeysInternal, getList, getNumberOfConfigurations, getPropertyInternal, getSource, getStringArray, isEmptyInternal, removeConfiguration, setListDelimiterHandlerMethods inherited from class org.apache.commons.configuration2.AbstractConfiguration
addErrorLogListener, addProperty, addPropertyInternal, append, beginRead, beginWrite, clear, clearProperty, cloneInterpolator, contains, containsKey, containsValue, copy, endRead, endWrite, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getConfigurationDecoder, getConversionHandler, getDouble, getDouble, getDouble, getDuration, getDuration, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getKeys, getKeys, getList, getList, getList, getListDelimiterHandler, getLogger, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getSynchronizer, immutableSubset, initLogger, installInterpolator, interpolate, interpolate, interpolatedConfiguration, isEmpty, isScalarValue, isThrowExceptionOnMissing, lock, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setLogger, setParentInterpolator, setPrefixLookups, setProperty, setPropertyInternal, setSynchronizer, setThrowExceptionOnMissing, size, sizeInternal, subset, unlockMethods inherited from class org.apache.commons.configuration2.event.BaseEventSource
addEventListener, clearErrorListeners, clearEventListeners, copyEventListeners, createErrorEvent, createEvent, fireError, fireEvent, getEventListenerRegistrations, getEventListeners, isDetailEvents, removeEventListener, setDetailEventsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.configuration2.ImmutableConfiguration
getEnum, getEnum
-
Field Details
-
LEDGER_STORAGE_CLASS
- See Also:
-
LEDGER_STORAGE_CLASS_KEY
-
ENTRY_LOG_SIZE_LIMIT
- See Also:
-
ENTRY_LOG_SIZE_LIMIT_KEY
-
ENTRY_LOG_FILE_PREALLOCATION_ENABLED
- See Also:
-
FORCE_ALLOW_COMPACTION
- See Also:
-
MINOR_COMPACTION_INTERVAL
- See Also:
-
MINOR_COMPACTION_THRESHOLD
- See Also:
-
MINOR_COMPACTION_MAX_TIME_MILLIS
- See Also:
-
MAJOR_COMPACTION_INTERVAL
- See Also:
-
MAJOR_COMPACTION_THRESHOLD
- See Also:
-
MAJOR_COMPACTION_MAX_TIME_MILLIS
- See Also:
-
IS_THROTTLE_BY_BYTES
- See Also:
-
COMPACTION_MAX_OUTSTANDING_REQUESTS
- See Also:
-
COMPACTION_RATE
- See Also:
-
COMPACTION_RATE_BY_ENTRIES
- See Also:
-
COMPACTION_RATE_BY_BYTES
- See Also:
-
ENTRY_LOCATION_COMPACTION_INTERVAL
- See Also:
-
GC_WAIT_TIME
- See Also:
-
IS_FORCE_GC_ALLOW_WHEN_NO_SPACE
- See Also:
-
GC_OVERREPLICATED_LEDGER_WAIT_TIME
- See Also:
-
GC_OVERREPLICATED_LEDGER_MAX_CONCURRENT_REQUESTS
- See Also:
-
GC_METADATA_OP_RATE_LIMIT
- See Also:
-
USE_TRANSACTIONAL_COMPACTION
- See Also:
-
VERIFY_METADATA_ON_GC
- See Also:
-
GC_ENTRYLOGMETADATA_CACHE_ENABLED
- See Also:
-
GC_ENTRYLOG_METADATA_CACHE_PATH
- See Also:
-
USE_TARGET_ENTRYLOG_SIZE_FOR_GC
- See Also:
-
LOCAL_SCRUB_PERIOD
- See Also:
-
LOCAL_SCRUB_RATE_LIMIT
- See Also:
-
FLUSH_INTERVAL
- See Also:
-
FLUSH_ENTRYLOG_INTERVAL_BYTES
- See Also:
-
DEATH_WATCH_INTERVAL
- See Also:
-
OPEN_FILE_LIMIT
- See Also:
-
PAGE_LIMIT
- See Also:
-
PAGE_SIZE
- See Also:
-
FILEINFO_CACHE_INITIAL_CAPACITY
- See Also:
-
FILEINFO_MAX_IDLE_TIME
- See Also:
-
FILEINFO_FORMAT_VERSION_TO_WRITE
- See Also:
-
MAX_JOURNAL_SIZE
- See Also:
-
MAX_BACKUP_JOURNALS
- See Also:
-
JOURNAL_SYNC_DATA
- See Also:
-
JOURNAL_WRITE_DATA
- See Also:
-
JOURNAL_ADAPTIVE_GROUP_WRITES
- See Also:
-
JOURNAL_MAX_GROUP_WAIT_MSEC
- See Also:
-
JOURNAL_BUFFERED_WRITES_THRESHOLD
- See Also:
-
JOURNAL_BUFFERED_ENTRIES_THRESHOLD
- See Also:
-
JOURNAL_FLUSH_WHEN_QUEUE_EMPTY
- See Also:
-
JOURNAL_REMOVE_FROM_PAGE_CACHE
- See Also:
-
JOURNAL_PRE_ALLOC_SIZE
- See Also:
-
JOURNAL_WRITE_BUFFER_SIZE
- See Also:
-
JOURNAL_ALIGNMENT_SIZE
- See Also:
-
NUM_JOURNAL_CALLBACK_THREADS
- See Also:
-
JOURNAL_FORMAT_VERSION_TO_WRITE
- See Also:
-
JOURNAL_QUEUE_SIZE
- See Also:
-
JOURNAL_MAX_MEMORY_SIZE_MB
- See Also:
-
JOURNAL_PAGECACHE_FLUSH_INTERVAL_MSEC
- See Also:
-
JOURNAL_CHANNEL_PROVIDER
- See Also:
-
JOURNAL_REUSE_FILES
- See Also:
-
MAX_ADDS_IN_PROGRESS_LIMIT
- See Also:
-
MAX_READS_IN_PROGRESS_LIMIT
- See Also:
-
CLOSE_CHANNEL_ON_RESPONSE_TIMEOUT
- See Also:
-
WAIT_TIMEOUT_ON_RESPONSE_BACKPRESSURE
- See Also:
-
BOOKIE_PORT
- See Also:
-
LISTENING_INTERFACE
- See Also:
-
ALLOW_LOOPBACK
- See Also:
-
ADVERTISED_ADDRESS
- See Also:
-
BOOKIE_ID
- See Also:
-
ALLOW_EPHEMERAL_PORTS
- See Also:
-
JOURNAL_DIR
- See Also:
-
JOURNAL_DIRS
- See Also:
-
LEDGER_DIRS
- See Also:
-
INDEX_DIRS
- See Also:
-
ALLOW_STORAGE_EXPANSION
- See Also:
-
SERVER_TCP_NODELAY
- See Also:
-
SERVER_SOCK_KEEPALIVE
- See Also:
-
SERVER_SOCK_LINGER
- See Also:
-
SERVER_WRITEBUFFER_LOW_WATER_MARK
- See Also:
-
SERVER_WRITEBUFFER_HIGH_WATER_MARK
- See Also:
-
SERVER_NUM_ACCEPTOR_THREADS
- See Also:
-
SERVER_NUM_IO_THREADS
- See Also:
-
ZK_RETRY_BACKOFF_START_MS
- See Also:
-
ZK_RETRY_BACKOFF_MAX_MS
- See Also:
-
OPEN_LEDGER_REREPLICATION_GRACE_PERIOD
- See Also:
-
LOCK_RELEASE_OF_FAILED_LEDGER_GRACE_PERIOD
- See Also:
-
READ_ONLY_MODE_ENABLED
- See Also:
-
READ_ONLY_MODE_ON_ANY_DISK_FULL_ENABLED
- See Also:
-
FORCE_READ_ONLY_BOOKIE
- See Also:
-
PERSIST_BOOKIE_STATUS_ENABLED
- See Also:
-
DISK_USAGE_THRESHOLD
- See Also:
-
DISK_USAGE_WARN_THRESHOLD
- See Also:
-
DISK_USAGE_LWM_THRESHOLD
- See Also:
-
DISK_CHECK_INTERVAL
- See Also:
-
AUDITOR_PERIODIC_CHECK_INTERVAL
- See Also:
-
AUDITOR_PERIODIC_BOOKIE_CHECK_INTERVAL
- See Also:
-
AUDITOR_PERIODIC_PLACEMENT_POLICY_CHECK_INTERVAL
- See Also:
-
REPAIRED_PLACEMENT_POLICY_NOT_ADHERING_BOOKIE_ENABLED
- See Also:
-
AUDITOR_LEDGER_VERIFICATION_PERCENTAGE
- See Also:
-
AUTO_RECOVERY_DAEMON_ENABLED
- See Also:
-
LOST_BOOKIE_RECOVERY_DELAY
- See Also:
-
RW_REREPLICATE_BACKOFF_MS
- See Also:
-
UNDERREPLICATED_LEDGER_RECOVERY_GRACE_PERIOD
- See Also:
-
AUDITOR_REPLICAS_CHECK_INTERVAL
- See Also:
-
AUDITOR_MAX_NUMBER_OF_CONCURRENT_OPEN_LEDGER_OPERATIONS
- See Also:
-
AUDITOR_ACQUIRE_CONCURRENT_OPEN_LEDGER_OPERATIONS_TIMEOUT_MSEC
- See Also:
-
IN_FLIGHT_READ_ENTRY_NUM_IN_LEDGER_CHECKER
- See Also:
-
NUM_ADD_WORKER_THREADS
- See Also:
-
NUM_READ_WORKER_THREADS
- See Also:
-
MAX_PENDING_READ_REQUESTS_PER_THREAD
- See Also:
-
MAX_PENDING_ADD_REQUESTS_PER_THREAD
- See Also:
-
NUM_LONG_POLL_WORKER_THREADS
- See Also:
-
NUM_HIGH_PRIORITY_WORKER_THREADS
- See Also:
-
READ_WORKER_THREADS_THROTTLING_ENABLED
- See Also:
-
REQUEST_TIMER_TICK_DURATION_MILLISEC
- See Also:
-
REQUEST_TIMER_NO_OF_TICKS
- See Also:
-
READ_BUFFER_SIZE
- See Also:
-
WRITE_BUFFER_SIZE
- See Also:
-
USE_HOST_NAME_AS_BOOKIE_ID
- See Also:
-
USE_SHORT_HOST_NAME
- See Also:
-
ENABLE_LOCAL_TRANSPORT
- See Also:
-
DISABLE_SERVER_SOCKET_BIND
- See Also:
-
SORTED_LEDGER_STORAGE_ENABLED
- See Also:
-
SKIP_LIST_SIZE_LIMIT
- See Also:
-
SKIP_LIST_CHUNK_SIZE_ENTRY
- See Also:
-
SKIP_LIST_MAX_ALLOC_ENTRY
- See Also:
-
ENABLE_STATISTICS
- See Also:
-
STATS_PROVIDER_CLASS
- See Also:
-
SANITY_CHECK_METRICS_ENABLED
- See Also:
-
BYTEBUF_ALLOCATOR_SIZE_INITIAL
- See Also:
-
BYTEBUF_ALLOCATOR_SIZE_MIN
- See Also:
-
BYTEBUF_ALLOCATOR_SIZE_MAX
- See Also:
-
BOOKIE_AUTH_PROVIDER_FACTORY_CLASS
- See Also:
-
MIN_USABLESIZE_FOR_INDEXFILE_CREATION
- See Also:
-
MIN_USABLESIZE_FOR_ENTRYLOG_CREATION
- See Also:
-
MIN_USABLESIZE_FOR_HIGH_PRIORITY_WRITES
- See Also:
-
ALLOW_MULTIPLEDIRS_UNDER_SAME_DISKPARTITION
- See Also:
-
HTTP_SERVER_ENABLED
- See Also:
-
HTTP_SERVER_PORT
- See Also:
-
HTTP_SERVER_HOST
- See Also:
-
HTTP_SERVER_TLS_ENABLE
- See Also:
-
HTTP_SERVER_KEY_STORE_PATH
- See Also:
-
HTTP_SERVER_KEY_STORE_PASSWORD
- See Also:
-
HTTP_SERVER_TRUST_STORE_PATH
- See Also:
-
HTTP_SERVER_TRUST_STORE_PASSWORD
- See Also:
-
EXTRA_SERVER_COMPONENTS
- See Also:
-
IGNORE_EXTRA_SERVER_COMPONENTS_STARTUP_FAILURES
- See Also:
-
REGISTRATION_MANAGER_CLASS
- See Also:
-
ENABLE_TASK_EXECUTION_STATS
- See Also:
-
ENTRY_LOG_PER_LEDGER_ENABLED
- See Also:
-
NUMBER_OF_MEMTABLE_FLUSH_THREADS
- See Also:
-
ENTRYLOGMAP_ACCESS_EXPIRYTIME_INSECONDS
- See Also:
-
MAXIMUM_NUMBER_OF_ACTIVE_ENTRYLOGS
- See Also:
-
ENTRY_LOG_PER_LEDGER_COUNTER_LIMITS_MULT_FACTOR
- See Also:
-
LOCAL_CONSISTENCY_CHECK_ON_STARTUP
- See Also:
-
AUTHORIZED_ROLES
- See Also:
-
DATA_INTEGRITY_CHECKING_ENABLED
- See Also:
-
DATA_INTEGRITY_COOKIE_STAMPING_ENABLED
- See Also:
-
DEFAULT_ROCKSDB_CONF
- See Also:
-
ENTRY_LOCATION_ROCKSDB_CONF
- See Also:
-
LEDGER_METADATA_ROCKSDB_CONF
- See Also:
-
MAX_OPERATION_NUMBERS_IN_SINGLE_ROCKSDB_WRITE_BATCH
- See Also:
-
SKIP_REPLAY_JOURNAL_INVALID_RECORD
- See Also:
-
MAX_BATCH_READ_SIZE
- See Also:
-
DEFAULT_MAX_BATCH_READ_SIZE
protected static final int DEFAULT_MAX_BATCH_READ_SIZE- See Also:
-
-
Constructor Details
-
ServerConfiguration
public ServerConfiguration()Construct a default configuration object. -
ServerConfiguration
Construct a configuration based on other configuration.- Parameters:
conf- Other configuration
-
-
Method Details
-
getEntryLogSizeLimit
public long getEntryLogSizeLimit()Get entry logger size limitation.- Returns:
- entry logger size limitation
-
setEntryLogSizeLimit
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
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 lifecycle time of ledgers in the system.- Returns:
- gc wait time
-
setGcWaitTime
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
Set wait time for garbage collection of overreplicated ledgers. Default: 1 dayA 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
-
getGcMetadataOpRateLimit
public int getGcMetadataOpRateLimit()Get the rate limit of metadata operations in garbage collection.- Returns:
- rate limit of metadata operations in garbage collection
-
setGcMetadataOpRateLimit
Set the rate limit of metadata operations in garbage collection.- Parameters:
gcRateLimit-- 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
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
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
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
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.
-
isUseTargetEntryLogSizeForGc
public boolean isUseTargetEntryLogSizeForGc() -
setUseTargetEntryLogSizeForGc
-
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
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
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
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
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
Set page size.- Parameters:
pageSize- Page Size- Returns:
- Server Configuration
- See Also:
-
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
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:
-
setFileInfoMaxIdleTime
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:
-
getFileInfoFormatVersionToWrite
public int getFileInfoFormatVersionToWrite()Get fileinfo format version to write.- Returns:
- fileinfo format version to write.
-
setFileInfoFormatVersionToWrite
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
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
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
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
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
Set journal format version to write.- Parameters:
version- journal format version to write.- Returns:
- server configuration.
-
setJournalQueueSize
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
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
Set JournalChannelProvider classname.- Parameters:
journalChannelProvider- The JournalChannelProvider classname. The class must implementsFileChannelProviderand no args constructor is needed.- Returns:
-
getJournalChannelProvider
- Returns:
-
getJournalReuseFiles
public boolean getJournalReuseFiles()Get reuse journal files.- Returns:
-
setJournalReuseFiles
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
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
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
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
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
Set new bookie port that bookie server listen on.- Parameters:
port- Port to listen on- Returns:
- server configuration
-
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
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:
-
setAllowLoopback
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:
-
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
Configure the bookie to advertise a specific BookieId.By default, a bookie will advertise a BookieId computed from the primary network endpoint address.
- Parameters:
bookieId- the bookie id- Returns:
- server configuration
- See Also:
-
removeBookieId
Remove the configured BookieId for the bookie.- Returns:
- server configuration
-
getAdvertisedAddress
Get the configured advertised address for the bookie.If present, this setting will take precedence over the
setListeningInterface(String)andsetUseHostNameAsBookieID(boolean).- Returns:
- the configure address to be advertised
- See Also:
-
setAdvertisedAddress
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)andsetUseHostNameAsBookieID(boolean).- Parameters:
advertisedAddress- whether to allow loopback interfaces- Returns:
- server configuration
- See Also:
-
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
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
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
Get dir names to store journal files.- Returns:
- journal dir name
-
getJournalDirName
Deprecated.Get dir name to store journal files.- Returns:
- journal dir name
-
getJournalDirNameWithoutDefault
Get dir name to store journal files.- Returns:
- journal dir name
-
setJournalDirName
Set dir name to store journal files.- Parameters:
journalDir- Dir to store journal files- Returns:
- server configuration
-
setJournalDirsName
Set dir names to store journal files.- Parameters:
journalDirs- Dir to store journal files- Returns:
- server configuration
-
getJournalDirs
Get dirs to store journal files.- Returns:
- journal dirs, if no journal dir provided return null
-
getLedgerDirWithoutDefault
Get dir names to store ledger data.- Returns:
- ledger dir names, if not provided return null
-
getLedgerDirNames
Get dir names to store ledger data.- Returns:
- ledger dir names, if not provided return null
-
setLedgerDirNames
Set dir names to store ledger data.- Parameters:
ledgerDirs- Dir names to store ledger data- Returns:
- server configuration
-
getLedgerDirs
Get dirs that stores ledger data.- Returns:
- ledger dirs
-
getIndexDirNames
Get dir name to store index files.- Returns:
- ledger index dir name, if no index dirs provided return null
-
setIndexDirName
Set dir name to store index files.- Parameters:
indexDirs- Index dir names- Returns:
- server configuration.
-
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
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
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:
-
getServerSockLinger
public int getServerSockLinger()Timeout to drain the socket on close.- Returns:
- socket linger setting
-
setServerSockLinger
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
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
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
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
Turn on/off statistics.- Parameters:
enabled- Whether statistics enabled or not.- Returns:
- server configuration
-
setForceAllowCompaction
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
Set threshold of minor compaction.- Parameters:
threshold- Threshold for minor compaction- Returns:
- server configuration
- See Also:
-
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
Set threshold of major compaction.- Parameters:
threshold- Threshold of major compaction- Returns:
- server configuration
- See Also:
-
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
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:
-
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
Set interval to run minor compaction.- Parameters:
interval- Interval to run minor compaction- Returns:
- server configuration
- See Also:
-
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
Set interval to run major compaction.- Parameters:
interval- Interval to run major compaction- Returns:
- server configuration
- See Also:
-
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
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:
-
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
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
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:
-
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
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
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
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
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
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
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
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
Set the tick duration in milliseconds.- Parameters:
tickDuration- tick duration in milliseconds.- Returns:
- server configuration
-
setMaxPendingReadRequestPerThread
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
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
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
Set the number of bytes used as capacity for the write buffer.- Parameters:
writeBufferBytes- Write Buffer Bytes- Returns:
- server configuration
-
setNumJournalCallbackThreads
Deprecated.Set the number of threads that would handle journal callbacks.- Parameters:
numThreads- number of threads to handle journal callbacks.- Returns:
- server configuration
-
getNumJournalCallbackThreads
Deprecated.Get the number of threads that should handle journal callbacks.- Returns:
- the number of threads that handle journal callbacks.
-
setSortedLedgerStorageEnabled
Deprecated.UsesetLedgerStorageClass(String)to configure the implementation classSet 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
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
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
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
Should the data be written to journal before acknowledgment.Default is true
- Returns:
-
setJournalSyncData
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
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
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
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. UsegetJournalBufferedWritesThreshold()if this is set to zero or less than zero.- Returns:
- max entries to buffer.
-
setJournalBufferedEntriesThreshold
Set maximum entries to buffer to impose on a journal write to achieve grouping. UsegetJournalBufferedWritesThreshold()set this to zero or less than zero.- Parameters:
maxEntries- maximum entries to buffer.- Returns:
- server configuration.
-
setJournalFlushWhenQueueEmpty
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
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
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 true.- Returns:
- boolean
-
setDiskUsageWarnThreshold
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
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
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
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
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:
-
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 withgetAuditorPeriodicPlacementPolicyCheckInterval(), 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:
-
setAutoRecoveryDaemonEnabled
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
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
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
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.replaced bygetCompactionRateByEntries()Get the rate of compaction adds. Default is 1,000.- Returns:
- rate of compaction (adds per second)
-
setCompactionRate
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
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
Set the rate of compaction adds.- Parameters:
rate- rate of compaction adds (adds bytes per second)- Returns:
- ServerConfiguration
-
getEntryLocationCompactionInterval
public long getEntryLocationCompactionInterval()Get interval to run entry location compaction, in seconds.If it is set to less than zero, the entry location compaction is disabled.
- Returns:
- high water mark.
-
setEntryLocationCompactionInterval
Set interval to run entry location compaction.- Parameters:
interval- Interval to run entry location compaction- Returns:
- server configuration
- See Also:
-
getJournalRemovePagesFromCache
@Beta public boolean getJournalRemovePagesFromCache()Should we remove pages from page cache after force write.- Returns:
- remove pages from cache
-
setJournalRemovePagesFromCache
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
-
setLedgerStorageClass
Set theLedgerStorageimplementation 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
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:
-
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
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:
-
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
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:
-
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
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:
-
getStatsProviderClass
public Class<? extends StatsProvider> getStatsProviderClass() throws org.apache.commons.configuration2.ex.ConfigurationExceptionGet the stats provider used by bookie.- Returns:
- stats provider class
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException
-
setStatsProviderClass
Set the stats provider used by bookie.- Parameters:
providerClass- stats provider class- Returns:
- server configuration
-
isSanityCheckMetricsEnabled
public boolean isSanityCheckMetricsEnabled()Flag to enable sanity check metrics in bookie stats. Defaults to false/disabled.- Returns:
- true, if bookie collects sanity check metrics in stats
-
setSanityCheckMetricsEnabled
Enable sanity check metrics in bookie stats.- Parameters:
sanityCheckMetricsEnabled- flag to enable sanity check metrics- Returns:
- server configuration
-
validate
public void validate() throws org.apache.commons.configuration2.ex.ConfigurationExceptionValidate the configuration.- Throws:
org.apache.commons.configuration2.ex.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
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
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.
-
setNettyMaxFrameSizeBytes
Set the max number of bytes a single message can be that is read by the bookie. Any message larger than that size will be rejected.- Overrides:
setNettyMaxFrameSizeBytesin classAbstractConfiguration<ServerConfiguration>- Parameters:
maxSize- the max size in bytes- Returns:
- server configuration
-
getTLSTrustStoreType
Get the truststore type for client. Default is JKS.- Returns:
-
setTLSKeyStoreType
Set the keystore type for client.- Returns:
-
getTLSKeyStore
Get the keystore path for the client.- Returns:
-
setTLSKeyStore
Set the keystore path for the client.- Returns:
-
getTLSKeyStorePasswordPath
Get the path to file containing keystore password if the client keystore is password protected. Default is null.- Returns:
-
setTLSKeyStorePasswordPath
Set the path to file containing keystore password, if the client keystore is password protected.- Returns:
-
getTLSKeyStoreType
Get the keystore type for client. Default is JKS.- Returns:
-
setTLSTrustStoreType
Set the truststore type for client.- Returns:
-
getTLSTrustStore
Get the truststore path for the client.- Returns:
-
setTLSTrustStore
Set the truststore path for the client.- Returns:
-
getTLSTrustStorePasswordPath
Get the path to file containing truststore password if the client truststore is password protected. Default is null.- Returns:
-
setTLSTrustStorePasswordPath
Set the path to file containing truststore password, if the client truststore is password protected.- Returns:
-
getTLSCertificatePath
Get the path to file containing TLS Certificate.- Returns:
-
setTLSCertificatePath
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
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
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
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
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
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
Set Http server port listening on.- Parameters:
port- Port to listen on- Returns:
- server configuration
-
getHttpServerHost
Get the http server host.- Returns:
- http server host
-
setHttpServerHost
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
Set if Http Server Tls enable.- Parameters:
tlsEnable-- Returns:
- server configuration
-
getHttpServerKeystorePath
Get the http server keystore path.- Returns:
- http server keystore path
-
setHttpServerKeystorePath
Set Http server keystore path.- Parameters:
keystorePath- http server keystore path- Returns:
- server configuration
-
getHttpServerKeystorePassword
Get the http server keyStore password.- Returns:
- http server keyStore password
-
setHttpServerKeyStorePassword
Set Http server keyStore password.- Parameters:
keyStorePassword- http server keyStore password- Returns:
- server configuration
-
getHttpServerTrustStorePath
Get the http server trustStore path.- Returns:
- http server trustStore path
-
setHttpServerTrustStorePath
Set Http server trustStore path.- Parameters:
trustStorePath- http server trustStore path- Returns:
- server configuration
-
getHttpServerTrustStorePassword
Get the http server trustStore password.- Returns:
- http server trustStore password
-
setHttpServerTrustStorePasswordPassword
Set Http server trustStore password.- Parameters:
trustStorePassword- http server trustStore password- Returns:
- server configuration
-
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
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 atgetExtraServerComponents().- Returns:
- the flag whether to ignore startup failures on loading server components specified at
getExtraServerComponents(). The default value is false.
-
setIgnoreExtraServerComponentsStartupFailures
Set the flag whether to ignore startup failures on loading server components specified atgetExtraServerComponents().- 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
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
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(Class<? extends RegistrationManager> regManagerClass) Deprecated.since 4.7.0, in favor of usingAbstractConfiguration.setMetadataServiceUri(String)Set registration manager class.- Parameters:
regManagerClass- ManagerClass
-
getRegistrationManagerClass
@Deprecated public Class<? extends RegistrationManager> getRegistrationManagerClass() throws org.apache.commons.configuration2.ex.ConfigurationExceptionDeprecated.since 4.7.0, in favor of usingAbstractConfiguration.getMetadataServiceUri()Get Registration Manager Class.- Returns:
- registration manager class.
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException
-
getThis
Description copied from class:AbstractConfigurationTrickery to allow inheritance with fluent style.- Specified by:
getThisin classAbstractConfiguration<ServerConfiguration>
-
isEntryLogPerLedgerEnabled
public boolean isEntryLogPerLedgerEnabled() -
setEntryLogPerLedgerEnabled
-
getNumOfMemtableFlushThreads
public int getNumOfMemtableFlushThreads() -
setNumOfMemtableFlushThreads
-
getEntrylogMapAccessExpiryTimeInSeconds
public int getEntrylogMapAccessExpiryTimeInSeconds() -
setEntrylogMapAccessExpiryTimeInSeconds
public ServerConfiguration setEntrylogMapAccessExpiryTimeInSeconds(int entrylogMapAccessExpiryTimeInSeconds) -
getMaximumNumberOfActiveEntryLogs
public int getMaximumNumberOfActiveEntryLogs() -
setMaximumNumberOfActiveEntryLogs
-
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
Get the authorized roles.- Returns:
- String array of configured auth roles.
-
setAuthorizedRoles
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
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. -
isDataIntegrityCheckingEnabled
public boolean isDataIntegrityCheckingEnabled()- See Also:
-
setDataIntegrityStampMissingCookiesEnabled
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. -
isDataIntegrityStampMissingCookiesEnabled
public boolean isDataIntegrityStampMissingCookiesEnabled() -
setSkipReplayJournalInvalidRecord
public ServerConfiguration setSkipReplayJournalInvalidRecord(boolean skipReplayJournalInvalidRecord) When this config is set to true,if we replay journal failed, we will skip.- Parameters:
skipReplayJournalInvalidRecord-- Returns:
-
isSkipReplayJournalInvalidRecord
public boolean isSkipReplayJournalInvalidRecord()- See Also:
-
getDefaultRocksDBConf
Get default rocksdb conf.- Returns:
- String configured default rocksdb conf.
-
setDefaultRocksDBConf
Set default rocksdb conf.- Returns:
- Configuration Object with default rocksdb conf
-
getEntryLocationRocksdbConf
Get entry Location rocksdb conf.- Returns:
- String configured entry Location rocksdb conf.
-
setEntryLocationRocksdbConf
Set entry Location rocksdb conf.- Returns:
- Configuration Object with entry Location rocksdb conf
-
getLedgerMetadataRocksdbConf
Get ledger metadata rocksdb conf.- Returns:
- String configured ledger metadata rocksdb conf.
-
setLedgerMetadataRocksdbConf
Set ledger metadata rocksdb conf.- Returns:
- Configuration Object with ledger metadata rocksdb conf
-
setOperationMaxNumbersInSingleRocksDBWriteBatch
public ServerConfiguration setOperationMaxNumbersInSingleRocksDBWriteBatch(int maxNumbersInSingleRocksDBBatch) Set the max operation numbers in a single rocksdb write batch. The rocksdb write batch is related to the memory usage. If the batch is too large, it will cause the OOM.- Parameters:
maxNumbersInSingleRocksDBBatch-- Returns:
-
getMaxOperationNumbersInSingleRocksDBBatch
public int getMaxOperationNumbersInSingleRocksDBBatch()Get the max operation numbers in a single rocksdb write batch.- Returns:
-
setMaxBatchReadSize
Set the max batch read size.- Parameters:
maxBatchReadSize-- Returns:
-
getMaxBatchReadSize
public long getMaxBatchReadSize()Get the max batch read size.- Returns:
-
getCompactionRateByEntries()