/** * Get num of retries per request for zookeeper client. * <p>Retries only happen on retryable failures like session expired, * session moved. for permanent failures, the request will fail immediately. * The default value is 3. * * @return num of retries per request of zookeeper client. */ public int getZKNumRetries() { return this.getInt(BKDL_ZK_NUM_RETRIES, BKDL_ZK_NUM_RETRIES_DEFAULT); }
/** * Get BK's zookeeper session timout in milliseconds. * <p> * This is the session timeout applied for zookeeper client used by bookkeeper client. * Use {@link #getZKSessionTimeoutMilliseconds()} for zookeeper client used * by distributedlog. * * @return Bk's zookeeper session timeout in milliseconds */ public int getBKClientZKSessionTimeoutMilliSeconds() { return this.getInt(BKDL_BKCLIENT_ZK_SESSION_TIMEOUT, BKDL_BKCLIENT_ZK_SESSION_TIMEOUT_DEFAULT) * 1000; }
/** * Get the number of dedicated readahead worker threads used by distributedlog namespace. * <p>If this value is non-positive, it would share the normal executor (see {@link #getNumWorkerThreads()} * for readahead. otherwise, it would use a dedicated executor for readhead. By default, * it is 0. * * @return number of dedicated readahead worker threads. * @see #getNumWorkerThreads() */ public int getNumReadAheadWorkerThreads() { return getInt(BKDL_NUM_READAHEAD_WORKER_THREADS, 0); }
/** * Get log segment rolling concurrency. * <p>It limits how many writers could roll log segments concurrently. * The default value is 1. * * @return log segment rolling concurrency. * @see #setLogSegmentRollingConcurrency(int) */ public int getLogSegmentRollingConcurrency() { return getInt(BKDL_LOGSEGMENT_ROLLING_CONCURRENCY, BKDL_LOGSEGMENT_ROLLING_CONCURRENCY_DEFAULT); }
/** * Get the core size of ledger allocator pool. * The default value is 20. * * @return core size of ledger allocator pool. */ public int getLedgerAllocatorPoolCoreSize() { return getInt(BKDL_LEDGER_ALLOCATOR_POOL_CORE_SIZE, BKDL_LEDGER_ALLOCATOR_POOL_CORE_SIZE_DEFAULT); }
/** * Get num of retries for zookeeper client that used by bookkeeper client. * <p>Retries only happen on retryable failures like session expired, * session moved. for permanent failures, the request will fail immediately. * The default value is 3. * * @return num of retries of zookeeper client used by bookkeeper client. */ public int getBKClientZKNumRetries() { return this.getInt(BKDL_BKCLIENT_ZK_NUM_RETRIES, BKDL_BKCLIENT_ZK_NUM_RETRIES_DEFAULT); }
/** * Get the number of lock state threads used by distributedlog namespace. * By default it is 1. * * @return number of lock state threads used by distributedlog namespace. */ public int getNumLockStateThreads() { return getInt(BKDL_NUM_LOCKSTATE_THREADS, 1); }
/** * Get the per stream outstanding write limit for dl. * <p>If the setting is set with a positive value, the per stream * write limiting is enabled. By default it is disabled. * * @return the per stream outstanding write limit for dl * @see #getGlobalOutstandingWriteLimit() */ public int getPerWriterOutstandingWriteLimit() { return getInt(BKDL_PER_WRITER_OUTSTANDING_WRITE_LIMIT, BKDL_PER_WRITER_OUTSTANDING_WRITE_LIMIT_DEFAULT); }
/** * Get the global write limit for dl. * <p>If the setting is set with a positive value, the global * write limiting is enabled. By default it is disabled. * * @return the global write limit for dl * @see #getPerWriterOutstandingWriteLimit() */ public int getGlobalOutstandingWriteLimit() { return getInt(BKDL_GLOBAL_OUTSTANDING_WRITE_LIMIT, BKDL_GLOBAL_OUTSTANDING_WRITE_LIMIT_DEFAULT); }
/** * A lower threshold requests per second limit on writes to the distributedlog proxy. * * @return Requests per second write limit */ public int getRpsSoftWriteLimit() { return getInt(BKDL_RPS_SOFT_WRITE_LIMIT, BKDL_RPS_SOFT_WRITE_LIMIT_DEFAULT); }
/** * Get amount of time to delay writes for in writer failure injection. * * @return millis to delay writes for. */ public int getEIInjectedWriteDelayMs() { return getInt(BKDL_EI_INJECTED_WRITE_DELAY_MS, BKDL_EI_INJECTED_WRITE_DELAY_MS_DEFAULT); }
/** * Get write quorum size of each log segment (ledger) will use. * By default it is 3. * * @return write quorum size * @see #getEnsembleSize() */ public int getWriteQuorumSize() { return this.getInt(BKDL_BOOKKEEPER_WRITE_QUORUM_SIZE, getInt(BKDL_BOOKKEEPER_WRITE_QUORUM_SIZE_OLD, BKDL_BOOKKEEPER_WRITE_QUORUM_SIZE_DEFAULT)); }
/** * Get ack quorum size of each log segment (ledger) will use. * By default it is 2. * * @return ack quorum size * @see #getEnsembleSize() */ public int getAckQuorumSize() { return this.getInt(BKDL_BOOKKEEPER_ACK_QUORUM_SIZE, getInt(BKDL_BOOKKEEPER_ACK_QUORUM_SIZE_OLD, BKDL_BOOKKEEPER_ACK_QUORUM_SIZE_DEFAULT)); }
/** * Get minimum delay between immediate flushes in milliseconds. * <p>This setting only takes effects when {@link #getImmediateFlushEnabled()} * is enabled. It torelants the bursty of traffic when immediate flush is enabled, * which prevents sending too many control records to the bookkeeper. * * @return minimum delay between immediate flushes in milliseconds * @see #getImmediateFlushEnabled() */ public int getMinDelayBetweenImmediateFlushMs() { return this.getInt(BKDL_MINIMUM_DELAY_BETWEEN_IMMEDIATE_FLUSH_MILLISECONDS, BKDL_MINIMUM_DELAY_BETWEEN_IMMEDIATE_FLUSH_MILLISECONDS_DEFAULT); }
/** * Get the long poll time out for read last add confirmed requests, in milliseconds. * The default value is 1 second. * * @return long poll timeout in milliseconds * @see #getReadLACLongPollTimeout() */ public int getReadLACLongPollTimeout() { return this.getInt(BKDL_READLACLONGPOLL_TIMEOUT, BKDL_READLACLONGPOLL_TIMEOUT_DEFAULT); }
/** * Get the max records cached by readahead cache. * <p>The default value is 10. Increase this value to improve throughput, * but be careful about the memory. * * @return max records cached by readahead cache. */ public int getReadAheadMaxRecords() { return this.getInt(BKDL_READAHEAD_MAX_RECORDS, getInt(BKDL_READAHEAD_MAX_RECORDS_OLD, BKDL_READAHEAD_MAX_RECORDS_DEFAULT)); }
/** * Get the maximum number of partitions of each stream allowed to be acquired per proxy. * <p>This setting is able to configure per stream. This is the default setting if it is * not configured per stream. Default value is -1, which means no limit on the number of * partitions could be acquired each stream. * * @return maximum number of partitions of each stream allowed to be acquired per proxy. */ public int getMaxAcquiredPartitionsPerProxy() { return getInt(BKDL_MAX_ACQUIRED_PARTITIONS_PER_PROXY, BKDL_MAX_ACQUIRED_PARTITIONS_PER_PROXY_DEFAULT); }
/** * Get the maximum number of partitions of each stream allowed to cache per proxy. * <p>This setting is able to configure per stream. This is the default setting if it is * not configured per stream. Default value is -1, which means no limit on the number of * partitions could be acquired each stream. * * @return maximum number of partitions of each stream allowed to be acquired per proxy. */ public int getMaxCachedPartitionsPerProxy() { return getInt(BKDL_MAX_CACHED_PARTITIONS_PER_PROXY, BKDL_MAX_CACHED_PARTITIONS_PER_PROXY_DEFAULT); }
/** * Get the percentage of operations to delay in read ahead. * * @return the percentage of operations to delay in read ahead. */ public int getEIInjectReadAheadDelayPercent() { return getInt(BKDL_EI_INJECT_READAHEAD_DELAY_PERCENT, BKDL_EI_INJECT_READAHEAD_DELAY_PERCENT_DEFAULT); }
/** * Get the number of worker threads used by distributedlog namespace. * By default it is the number of available processors. * * @return number of worker threads used by distributedlog namespace. */ public int getNumWorkerThreads() { return getInt(BKDL_NUM_WORKER_THREADS, Runtime.getRuntime().availableProcessors()); }