Class ClientConfiguration
- 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 Stringstatic final StringThis client will act as a standard client.static final StringThis client will act as a system client, like theAuditor.protected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected 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 Stringstatic 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 Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic 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 client-side configuration.Construct a client-side configuration using a base configuration. -
Method Summary
Modifier and TypeMethodDescriptionEnables the bookie health check.intGet the timeout for top-level add request.intGet the timeout for add request.booleanWhether to enable BookieAddressResolver.longGet the error threshold for a bookie to be quarantined.intGet the bookie failure tracking expiration timeout.intGet the bookie health check interval in seconds.intReturn the timeout value for getBookieInfo request.intReturns the max multiple to use for nodes with very high weight.doubleGet the bookie quarantine ratio.intGet the time for which a bookie will be quarantined.Get digest type used in bookkeeper admin.byte[]Get passwd used in bookkeeper admin.longGet the log frequency when a bookie is unavailable, in milliseconds.intGet client netty connect timeout in millis.intGet client netty channel receive buffer size.Get the role of the client.intGet client netty channel send buffer size.booleanget socket keepalive.booleanIs tcp connection no delay.intGet client netty channel write buffer high water mark.intGet client netty channel write buffer low water mark.booleanWhether to delay ensemble change or not?Get the name of the dynamic feature that disables ensemble change.booleanReturn whether disk weight based placement policy is enabled.booleanWhether to enable bookie address changes tracking.booleanWhether to enable bookie failure tracking.booleanGet autodetection of digest type.booleanWhether to enable parallel reading in recovery read.booleanWhether to enable recording task execution stats.Class<? extends EnsemblePlacementPolicy>Get Ensemble Placement Policy Class.intGet the configured interval between explicit LACs to bookies.intGet the period of time after which the first speculative read last add confirmed and entry should be triggered.intGet the first speculative read timeout.intGet the time interval between successive calls for bookie get info.intGet the time interval between retries on unsuccessful bookie info request.booleanWhether hostname verification enabled?intGet the max allowed ensemble change number.intGet the maximum interval between successive speculative read last add confirmed and entry requests.intGet the max speculative read timeout.intGet the network topology stabilize period in seconds.intGet num channels per bookie.intGet the number of IO threads.intGet the number of worker threads.booleanWhether to allow opportunistic striping.intDeprecated.longDeprecated.intGet the timeout for read entry.intDeprecated.usegetReadEntryTimeout()orgetAddEntryTimeout()insteadintGet Recovery Read Batch Size.Class<? extends RegistrationClient>Deprecated.since 4.7.0intGet the threshold for the number of pending requests beyond which to reorder reads.floatMultiplier to use when determining time between successive speculative read LAC requests.intGet the period of time after which a speculative entry read should be triggered.floatMultiplier to use when determining time between successive speculative read requests.intReturn the timeout value for startTLS request.booleanReturn the flag that indicates whether client is using system time as the ledger creation time when creating ledgers.longGet task execution duration which triggers a warning.intGet TCP_KEEPCNT value for SO_KEEPALIVE.intGet TCP_KEEPIDLE value for SO_KEEPALIVE.intGet TCP_KEEPINTVL value for SO_KEEPALIVE.intGet client netty TCP user timeout in millis (only for Epoll channels).protected ClientConfigurationgetThis()Trickery to allow inheritance with fluent style.intGet throttle value.longGet the interval between successive executions of the operation timeout monitor.longDeprecated.intGet number of ticks that used for timeout timer.longGet the tick duration in milliseconds that used for timeout timer.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.booleanGet whether to use hostname to resolve local node placement policy.booleanUse older Bookkeeper wire protocol (no protobuf).longTimeout controlling wait on request send in case of unresponsive bookie(s) (i.e.booleanbooleanCheck if bookie health check is enabled.booleanDeprecated.booleanIf recovery batch read enabled or not.booleanIf reorder read sequence enabled or not.booleanIf read operation should be sticky to a single bookie or not.setAddEntryQuorumTimeout(int timeout) Set timeout for top-level add entry request.setAddEntryTimeout(int timeout) Set timeout for add entry request.setBatchReadEnabled(boolean enable) setBookieAddressResolverEnabled(boolean enabled) Enable/Disable BookieAddressResolver.setBookieErrorThresholdPerInterval(long thresholdPerInterval) Set the error threshold per interval (getBookieHealthCheckIntervalSeconds()) for a bookie before it is quarantined.setBookieFailureHistoryExpirationMSec(int expirationMSec) Set the bookie failure tracking expiration timeout.setBookieHealthCheckInterval(int interval, TimeUnit unit) Set the bookie health check interval.setBookieMaxWeightMultipleForWeightBasedPlacement(int multiple) Set the max multiple to use for nodes with very high weight.setBookieQuarantineRatio(double ratio) set the bookie quarantine ratio.setBookieQuarantineTime(int quarantineTime, TimeUnit unit) Set the time for which a bookie will be quarantined.setBookieRecoveryDigestType(BookKeeper.DigestType digestType) Set digest type used in bookkeeper admin.setBookieRecoveryPasswd(byte[] passwd) Set passwd used in bookkeeper admin.setClientConnectBookieUnavailableLogThrottling(int throttleValue, TimeUnit unit) Set the log frequency when a bookie is unavailable, in order to limit log filesize.setClientConnectTimeoutMillis(int connectTimeoutMillis) Set client netty connect timeout in millis.setClientReceiveBufferSize(int bufferSize) Set client netty channel receive buffer size.setClientRole(String role) Set the client role.setClientSendBufferSize(int bufferSize) Set client netty channel send buffer size.setClientSockKeepalive(boolean keepalive) Set socket keepalive setting.setClientTcpNoDelay(boolean noDelay) Set socket nodelay setting.setClientWriteBufferHighWaterMark(int waterMark) Set client netty channel write buffer high water mark.setClientWriteBufferLowWaterMark(int waterMark) Set client netty channel write buffer low water mark.setDelayEnsembleChange(boolean enabled) Enable/Disable delaying ensemble change.setDisableEnsembleChangeFeatureName(String disableEnsembleChangeFeatureName) Set the name of the dynamic feature that disables ensemble change.setDiskWeightBasedPlacementEnabled(boolean isEnabled) Set whether or not disk weight based placement is enabled.setEnableBookieAddressTracking(boolean value) Enable/Disable bookie address changes tracking.setEnableBookieFailureTracking(boolean enabled) Enable/Disable bookie failure tracking.setEnableDigestTypeAutodetection(boolean enable) Enable autodetection of digest type.setEnableParallelRecoveryRead(boolean enabled) Enable/Disable parallel reading in recovery read.setEnableTaskExecutionStats(boolean enabled) Enable/Disable recording task execution stats.setEnsemblePlacementPolicy(Class<? extends EnsemblePlacementPolicy> policyClass) Set Ensemble Placement Policy Class.setExplictLacInterval(int interval) Set the interval to check the need for sending an explicit LAC.setFirstSpeculativeReadLACTimeout(int timeout) Set the period of time after which the first speculative read last add confirmed and entry should be triggered.setFirstSpeculativeReadTimeout(int timeout) Set the first speculative read timeout.setGetBookieInfoIntervalSeconds(int pollInterval, TimeUnit unit) Set the time interval between successive polls for bookie get info.setGetBookieInfoRetryIntervalSeconds(int interval, TimeUnit unit) Set the time interval between retries on unsuccessful GetInfo requests.setGetBookieInfoTimeout(int timeoutSecs) Set the timeout value in secs for the GET_BOOKIE_INFO request.setHostnameVerificationEnabled(boolean enabled) Enable/Disable hostname verification for tls connection.setMaxAllowedEnsembleChanges(int num) Set the max allowed ensemble change number.setMaxSpeculativeReadLACTimeout(int timeout) Set the maximum interval between successive speculative read last add confirmed and entry requests.setMaxSpeculativeReadTimeout(int timeout) Set the max speculative read timeout.setNettyMaxFrameSizeBytes(int maxSize) Set the max number of bytes a single message can be that is read by the bookie.setNettyUsePooledBuffers(boolean enabled) Deprecated.setNetworkTopologyStabilizePeriodSeconds(int seconds) Set the network topology stabilize period in seconds.setNumChannelsPerBookie(int numChannelsPerBookie) Set num channels per bookie.setNumIOThreads(int numThreads) Set the number of IO threads.setNumWorkerThreads(int numThreads) Set the number of worker threads.setOpportunisticStriping(boolean enabled) Enable/Disable opportunistic striping.setPCBCTimeoutTimerNumTicks(int numTicks) Deprecated.setPCBCTimeoutTimerTickDurationMs(long tickDuration) Deprecated.setReadEntryTimeout(int timeout) Set the timeout for read entry request.setReadTimeout(int timeout) Deprecated.usesetReadEntryTimeout(int)orsetAddEntryTimeout(int)insteadsetRecoveryBatchReadEnabled(boolean enabled) Enable/disable recovery batch read.setRecoveryReadBatchSize(int batchSize) Set Recovery Read Batch Size.setRegistrationClientClass(Class<? extends RegistrationClient> regClientClass) Deprecated.since 4.7.0setReorderReadSequenceEnabled(boolean enabled) Enable/disable reordering read sequence on reading entries.setReorderThresholdPendingRequests(int threshold) Set the threshold for the number of pending requests beyond which to reorder reads.setSpeculativeReadLACTimeoutBackoffMultiplier(float speculativeReadLACTimeoutBackoffMultiplier) Set the multiplier to use when determining time between successive speculative read LAC requests.setSpeculativeReadTimeout(int timeout) Set the speculative read timeout.setSpeculativeReadTimeoutBackoffMultiplier(float speculativeReadTimeoutBackoffMultiplier) Set the multiplier to use when determining time between successive speculative read requests.setStartTLSTimeout(int timeoutSecs) Set the timeout value in secs for the START_TLS request.setStickyReadsEnabled(boolean enabled) Enable/disable having read operations for a ledger to be sticky to a single bookie.setStoreSystemtimeAsLedgerCreationTime(boolean enabled) Enable the client to use system time as the ledger creation time.setTaskExecutionWarnTimeMicros(long warnTime) Set task execution duration which triggers a warning.setTcpKeepCnt(int keepCnt) Set TCP_KEEPCNT value for SO_KEEPALIVE.setTcpKeepIdle(int keepIdle) Set TCP_KEEPIDLE value for SO_KEEPALIVE.setTcpKeepIntvl(int keepIntvl) Set TCP_KEEPINTVL value for SO_KEEPALIVE.setTcpUserTimeoutMillis(int tcpUserTimeoutMillis) Set client netty TCP user timeout in millis (only for Epoll channels).setThrottleValue(int throttle) Set throttle value.setTimeoutMonitorIntervalSec(long timeoutInterval) Set the interval between successive executions of the operation timeout monitor.setTimeoutTaskIntervalMillis(long timeoutMillis) Deprecated.setTimeoutTimerNumTicks(int numTicks) Set number of ticks that used for timeout timer.setTimeoutTimerTickDurationMs(long tickDuration) Set the tick duration in milliseconds that used for timeout timer.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.voidsetUseHostnameResolveLocalNodePlacementPolicy(boolean useHostnameResolveLocalNodePlacementPolicy) Set the flag to use hostname to resolve local node placement policy.setUseV2WireProtocol(boolean useV2WireProtocol) Set whether or not to use older Bookkeeper wire protocol (no protobuf).setWaitTimeoutOnBackpressureMillis(long value) Timeout controlling wait on request send in case of unresponsive bookie(s) (i.e.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
-
THROTTLE
- See Also:
-
DIGEST_TYPE
- See Also:
-
ENABLE_DIGEST_TYPE_AUTODETECTION
- See Also:
-
PASSWD
- See Also:
-
CLIENT_TLS_KEYSTORE_TYPE
Deprecated.- See Also:
-
CLIENT_TLS_KEYSTORE
Deprecated.- See Also:
-
CLIENT_TLS_KEYSTORE_PASSWORD_PATH
Deprecated.- See Also:
-
CLIENT_TLS_TRUSTSTORE_TYPE
Deprecated.- See Also:
-
CLIENT_TLS_TRUSTSTORE
Deprecated.- See Also:
-
CLIENT_TLS_TRUSTSTORE_PASSWORD_PATH
Deprecated.- See Also:
-
CLIENT_TCP_NODELAY
- See Also:
-
CLIENT_SOCK_KEEPALIVE
- See Also:
-
CLIENT_SENDBUFFER_SIZE
- See Also:
-
CLIENT_RECEIVEBUFFER_SIZE
- See Also:
-
CLIENT_WRITEBUFFER_LOW_WATER_MARK
- See Also:
-
CLIENT_WRITEBUFFER_HIGH_WATER_MARK
- See Also:
-
CLIENT_CONNECT_TIMEOUT_MILLIS
- See Also:
-
CLIENT_TCP_USER_TIMEOUT_MILLIS
- See Also:
-
NUM_CHANNELS_PER_BOOKIE
- See Also:
-
USE_V2_WIRE_PROTOCOL
- See Also:
-
NETTY_USE_POOLED_BUFFERS
- See Also:
-
READ_TIMEOUT
- See Also:
-
SPECULATIVE_READ_TIMEOUT
- See Also:
-
FIRST_SPECULATIVE_READ_TIMEOUT
- See Also:
-
MAX_SPECULATIVE_READ_TIMEOUT
- See Also:
-
SPECULATIVE_READ_TIMEOUT_BACKOFF_MULTIPLIER
- See Also:
-
FIRST_SPECULATIVE_READ_LAC_TIMEOUT
- See Also:
-
MAX_SPECULATIVE_READ_LAC_TIMEOUT
- See Also:
-
SPECULATIVE_READ_LAC_TIMEOUT_BACKOFF_MULTIPLIER
- See Also:
-
ENABLE_PARALLEL_RECOVERY_READ
- See Also:
-
RECOVERY_READ_BATCH_SIZE
- See Also:
-
REORDER_READ_SEQUENCE_ENABLED
- See Also:
-
STICKY_READS_ENABLED
- See Also:
-
RECOVERY_BATCH_READ_ENABLED
- See Also:
-
OPPORTUNISTIC_STRIPING
- See Also:
-
DELAY_ENSEMBLE_CHANGE
- See Also:
-
MAX_ALLOWED_ENSEMBLE_CHANGES
- See Also:
-
ADD_ENTRY_TIMEOUT_SEC
- See Also:
-
ADD_ENTRY_QUORUM_TIMEOUT_SEC
- See Also:
-
READ_ENTRY_TIMEOUT_SEC
- See Also:
-
TIMEOUT_MONITOR_INTERVAL_SEC
- See Also:
-
TIMEOUT_TASK_INTERVAL_MILLIS
- See Also:
-
EXPLICIT_LAC_INTERVAL
- See Also:
-
PCBC_TIMEOUT_TIMER_TICK_DURATION_MS
- See Also:
-
PCBC_TIMEOUT_TIMER_NUM_TICKS
- See Also:
-
TIMEOUT_TIMER_TICK_DURATION_MS
- See Also:
-
TIMEOUT_TIMER_NUM_TICKS
- See Also:
-
WAIT_TIMEOUT_ON_BACKPRESSURE
- See Also:
-
BOOKIE_HEALTH_CHECK_ENABLED
- See Also:
-
BOOKIE_HEALTH_CHECK_INTERVAL_SECONDS
- See Also:
-
BOOKIE_ERROR_THRESHOLD_PER_INTERVAL
- See Also:
-
BOOKIE_QUARANTINE_TIME_SECONDS
- See Also:
-
BOOKIE_QUARANTINE_RATIO
- See Also:
-
DISK_WEIGHT_BASED_PLACEMENT_ENABLED
- See Also:
-
GET_BOOKIE_INFO_INTERVAL_SECONDS
- See Also:
-
GET_BOOKIE_INFO_RETRY_INTERVAL_SECONDS
- See Also:
-
BOOKIE_MAX_MULTIPLE_FOR_WEIGHTED_PLACEMENT
- See Also:
-
GET_BOOKIE_INFO_TIMEOUT_SECS
- See Also:
-
START_TLS_TIMEOUT_SECS
- See Also:
-
TLS_HOSTNAME_VERIFICATION_ENABLED
- See Also:
-
NUM_WORKER_THREADS
- See Also:
-
NUM_IO_THREADS
- See Also:
-
ENSEMBLE_PLACEMENT_POLICY
- See Also:
-
NETWORK_TOPOLOGY_STABILIZE_PERIOD_SECONDS
- See Also:
-
READ_REORDER_THRESHOLD_PENDING_REQUESTS
- See Also:
-
BOOKIE_ADDRESS_RESOLVER_ENABLED
- See Also:
-
USE_HOSTNAME_RESOLVE_LOCAL_NODE_PLACEMENT_POLICY
- See Also:
-
ENABLE_TASK_EXECUTION_STATS
- See Also:
-
TASK_EXECUTION_WARN_TIME_MICROS
- See Also:
-
ENABLE_BOOKIE_FAILURE_TRACKING
- See Also:
-
BOOKIE_FAILURE_HISTORY_EXPIRATION_MS
- See Also:
-
FOLLOW_BOOKIE_ADDRESS_TRACKING
- See Also:
-
DISABLE_ENSEMBLE_CHANGE_FEATURE_NAME
- See Also:
-
CLIENT_ROLE
- See Also:
-
CLIENT_ROLE_STANDARD
This client will act as a standard client.- See Also:
-
CLIENT_ROLE_SYSTEM
This client will act as a system client, like theAuditor.- See Also:
-
CLIENT_AUTH_PROVIDER_FACTORY_CLASS
- See Also:
-
REGISTRATION_CLIENT_CLASS
- See Also:
-
CLIENT_CONNECT_BOOKIE_UNAVAILABLE_LOG_THROTTLING
- See Also:
-
BATCH_READ_ENABLED
- See Also:
-
TCP_KEEPIDLE
- See Also:
-
TCP_KEEPINTVL
- See Also:
-
TCP_KEEPCNT
- See Also:
-
-
Constructor Details
-
ClientConfiguration
public ClientConfiguration()Construct a default client-side configuration. -
ClientConfiguration
Construct a client-side configuration using a base configuration.- Parameters:
conf- Base configuration
-
-
Method Details
-
getThrottleValue
public int getThrottleValue()Get throttle value.- Returns:
- throttle value
- See Also:
-
setThrottleValue
Set throttle value.Since BookKeeper process requests in asynchronous way, it will holds those pending request in queue. You may easily run it out of memory if producing too many requests than the capability of bookie servers can handle. To prevent that from happening, you can set a throttle value here.
Setting the throttle value to 0, will disable any throttling.
- Parameters:
throttle- Throttle Value- Returns:
- client configuration
-
getEnableDigestTypeAutodetection
public boolean getEnableDigestTypeAutodetection()Get autodetection of digest type.Ignores provided digestType, if enabled and uses one from ledger metadata instead. Incompatible with ledger created by bookie versions < 4.2
It is turned on by default since 4.7.
- Returns:
- flag to enable/disable autodetection of digest type.
-
setEnableDigestTypeAutodetection
Enable autodetection of digest type. Ignores provided digestType, if enabled and uses one from ledger metadata instead. Incompatible with ledger created by bookie versions < 4.2- Returns:
- client configuration.
-
getBookieRecoveryDigestType
Get digest type used in bookkeeper admin.- Returns:
- digest type
- See Also:
-
setBookieRecoveryDigestType
Set digest type used in bookkeeper admin.Digest Type and Passwd used to open ledgers for admin tool For now, assume that all ledgers were created with the same DigestType and password. In the future, this admin tool will need to know for each ledger, what was the DigestType and password used to create it before it can open it. These values will come from System properties, though fixed defaults are defined here.
- Parameters:
digestType- Digest Type- Returns:
- client configuration
-
getBookieRecoveryPasswd
public byte[] getBookieRecoveryPasswd()Get passwd used in bookkeeper admin.- Returns:
- password
- See Also:
-
setBookieRecoveryPasswd
Set passwd used in bookkeeper admin.Digest Type and Passwd used to open ledgers for admin tool For now, assume that all ledgers were created with the same DigestType and password. In the future, this admin tool will need to know for each ledger, what was the DigestType and password used to create it before it can open it. These values will come from System properties, though fixed defaults are defined here.
- Parameters:
passwd- Password- Returns:
- client configuration
-
getClientTcpNoDelay
public boolean getClientTcpNoDelay()Is tcp connection no delay.- Returns:
- tcp socket nodelay setting
- See Also:
-
setClientTcpNoDelay
Set socket nodelay setting.This settings is used to enabled/disabled Nagle's algorithm, which is a means of improving the efficiency of TCP/IP networks by reducing the number of packets that need to be sent over the network. If you are sending many small messages, such that more than one can fit in a single IP packet, setting client.tcpnodelay to false to enable Nagle algorithm can provide better performance.
Default value is true.- Parameters:
noDelay- NoDelay setting- Returns:
- client configuration
-
getClientSockKeepalive
public boolean getClientSockKeepalive()get socket keepalive.- Returns:
- socket keepalive setting
-
setClientSockKeepalive
Set socket keepalive setting.This setting is used to send keep-alive messages on connection-oriented sockets.
- Parameters:
keepalive- KeepAlive setting- Returns:
- client configuration
-
getClientSendBufferSize
public int getClientSendBufferSize()Get client netty channel send buffer size.- Returns:
- client netty channel send buffer size
-
setClientSendBufferSize
Set client netty channel send buffer size.- Parameters:
bufferSize- client netty channel send buffer size.- Returns:
- client configuration.
-
getClientReceiveBufferSize
public int getClientReceiveBufferSize()Get client netty channel receive buffer size.- Returns:
- client netty channel receive buffer size.
-
setClientReceiveBufferSize
Set client netty channel receive buffer size.- Parameters:
bufferSize- netty channel receive buffer size.- Returns:
- client configuration.
-
getClientWriteBufferLowWaterMark
public int getClientWriteBufferLowWaterMark()Get client netty channel write buffer low water mark.- Returns:
- netty channel write buffer low water mark.
-
setClientWriteBufferLowWaterMark
Set client netty channel write buffer low water mark.- Parameters:
waterMark- netty channel write buffer low water mark.- Returns:
- client configuration.
-
getClientWriteBufferHighWaterMark
public int getClientWriteBufferHighWaterMark()Get client netty channel write buffer high water mark.- Returns:
- netty channel write buffer high water mark.
-
setClientWriteBufferHighWaterMark
Set client netty channel write buffer high water mark.- Parameters:
waterMark- netty channel write buffer high water mark.- Returns:
- client configuration.
-
getTimeoutTimerTickDurationMs
public long getTimeoutTimerTickDurationMs()Get the tick duration in milliseconds that used for timeout timer.- Returns:
- tick duration in milliseconds
-
setTimeoutTimerTickDurationMs
Set the tick duration in milliseconds that used for timeout timer.- Parameters:
tickDuration- tick duration in milliseconds.- Returns:
- client configuration.
-
getTimeoutTimerNumTicks
public int getTimeoutTimerNumTicks()Get number of ticks that used for timeout timer.- Returns:
- number of ticks that used for timeout timer.
-
setTimeoutTimerNumTicks
Set number of ticks that used for timeout timer.- Parameters:
numTicks- number of ticks that used for timeout timer.- Returns:
- client configuration.
-
getClientConnectTimeoutMillis
public int getClientConnectTimeoutMillis()Get client netty connect timeout in millis.- Returns:
- client netty connect timeout in millis.
-
setClientConnectTimeoutMillis
Set client netty connect timeout in millis.- Parameters:
connectTimeoutMillis- client netty connect timeout in millis.- Returns:
- client configuration.
-
getTcpUserTimeoutMillis
public int getTcpUserTimeoutMillis()Get client netty TCP user timeout in millis (only for Epoll channels).- Returns:
- client netty Epoll user tcp timeout in millis.
- Throws:
NoSuchElementException- if the property is not set.
-
setTcpUserTimeoutMillis
Set client netty TCP user timeout in millis (only for Epoll channels).- Parameters:
tcpUserTimeoutMillis- client netty TCP user timeout in millis.- Returns:
- client configuration.
-
getNumChannelsPerBookie
public int getNumChannelsPerBookie()Get num channels per bookie.- Returns:
- num channels per bookie.
-
setNumChannelsPerBookie
Set num channels per bookie.- Parameters:
numChannelsPerBookie- num channels per bookie.- Returns:
- client configuration.
-
getUseV2WireProtocol
public boolean getUseV2WireProtocol()Use older Bookkeeper wire protocol (no protobuf).- Returns:
- whether or not to use older Bookkeeper wire protocol (no protobuf)
-
setUseV2WireProtocol
Set whether or not to use older Bookkeeper wire protocol (no protobuf).- Parameters:
useV2WireProtocol- whether or not to use older Bookkeeper wire protocol (no protobuf)- Returns:
- client configuration.
-
getReadTimeout
Deprecated.usegetReadEntryTimeout()orgetAddEntryTimeout()insteadGet the socket read timeout. This is the number of seconds we wait without hearing a response from a bookie before we consider it failed.The default is 5 seconds.
- Returns:
- the current read timeout in seconds
-
setReadTimeout
Deprecated.usesetReadEntryTimeout(int)orsetAddEntryTimeout(int)insteadSet the socket read timeout.- Parameters:
timeout- The new read timeout in seconds- Returns:
- client configuration
- See Also:
-
getAddEntryTimeout
public int getAddEntryTimeout()Get the timeout for add request. This is the number of seconds we wait without hearing a response for add request from a bookie before we consider it failed.The default value is 5 second for backwards compatibility.
- Returns:
- add entry timeout.
-
setAddEntryTimeout
Set timeout for add entry request.- Parameters:
timeout- The new add entry timeout in seconds.- Returns:
- client configuration.
- See Also:
-
getAddEntryQuorumTimeout
public int getAddEntryQuorumTimeout()Get the timeout for top-level add request. That is, the amount of time we should spend waiting for ack quorum.- Returns:
- add entry ack quorum timeout.
-
setAddEntryQuorumTimeout
Set timeout for top-level add entry request.- Parameters:
timeout- The new add entry ack quorum timeout in seconds.- Returns:
- client configuration.
- See Also:
-
getReadEntryTimeout
public int getReadEntryTimeout()Get the timeout for read entry. This is the number of seconds we wait without hearing a response for read entry request from a bookie before we consider it failed. By default, we use socket timeout specified atgetReadTimeout().- Returns:
- read entry timeout.
-
setReadEntryTimeout
Set the timeout for read entry request.- Parameters:
timeout- The new read entry timeout in seconds.- Returns:
- client configuration.
- See Also:
-
getTimeoutMonitorIntervalSec
public long getTimeoutMonitorIntervalSec()Get the interval between successive executions of the operation timeout monitor. This value is in seconds.- Returns:
- the interval at which request timeouts will be checked
- See Also:
-
setTimeoutMonitorIntervalSec
Set the interval between successive executions of the operation timeout monitor. The value in seconds. Every X seconds, all outstanding add and read operations are checked to see if they have been running for longer than their configured timeout. Any that have been will be errored out.This timeout should be set to a value which is a fraction of the values of
getAddEntryQuorumTimeout(),getAddEntryTimeout()andgetReadEntryTimeout(), so that these timeouts run in a timely fashion.- Parameters:
timeoutInterval- The timeout monitor interval, in seconds- Returns:
- client configuration
-
getTimeoutTaskIntervalMillis
Deprecated.Get the interval between successive executions of the PerChannelBookieClient's TimeoutTask. This value is in milliseconds. Every X milliseconds, the timeout task will be executed and it will error out entries that have timed out.We do it more aggressive to not accumulate pending requests due to slow responses.
- Returns:
- the interval at which request timeouts will be checked
-
setTimeoutTaskIntervalMillis
Deprecated. -
getExplictLacInterval
public int getExplictLacInterval()Get the configured interval between explicit LACs to bookies. Generally LACs are piggy-backed on writes, and user can configure the interval between these protocol messages. A value of '0' disables sending any explicit LACs.- Returns:
- interval between explicit LACs
-
setExplictLacInterval
Set the interval to check the need for sending an explicit LAC.- Parameters:
interval- Number of milli seconds between checking the need for sending an explict LAC.- Returns:
- Client configuration.
-
getPCBCTimeoutTimerTickDurationMs
Deprecated.Get the tick duration in milliseconds that used for the HashedWheelTimer that used by PCBC to timeout requests.- Returns:
- tick duration in milliseconds
-
setPCBCTimeoutTimerTickDurationMs
Deprecated.Set the tick duration in milliseconds that used for HashedWheelTimer that used by PCBC to timeout requests. Be aware of HashedWheelTimer if you are going to modify this setting.- Parameters:
tickDuration- tick duration in milliseconds.- Returns:
- client configuration.
- See Also:
-
getPCBCTimeoutTimerNumTicks
Deprecated.Get number of ticks that used for HashedWheelTimer that used by PCBC to timeout requests.- Returns:
- number of ticks that used for timeout timer.
-
setPCBCTimeoutTimerNumTicks
Deprecated.Set number of ticks that used for HashedWheelTimer that used by PCBC to timeout request. Be aware of HashedWheelTimer if you are going to modify this setting.- Parameters:
numTicks- number of ticks that used for timeout timer.- Returns:
- client configuration.
- See Also:
-
getWaitTimeoutOnBackpressureMillis
public long getWaitTimeoutOnBackpressureMillis()Timeout controlling wait on request send in case of unresponsive bookie(s) (i.e. bookie in long GC etc.)- Returns:
- timeout value negative value disables the feature 0 to allow request to fail immediately Default is -1 (disabled)
-
setWaitTimeoutOnBackpressureMillis
Timeout controlling wait on request send in case of unresponsive bookie(s) (i.e. bookie in long GC etc.)- Parameters:
value- negative value disables the feature 0 to allow request to fail immediately Default is -1 (disabled)- Returns:
- client configuration.
-
getNumWorkerThreads
public int getNumWorkerThreads()Get the number of worker threads. This is the number of worker threads used by bookkeeper client to submit operations.- Returns:
- the number of worker threads
-
setNumWorkerThreads
Set the number of worker threads.NOTE: setting the number of worker threads after BookKeeper object is constructed will not take any effect on the number of threads in the pool.
- Parameters:
numThreads- number of worker threads used for bookkeeper- Returns:
- client configuration
- See Also:
-
getNumIOThreads
public int getNumIOThreads()Get the number of IO threads. This is the number of threads used by Netty to handle TCP connections.- Returns:
- the number of IO threads
-
setNumIOThreads
Set the number of IO threads.This is the number of threads used by Netty to handle TCP connections.
NOTE: setting the number of IO threads after BookKeeper object is constructed will not take any effect on the number of threads in the pool.
- Parameters:
numThreads- number of IO threads used for bookkeeper- Returns:
- client configuration
- See Also:
-
getSpeculativeReadTimeout
public int getSpeculativeReadTimeout()Get the period of time after which a speculative entry read should be triggered. A speculative entry read is sent to the next replica bookie before an error or response has been received for the previous entry read request.A speculative entry read is only sent if we have not heard from the current replica bookie during the entire read operation which may comprise of many entries.
Speculative reads allow the client to avoid having to wait for the connect timeout in the case that a bookie has failed. It induces higher load on the network and on bookies. This should be taken into account before changing this configuration value.
- Returns:
- the speculative read timeout in milliseconds. Default 2000.
- See Also:
-
setSpeculativeReadTimeout
Set the speculative read timeout. A lower timeout will reduce read latency in the case of a failed bookie, while increasing the load on bookies and the network.The default is 2000 milliseconds. A value of 0 will disable speculative reads completely.
- Parameters:
timeout- the timeout value, in milliseconds- Returns:
- client configuration
- See Also:
-
getFirstSpeculativeReadTimeout
public int getFirstSpeculativeReadTimeout()Get the first speculative read timeout.- Returns:
- first speculative read timeout.
-
setFirstSpeculativeReadTimeout
Set the first speculative read timeout.- Parameters:
timeout- first speculative read timeout.- Returns:
- client configuration.
-
getSpeculativeReadTimeoutBackoffMultiplier
public float getSpeculativeReadTimeoutBackoffMultiplier()Multiplier to use when determining time between successive speculative read requests.- Returns:
- speculative read timeout backoff multiplier.
-
setSpeculativeReadTimeoutBackoffMultiplier
public ClientConfiguration setSpeculativeReadTimeoutBackoffMultiplier(float speculativeReadTimeoutBackoffMultiplier) Set the multiplier to use when determining time between successive speculative read requests.- Parameters:
speculativeReadTimeoutBackoffMultiplier- multiplier to use when determining time between successive speculative read requests.- Returns:
- client configuration.
-
getSpeculativeReadLACTimeoutBackoffMultiplier
public float getSpeculativeReadLACTimeoutBackoffMultiplier()Multiplier to use when determining time between successive speculative read LAC requests.- Returns:
- speculative read LAC timeout backoff multiplier.
-
setSpeculativeReadLACTimeoutBackoffMultiplier
public ClientConfiguration setSpeculativeReadLACTimeoutBackoffMultiplier(float speculativeReadLACTimeoutBackoffMultiplier) Set the multiplier to use when determining time between successive speculative read LAC requests.- Parameters:
speculativeReadLACTimeoutBackoffMultiplier- multiplier to use when determining time between successive speculative read LAC requests.- Returns:
- client configuration.
-
getMaxSpeculativeReadTimeout
public int getMaxSpeculativeReadTimeout()Get the max speculative read timeout.- Returns:
- max speculative read timeout.
-
setMaxSpeculativeReadTimeout
Set the max speculative read timeout.- Parameters:
timeout- max speculative read timeout.- Returns:
- client configuration.
-
getFirstSpeculativeReadLACTimeout
public int getFirstSpeculativeReadLACTimeout()Get the period of time after which the first speculative read last add confirmed and entry should be triggered. A speculative entry request is sent to the next replica bookie before an error or response has been received for the previous entry read request.A speculative entry read is only sent if we have not heard from the current replica bookie during the entire read operation which may comprise of many entries.
Speculative requests allow the client to avoid having to wait for the connect timeout in the case that a bookie has failed. It induces higher load on the network and on bookies. This should be taken into account before changing this configuration value.
- Returns:
- the speculative request timeout in milliseconds. Default 1500.
-
getMaxSpeculativeReadLACTimeout
public int getMaxSpeculativeReadLACTimeout()Get the maximum interval between successive speculative read last add confirmed and entry requests.- Returns:
- the max speculative request timeout in milliseconds. Default 5000.
-
setFirstSpeculativeReadLACTimeout
Set the period of time after which the first speculative read last add confirmed and entry should be triggered. A lower timeout will reduce read latency in the case of a failed bookie, while increasing the load on bookies and the network.The default is 1500 milliseconds. A value of 0 will disable speculative reads completely.
- Parameters:
timeout- the timeout value, in milliseconds- Returns:
- client configuration
- See Also:
-
setMaxSpeculativeReadLACTimeout
Set the maximum interval between successive speculative read last add confirmed and entry requests.- Parameters:
timeout- the timeout value, in milliseconds- Returns:
- client configuration
-
getEnableParallelRecoveryRead
public boolean getEnableParallelRecoveryRead()Whether to enable parallel reading in recovery read.- Returns:
- true if enable parallel reading in recovery read. otherwise, return false.
-
setEnableParallelRecoveryRead
Enable/Disable parallel reading in recovery read.- Parameters:
enabled- flag to enable/disable parallel reading in recovery read.- Returns:
- client configuration.
-
getRecoveryReadBatchSize
public int getRecoveryReadBatchSize()Get Recovery Read Batch Size.- Returns:
- recovery read batch size.
-
setRecoveryReadBatchSize
Set Recovery Read Batch Size.- Parameters:
batchSize- recovery read batch size.- Returns:
- client configuration.
-
isReorderReadSequenceEnabled
public boolean isReorderReadSequenceEnabled()If reorder read sequence enabled or not.- Returns:
- true if reorder read sequence is enabled, otherwise false.
-
setReorderReadSequenceEnabled
Enable/disable reordering read sequence on reading entries.If this flag is enabled, the client will use
EnsemblePlacementPolicy.reorderReadSequence(java.util.List, org.apache.bookkeeper.client.BookiesHealthInfo, org.apache.bookkeeper.client.DistributionSchedule.WriteSet)to figure out a better read sequence to attempt reads from replicas and useEnsemblePlacementPolicy.reorderReadLACSequence(java.util.List, org.apache.bookkeeper.client.BookiesHealthInfo, org.apache.bookkeeper.client.DistributionSchedule.WriteSet)to figure out a better read sequence to attempt long poll reads from replicas.The order of read sequence is determined by the placement policy implementations.
- Parameters:
enabled- the flag to enable/disable reorder read sequence.- Returns:
- client configuration instance.
-
isStickyReadsEnabled
public boolean isStickyReadsEnabled()If read operation should be sticky to a single bookie or not.- Returns:
- true if reorder read sequence is enabled, otherwise false.
-
setStickyReadsEnabled
Enable/disable having read operations for a ledger to be sticky to a single bookie.If this flag is enabled, the client will use one single bookie (by preference) to read all entries for a ledger.
Having all the read to one bookie will increase the chances that a read request will be fulfilled by Bookie read cache (or OS file system cache) when doing sequential reads.
- Parameters:
enabled- the flag to enable/disable sticky reads.- Returns:
- client configuration instance.
-
isRecoveryBatchReadEnabled
public boolean isRecoveryBatchReadEnabled()If recovery batch read enabled or not.- Returns:
-
setRecoveryBatchReadEnabled
Enable/disable recovery batch read.- Parameters:
enabled-- Returns:
-
getEnsemblePlacementPolicy
public Class<? extends EnsemblePlacementPolicy> getEnsemblePlacementPolicy() throws org.apache.commons.configuration2.ex.ConfigurationExceptionGet Ensemble Placement Policy Class.- Returns:
- ensemble placement policy class.
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException
-
setEnsemblePlacementPolicy
public ClientConfiguration setEnsemblePlacementPolicy(Class<? extends EnsemblePlacementPolicy> policyClass) Set Ensemble Placement Policy Class.- Parameters:
policyClass- Ensemble Placement Policy Class.
-
getReorderThresholdPendingRequests
public int getReorderThresholdPendingRequests()Get the threshold for the number of pending requests beyond which to reorder reads. If <= zero, this feature is turned off.- Returns:
- the threshold for the number of pending requests beyond which to reorder reads.
-
setReorderThresholdPendingRequests
Set the threshold for the number of pending requests beyond which to reorder reads. If zero, this feature is turned off.- Parameters:
threshold- The threshold for the number of pending requests beyond which to reorder reads.
-
getNetworkTopologyStabilizePeriodSeconds
public int getNetworkTopologyStabilizePeriodSeconds()Get the network topology stabilize period in seconds. if it is zero, this feature is turned off.- Returns:
- network topology stabilize period in seconds.
-
setNetworkTopologyStabilizePeriodSeconds
Set the network topology stabilize period in seconds.- Parameters:
seconds- stabilize period in seconds- Returns:
- client configuration.
- See Also:
-
getBookieAddressResolverEnabled
public boolean getBookieAddressResolverEnabled()Whether to enable BookieAddressResolver.- Returns:
- flag to enable/disable BookieAddressResolver.
-
setBookieAddressResolverEnabled
Enable/Disable BookieAddressResolver.If this flag is true, read bookie information from the metadata service (e.g. ZooKeeper) to resolve the address from each bookie ID. If all bookie IDs in the cluster are "address:port" or "hostname:port", you can set this flag to false to reduce requests to the metadata service.
- Parameters:
enabled- flag to enable/disable BookieAddressResolver.- Returns:
- client configuration.
-
setUseHostnameResolveLocalNodePlacementPolicy
public void setUseHostnameResolveLocalNodePlacementPolicy(boolean useHostnameResolveLocalNodePlacementPolicy) Set the flag to use hostname to resolve local node placement policy.- Parameters:
useHostnameResolveLocalNodePlacementPolicy-
-
getUseHostnameResolveLocalNodePlacementPolicy
public boolean getUseHostnameResolveLocalNodePlacementPolicy()Get whether to use hostname to resolve local node placement policy.- Returns:
-
getEnableTaskExecutionStats
public boolean getEnableTaskExecutionStats()Whether to enable recording task execution stats.- Returns:
- flag to enable/disable recording task execution stats.
-
setEnableTaskExecutionStats
Enable/Disable recording task execution stats.- Parameters:
enabled- flag to enable/disable recording task execution stats.- Returns:
- client configuration.
-
getTaskExecutionWarnTimeMicros
public long getTaskExecutionWarnTimeMicros()Get task execution duration which triggers a warning.- Returns:
- time in microseconds which triggers a warning.
-
setTaskExecutionWarnTimeMicros
Set task execution duration which triggers a warning.- Parameters:
warnTime- time in microseconds which triggers a warning.- Returns:
- client configuration.
-
isBookieHealthCheckEnabled
public boolean isBookieHealthCheckEnabled()Check if bookie health check is enabled.- Returns:
-
enableBookieHealthCheck
Enables the bookie health check.If the number of read/write errors for a bookie exceeds
getBookieErrorThresholdPerInterval()per interval, that bookie is quarantined forgetBookieQuarantineTimeSeconds()seconds. During this quarantined period, the client will try not to use this bookie when creating new ensembles.By default, the bookie health check is disabled.
- Returns:
- client configuration
-
getBookieHealthCheckIntervalSeconds
public int getBookieHealthCheckIntervalSeconds()Get the bookie health check interval in seconds.- Returns:
-
setBookieHealthCheckInterval
Set the bookie health check interval. Default is 60 seconds.Note: Please
enableBookieHealthCheck()to use this configuration.- Parameters:
interval-unit-- Returns:
- client configuration
-
getBookieErrorThresholdPerInterval
public long getBookieErrorThresholdPerInterval()Get the error threshold for a bookie to be quarantined.- Returns:
-
setBookieErrorThresholdPerInterval
Set the error threshold per interval (getBookieHealthCheckIntervalSeconds()) for a bookie before it is quarantined. Default is 100 errors per minute.Note: Please
enableBookieHealthCheck()to use this configuration.- Parameters:
thresholdPerInterval-- Returns:
- client configuration
-
getBookieQuarantineTimeSeconds
public int getBookieQuarantineTimeSeconds()Get the time for which a bookie will be quarantined.- Returns:
-
setBookieQuarantineTime
Set the time for which a bookie will be quarantined. Default is 30 minutes.Note: Please
enableBookieHealthCheck()to use this configuration.- Parameters:
quarantineTime-unit-- Returns:
- client configuration
-
getBookieQuarantineRatio
public double getBookieQuarantineRatio()Get the bookie quarantine ratio.- Returns:
-
setBookieQuarantineRatio
set the bookie quarantine ratio. default is 1.0.- Parameters:
ratio-- Returns:
- client configuration
-
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<ClientConfiguration>- Parameters:
maxSize- the max size in bytes- Returns:
- server configuration
-
getGetBookieInfoIntervalSeconds
public int getGetBookieInfoIntervalSeconds()Get the time interval between successive calls for bookie get info. Default is 24 hours.- Returns:
-
getGetBookieInfoRetryIntervalSeconds
public int getGetBookieInfoRetryIntervalSeconds()Get the time interval between retries on unsuccessful bookie info request. Default is 60s.- Returns:
-
getDiskWeightBasedPlacementEnabled
public boolean getDiskWeightBasedPlacementEnabled()Return whether disk weight based placement policy is enabled.- Returns:
-
getBookieMaxWeightMultipleForWeightBasedPlacement
public int getBookieMaxWeightMultipleForWeightBasedPlacement()Returns the max multiple to use for nodes with very high weight.- Returns:
- max multiple
-
getBookieInfoTimeout
public int getBookieInfoTimeout()Return the timeout value for getBookieInfo request.- Returns:
-
getStartTLSTimeout
public int getStartTLSTimeout()Return the timeout value for startTLS request.- Returns:
-
setDiskWeightBasedPlacementEnabled
Set whether or not disk weight based placement is enabled.- Parameters:
isEnabled- - boolean indicating enabled or not- Returns:
- client configuration
-
setGetBookieInfoIntervalSeconds
Set the time interval between successive polls for bookie get info.- Parameters:
pollInterval-unit-- Returns:
- client configuration
-
setGetBookieInfoRetryIntervalSeconds
Set the time interval between retries on unsuccessful GetInfo requests.- Parameters:
interval-unit-- Returns:
- client configuration
-
setBookieMaxWeightMultipleForWeightBasedPlacement
Set the max multiple to use for nodes with very high weight.- Parameters:
multiple-- Returns:
- client configuration
-
setGetBookieInfoTimeout
Set the timeout value in secs for the GET_BOOKIE_INFO request.- Parameters:
timeoutSecs-- Returns:
- client configuration
-
setStartTLSTimeout
Set the timeout value in secs for the START_TLS request.- Parameters:
timeoutSecs-- Returns:
- client configuration
-
getHostnameVerificationEnabled
public boolean getHostnameVerificationEnabled()Whether hostname verification enabled?- Returns:
- true if hostname verification enabled, otherwise false.
-
setHostnameVerificationEnabled
Enable/Disable hostname verification for tls connection.- Parameters:
enabled- flag to enable/disable tls hostname verification.- Returns:
- client configuration.
-
setClientRole
Set the client role.- Parameters:
role- defines how the client will act- Returns:
- client configuration
-
getClientRole
Get the role of the client.- Returns:
- the type of client
-
getTLSKeyStoreType
Get the keystore 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:
-
getTLSTrustStoreType
Get the truststore 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:
-
getOpportunisticStriping
public boolean getOpportunisticStriping()Whether to allow opportunistic striping.- Returns:
- true if opportunistic striping is enabled
-
setOpportunisticStriping
Enable/Disable opportunistic striping.If set to true, when you are creating a ledger with a given ensemble size, the system will automatically handle the lack of enough bookies, reducing ensemble size up to the write quorum size. This way in little clusters you can try to use striping (ensemble size > write quorum size) in case that you have enough bookies up and running, and degrade automatically to the minimum requested replication count.
- Parameters:
enabled- flag to enable/disable opportunistic striping.- Returns:
- client configuration.
-
getDelayEnsembleChange
public boolean getDelayEnsembleChange()Whether to delay ensemble change or not?- Returns:
- true if to delay ensemble change, otherwise false.
-
setDelayEnsembleChange
Enable/Disable delaying ensemble change.If set to true, ensemble change only happens when it can't meet ack quorum requirement. If set to false, ensemble change happens immediately when it received a failed write.
- Parameters:
enabled- flag to enable/disable delaying ensemble change.- Returns:
- client configuration.
-
getEnableBookieAddressTracking
public boolean getEnableBookieAddressTracking()Whether to enable bookie address changes tracking.- Returns:
- flag to enable/disable bookie address changes tracking
-
setEnableBookieAddressTracking
Enable/Disable bookie address changes tracking.- Parameters:
value- flag to enable/disable bookie address changes tracking- Returns:
- client configuration.
-
getEnableBookieFailureTracking
public boolean getEnableBookieFailureTracking()Whether to enable bookie failure tracking.- Returns:
- flag to enable/disable bookie failure tracking
-
setEnableBookieFailureTracking
Enable/Disable bookie failure tracking.- Parameters:
enabled- flag to enable/disable bookie failure tracking- Returns:
- client configuration.
-
getBookieFailureHistoryExpirationMSec
public int getBookieFailureHistoryExpirationMSec()Get the bookie failure tracking expiration timeout.- Returns:
- bookie failure tracking expiration timeout.
-
setBookieFailureHistoryExpirationMSec
Set the bookie failure tracking expiration timeout.- Parameters:
expirationMSec- bookie failure tracking expiration timeout.- Returns:
- client configuration.
-
getDisableEnsembleChangeFeatureName
Get the name of the dynamic feature that disables ensemble change.- Returns:
- name of the dynamic feature that disables ensemble change
-
setDisableEnsembleChangeFeatureName
public ClientConfiguration setDisableEnsembleChangeFeatureName(String disableEnsembleChangeFeatureName) Set the name of the dynamic feature that disables ensemble change.- Parameters:
disableEnsembleChangeFeatureName- name of the dynamic feature that disables ensemble change- Returns:
- client configuration.
-
getMaxAllowedEnsembleChanges
public int getMaxAllowedEnsembleChanges()Get the max allowed ensemble change number.- Returns:
- value of MaxAllowedEnsembleChanges, default MAX_VALUE, indicating feature is disable.
-
setMaxAllowedEnsembleChanges
Set the max allowed ensemble change number.- Parameters:
num- value of MaxAllowedEnsembleChanges- Returns:
- client configuration.
-
isNettyUsePooledBuffers
Deprecated.Option to use Netty Pooled ByteBufs.- Returns:
- the value of the option
-
setNettyUsePooledBuffers
Deprecated.Enable/Disable the usage of Pooled Netty buffers. While using v2 wire protocol the application will be responsible for releasing ByteBufs returned by BookKeeper.- Parameters:
enabled- if enabled BookKeeper will use default Pooled Netty Buffer allocator- See Also:
-
setUseV2WireProtocol(boolean)ReferenceCounted.release()LedgerHandle.readEntries(long, long)
-
setRegistrationClientClass
@Deprecated public ClientConfiguration setRegistrationClientClass(Class<? extends RegistrationClient> regClientClass) Deprecated.since 4.7.0Set registration manager class.- Parameters:
regClientClass- ClientClass
-
getRegistrationClientClass
@Deprecated public Class<? extends RegistrationClient> getRegistrationClientClass() throws org.apache.commons.configuration2.ex.ConfigurationExceptionDeprecated.since 4.7.0Get Registration Client Class.- Returns:
- registration manager class.
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException
-
setStoreSystemtimeAsLedgerCreationTime
Enable the client to use system time as the ledger creation time.If this is enabled, the client will write a ctime field into the ledger metadata. Otherwise, nothing will be written. The creation time of this ledger will be the ctime of the metadata record in metadata store.
- Parameters:
enabled- flag to enable/disable client using system time as the ledger creation time.
-
getStoreSystemtimeAsLedgerCreationTime
public boolean getStoreSystemtimeAsLedgerCreationTime()Return the flag that indicates whether client is using system time as the ledger creation time when creating ledgers.- Returns:
- the flag that indicates whether client is using system time as the ledger creation time when creating ledgers.
-
setBatchReadEnabled
-
isBatchReadEnabled
public boolean isBatchReadEnabled() -
setTcpKeepIdle
Set TCP_KEEPIDLE value for SO_KEEPALIVE.- Parameters:
keepIdle- time in seconds- Returns:
- client configuration
-
getTcpKeepIdle
public int getTcpKeepIdle()Get TCP_KEEPIDLE value for SO_KEEPALIVE.- Returns:
- time in seconds, -1 means use system default
-
setTcpKeepIntvl
Set TCP_KEEPINTVL value for SO_KEEPALIVE.- Parameters:
keepIntvl- time in seconds- Returns:
- client configuration
-
getTcpKeepIntvl
public int getTcpKeepIntvl()Get TCP_KEEPINTVL value for SO_KEEPALIVE.- Returns:
- time in seconds, -1 means use system default
-
setTcpKeepCnt
Set TCP_KEEPCNT value for SO_KEEPALIVE.- Parameters:
keepCnt- count- Returns:
- client configuration
-
getTcpKeepCnt
public int getTcpKeepCnt()Get TCP_KEEPCNT value for SO_KEEPALIVE.- Returns:
- count, -1 means use system default
-
getThis
Description copied from class:AbstractConfigurationTrickery to allow inheritance with fluent style.- Specified by:
getThisin classAbstractConfiguration<ClientConfiguration>
-
AbstractConfiguration.TLS_KEYSTORE