public class ClientConfiguration extends AbstractConfiguration
AVAILABLE_NODE, defaultLoader, LEDGER_MANAGER_FACTORY_CLASS, LEDGER_MANAGER_TYPE, METASTORE_IMPL_CLASS, METASTORE_MAX_ENTRIES_PER_SCAN, REREPLICATION_ENTRY_BATCH_SIZE, ZK_LEDGERS_ROOT_PATH
Constructor and Description |
---|
ClientConfiguration()
Construct a default client-side configuration
|
ClientConfiguration(AbstractConfiguration conf)
Construct a client-side configuration using a base configuration
|
Modifier and Type | Method and 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.
|
long |
getBookieErrorThresholdPerInterval()
Get the error threshold for a bookie to be quarantined.
|
int |
getBookieHealthCheckIntervalSeconds()
Get the bookie health check interval in seconds.
|
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
|
String |
getClientAuthProviderFactoryClass()
Get the client authentication provider factory class name.
|
int |
getClientConnectTimeoutMillis()
Get client netty connect timeout in millis.
|
int |
getClientReceiveBufferSize()
Get client netty channel receive buffer size.
|
int |
getClientSendBufferSize()
Get client netty channel send buffer size.
|
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 |
getEnableTaskExecutionStats()
Whether to enable recording task execution stats.
|
Class<? extends EnsemblePlacementPolicy> |
getEnsemblePlacementPolicy()
Get Ensemble Placement Policy Class.
|
int |
getNumChannelsPerBookie()
Get num channels per bookie.
|
int |
getNumWorkerThreads()
Get the number of worker threads.
|
int |
getPCBCTimeoutTimerNumTicks()
Get number of ticks that used for
HashedWheelTimer that used by PCBC to timeout
requests. |
long |
getPCBCTimeoutTimerTickDurationMs()
Get the tick duration in milliseconds that used for the
HashedWheelTimer that used by PCBC to timeout
requests. |
int |
getReadEntryTimeout()
Get the timeout for read entry.
|
int |
getReadTimeout()
Deprecated.
use
getReadEntryTimeout() or getAddEntryTimeout() instead |
int |
getSpeculativeReadTimeout()
Get the period of time after which a speculative entry read should be triggered.
|
long |
getTaskExecutionWarnTimeMicros()
Get task execution duration which triggers a warning.
|
int |
getThrottleValue()
Get throttle value
|
long |
getTimeoutTaskIntervalMillis()
Deprecated.
|
String |
getZkServers()
Get zookeeper servers to connect
|
int |
getZkTimeout()
Get zookeeper timeout
|
boolean |
isBookieHealthCheckEnabled()
Check if bookie health check is enabled.
|
ClientConfiguration |
setAddEntryQuorumTimeout(int timeout)
Set timeout for top-level add entry request.
|
ClientConfiguration |
setAddEntryTimeout(int timeout)
Set timeout for add entry request.
|
ClientConfiguration |
setBookieErrorThresholdPerInterval(long thresholdPerInterval)
Set the error threshold per interval (
getBookieHealthCheckIntervalSeconds() ) for a bookie before it is
quarantined. |
ClientConfiguration |
setBookieHealthCheckInterval(int interval,
TimeUnit unit)
Set the bookie health check interval.
|
ClientConfiguration |
setBookieQuarantineTime(int quarantineTime,
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 |
setClientAuthProviderFactoryClass(String factoryClass)
Set the client authentication provider factory class name.
|
ClientConfiguration |
setClientConnectTimeoutMillis(int connectTimeoutMillis)
Set client netty connect timeout in millis.
|
ClientConfiguration |
setClientReceiveBufferSize(int bufferSize)
Set client netty channel receive buffer size.
|
ClientConfiguration |
setClientSendBufferSize(int bufferSize)
Set client netty channel send buffer size.
|
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 |
setEnableTaskExecutionStats(boolean enabled)
Enable/Disable recording task execution stats.
|
ClientConfiguration |
setEnsemblePlacementPolicy(Class<? extends EnsemblePlacementPolicy> policyClass)
Set Ensemble Placement Policy Class.
|
ClientConfiguration |
setNumChannelsPerBookie(int numChannelsPerBookie)
Set num channels per bookie.
|
ClientConfiguration |
setNumWorkerThreads(int numThreads)
Set the number of worker threads.
|
ClientConfiguration |
setPCBCTimeoutTimerNumTicks(int numTicks)
Set number of ticks that used for
HashedWheelTimer that used by PCBC to timeout request. |
ClientConfiguration |
setPCBCTimeoutTimerTickDurationMs(long tickDuration)
Set the tick duration in milliseconds that used for
HashedWheelTimer that used by PCBC to timeout
requests. |
ClientConfiguration |
setReadEntryTimeout(int timeout)
Set the timeout for read entry request.
|
ClientConfiguration |
setReadTimeout(int timeout)
Deprecated.
use
setReadEntryTimeout(int) or setAddEntryTimeout(int) instead |
ClientConfiguration |
setSpeculativeReadTimeout(int timeout)
Set the speculative read timeout.
|
ClientConfiguration |
setTaskExecutionWarnTimeMicros(long warnTime)
Set task execution duration which triggers a warning.
|
ClientConfiguration |
setThrottleValue(int throttle)
Set throttle value.
|
ClientConfiguration |
setTimeoutTaskIntervalMillis(long timeoutMillis)
Deprecated.
|
ClientConfiguration |
setZkServers(String zkServers)
Set zookeeper servers to connect
|
ClientConfiguration |
setZkTimeout(int zkTimeout)
Set zookeeper timeout
|
getLedgerManagerFactoryClass, getLedgerManagerType, getMetastoreImplClass, getMetastoreMaxEntriesPerScan, getRereplicationEntryBatchSize, getZkAvailableBookiesPath, getZkLedgersRootPath, loadConf, loadConf, loadConf, setLedgerManagerFactoryClass, setLedgerManagerFactoryClassName, setLedgerManagerType, setMetastoreImplClass, setMetastoreMaxEntriesPerScan, setRereplicationEntryBatchSize, setZkLedgersRootPath
addConfiguration, addPropertyDirect, clear, clearPropertyDirect, clone, containsKey, getConfiguration, getInMemoryConfiguration, getKeys, getKeys, getList, getNumberOfConfigurations, getProperty, getSource, getStringArray, isEmpty, removeConfiguration, setDelimiterParsingDisabled, setListDelimiter
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, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setLogger, setProperty, setThrowExceptionOnMissing, subset
addConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, createErrorEvent, createEvent, fireError, fireEvent, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEvents
protected static final String ZK_TIMEOUT
protected static final String ZK_SERVERS
protected static final String THROTTLE
protected static final String DIGEST_TYPE
protected static final String PASSWD
protected static final String CLIENT_TCP_NODELAY
protected static final String CLIENT_SENDBUFFER_SIZE
protected static final String CLIENT_RECEIVEBUFFER_SIZE
protected static final String CLIENT_WRITEBUFFER_LOW_WATER_MARK
protected static final String CLIENT_WRITEBUFFER_HIGH_WATER_MARK
protected static final String CLIENT_CONNECT_TIMEOUT_MILLIS
protected static final String NUM_CHANNELS_PER_BOOKIE
protected static final String READ_TIMEOUT
protected static final String SPECULATIVE_READ_TIMEOUT
protected static final String ADD_ENTRY_TIMEOUT_SEC
protected static final String ADD_ENTRY_QUORUM_TIMEOUT_SEC
protected static final String READ_ENTRY_TIMEOUT_SEC
protected static final String TIMEOUT_TASK_INTERVAL_MILLIS
protected static final String PCBC_TIMEOUT_TIMER_TICK_DURATION_MS
protected static final String PCBC_TIMEOUT_TIMER_NUM_TICKS
protected static final String BOOKIE_HEALTH_CHECK_ENABLED
protected static final String BOOKIE_HEALTH_CHECK_INTERVAL_SECONDS
protected static final String BOOKIE_ERROR_THRESHOLD_PER_INTERVAL
protected static final String BOOKIE_QUARANTINE_TIME_SECONDS
protected static final String NUM_WORKER_THREADS
protected static final String ENSEMBLE_PLACEMENT_POLICY
protected static final String ENABLE_TASK_EXECUTION_STATS
protected static final String TASK_EXECUTION_WARN_TIME_MICROS
protected static final String CLIENT_AUTH_PROVIDER_FACTORY_CLASS
public ClientConfiguration()
public ClientConfiguration(AbstractConfiguration conf)
conf
- Base configurationpublic int getThrottleValue()
setThrottleValue(int)
public ClientConfiguration setThrottleValue(int throttle)
throttle
- Throttle Valuepublic BookKeeper.DigestType getBookieRecoveryDigestType()
setBookieRecoveryDigestType(org.apache.bookkeeper.client.BookKeeper.DigestType)
public ClientConfiguration setBookieRecoveryDigestType(BookKeeper.DigestType digestType)
digestType
- Digest Typepublic byte[] getBookieRecoveryPasswd()
setBookieRecoveryPasswd(byte[])
public ClientConfiguration setBookieRecoveryPasswd(byte[] passwd)
passwd
- Passwordpublic boolean getClientTcpNoDelay()
setClientTcpNoDelay(boolean)
public ClientConfiguration setClientTcpNoDelay(boolean noDelay)
noDelay
- NoDelay settingpublic int getClientSendBufferSize()
public ClientConfiguration setClientSendBufferSize(int bufferSize)
bufferSize
- client netty channel send buffer size.public int getClientReceiveBufferSize()
public ClientConfiguration setClientReceiveBufferSize(int bufferSize)
bufferSize
- netty channel receive buffer size.public int getClientWriteBufferLowWaterMark()
public ClientConfiguration setClientWriteBufferLowWaterMark(int waterMark)
waterMark
- netty channel write buffer low water mark.public int getClientWriteBufferHighWaterMark()
public ClientConfiguration setClientWriteBufferHighWaterMark(int waterMark)
waterMark
- netty channel write buffer high water mark.public int getClientConnectTimeoutMillis()
public ClientConfiguration setClientConnectTimeoutMillis(int connectTimeoutMillis)
connectTimeoutMillis
- client netty connect timeout in millis.public int getNumChannelsPerBookie()
public ClientConfiguration setNumChannelsPerBookie(int numChannelsPerBookie)
numChannelsPerBookie
- num channels per bookie.public String getZkServers()
public ClientConfiguration setZkServers(String zkServers)
zkServers
- ZooKeeper servers to connectpublic int getZkTimeout()
public ClientConfiguration setZkTimeout(int zkTimeout)
zkTimeout
- ZooKeeper client timeout@Deprecated public int getReadTimeout()
@Deprecated public ClientConfiguration setReadTimeout(int timeout)
timeout
- The new read timeout in secondsgetReadTimeout()
public int getAddEntryTimeout()
public ClientConfiguration setAddEntryTimeout(int timeout)
timeout
- The new add entry timeout in seconds.getAddEntryTimeout()
public int getAddEntryQuorumTimeout()
public ClientConfiguration setAddEntryQuorumTimeout(int timeout)
timeout
- The new add entry ack quorum timeout in seconds.getAddEntryQuorumTimeout()
public int getReadEntryTimeout()
getReadTimeout()
.public ClientConfiguration setReadEntryTimeout(int timeout)
timeout
- The new read entry timeout in seconds.getReadEntryTimeout()
@Deprecated public long getTimeoutTaskIntervalMillis()
@Deprecated public ClientConfiguration setTimeoutTaskIntervalMillis(long timeoutMillis)
public long getPCBCTimeoutTimerTickDurationMs()
HashedWheelTimer
that used by PCBC to timeout
requests.HashedWheelTimer
public ClientConfiguration setPCBCTimeoutTimerTickDurationMs(long tickDuration)
HashedWheelTimer
that used by PCBC to timeout
requests. Be aware of HashedWheelTimer
if you
are going to modify this setting.tickDuration
- tick duration in milliseconds.getPCBCTimeoutTimerTickDurationMs()
public int getPCBCTimeoutTimerNumTicks()
HashedWheelTimer
that used by PCBC to timeout
requests.HashedWheelTimer
public ClientConfiguration setPCBCTimeoutTimerNumTicks(int numTicks)
HashedWheelTimer
that used by PCBC to timeout request.
Be aware of HashedWheelTimer
if you are going to modify
this setting.numTicks
- number of ticks that used for timeout timer.getPCBCTimeoutTimerNumTicks()
public int getNumWorkerThreads()
public ClientConfiguration setNumWorkerThreads(int numThreads)
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.
numThreads
- number of worker threads used for bookkeepergetNumWorkerThreads()
public int getSpeculativeReadTimeout()
LedgerHandle.asyncReadEntries(long, long, org.apache.bookkeeper.client.AsyncCallback.ReadCallback, java.lang.Object)
public ClientConfiguration setSpeculativeReadTimeout(int timeout)
timeout
- the timeout value, in millisecondsgetSpeculativeReadTimeout()
public Class<? extends EnsemblePlacementPolicy> getEnsemblePlacementPolicy() throws org.apache.commons.configuration.ConfigurationException
org.apache.commons.configuration.ConfigurationException
public ClientConfiguration setEnsemblePlacementPolicy(Class<? extends EnsemblePlacementPolicy> policyClass)
policyClass
- Ensemble Placement Policy Class.public boolean getEnableTaskExecutionStats()
public ClientConfiguration setEnableTaskExecutionStats(boolean enabled)
enabled
- flag to enable/disable recording task execution stats.public long getTaskExecutionWarnTimeMicros()
public ClientConfiguration setTaskExecutionWarnTimeMicros(long warnTime)
warnTime
- time in microseconds which triggers a warning.public boolean isBookieHealthCheckEnabled()
public ClientConfiguration enableBookieHealthCheck()
If the number of read/write errors for a bookie exceeds getBookieErrorThresholdPerInterval()
per
interval, that bookie is quarantined for getBookieQuarantineTimeSeconds()
seconds. During this
quarantined period, the client will try not to use this bookie when creating new ensembles.
public int getBookieHealthCheckIntervalSeconds()
public ClientConfiguration setBookieHealthCheckInterval(int interval, TimeUnit unit)
Note: Please enableBookieHealthCheck()
to use this configuration.
interval
- unit
- public long getBookieErrorThresholdPerInterval()
public ClientConfiguration setBookieErrorThresholdPerInterval(long thresholdPerInterval)
getBookieHealthCheckIntervalSeconds()
) for a bookie before it is
quarantined. Default is 100 errors per minute.
Note: Please enableBookieHealthCheck()
to use this configuration.
threshold
- unit
- public int getBookieQuarantineTimeSeconds()
public ClientConfiguration setBookieQuarantineTime(int quarantineTime, TimeUnit unit)
Note: Please enableBookieHealthCheck()
to use this configuration.
quarantineTime
- unit
- public ClientConfiguration setClientAuthProviderFactoryClass(String factoryClass)
factoryClass
- the client authentication provider factory class namepublic String getClientAuthProviderFactoryClass()
Copyright © 2011-2016 The Apache Software Foundation. All Rights Reserved.