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