@InterfaceAudience.Private abstract class AsyncTableBuilderBase<C extends ScanResultConsumerBase> extends Object implements AsyncTableBuilder<C>
Modifier and Type | Field and Description |
---|---|
protected int |
maxAttempts |
protected long |
operationTimeoutNs |
protected long |
pauseForCQTBENs |
protected long |
pauseNs |
protected long |
readRpcTimeoutNs |
protected long |
rpcTimeoutNs |
protected long |
scanTimeoutNs |
protected int |
startLogErrorsCnt |
protected TableName |
tableName |
protected long |
writeRpcTimeoutNs |
Constructor and Description |
---|
AsyncTableBuilderBase(TableName tableName,
AsyncConnectionConfiguration connConf) |
Modifier and Type | Method and Description |
---|---|
AsyncTableBuilderBase<C> |
setMaxAttempts(int maxAttempts)
Set the max attempt times for an operation.
|
AsyncTableBuilderBase<C> |
setOperationTimeout(long timeout,
TimeUnit unit)
Set timeout for a whole operation such as get, put or delete.
|
AsyncTableBuilderBase<C> |
setReadRpcTimeout(long timeout,
TimeUnit unit)
Set timeout for each read(get, scan) rpc request.
|
AsyncTableBuilderBase<C> |
setRetryPause(long pause,
TimeUnit unit)
Set the base pause time for retrying.
|
AsyncTableBuilderBase<C> |
setRetryPauseForCQTBE(long pause,
TimeUnit unit)
Set the base pause time for retrying when we hit
CallQueueTooBigException . |
AsyncTableBuilderBase<C> |
setRpcTimeout(long timeout,
TimeUnit unit)
Set timeout for each rpc request.
|
AsyncTableBuilderBase<C> |
setScanTimeout(long timeout,
TimeUnit unit)
As now we have heartbeat support for scan, ideally a scan will never timeout unless the RS is
crash.
|
AsyncTableBuilderBase<C> |
setStartLogErrorsCnt(int startLogErrorsCnt)
Set the number of retries that are allowed before we start to log.
|
AsyncTableBuilderBase<C> |
setWriteRpcTimeout(long timeout,
TimeUnit unit)
Set timeout for each write(put, delete) rpc request.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
build, setMaxRetries
protected long operationTimeoutNs
protected long scanTimeoutNs
protected long rpcTimeoutNs
protected long readRpcTimeoutNs
protected long writeRpcTimeoutNs
protected long pauseNs
protected long pauseForCQTBENs
protected int maxAttempts
protected int startLogErrorsCnt
AsyncTableBuilderBase(TableName tableName, AsyncConnectionConfiguration connConf)
public AsyncTableBuilderBase<C> setOperationTimeout(long timeout, TimeUnit unit)
AsyncTableBuilder
Operation timeout and max attempt times(or max retry times) are both limitations for retrying, we will stop retrying when we reach any of the limitations.
setOperationTimeout
in interface AsyncTableBuilder<C extends ScanResultConsumerBase>
AsyncTableBuilder.setMaxAttempts(int)
,
AsyncTableBuilder.setMaxRetries(int)
,
AsyncTableBuilder.setScanTimeout(long, TimeUnit)
public AsyncTableBuilderBase<C> setScanTimeout(long timeout, TimeUnit unit)
AsyncTableBuilder
setScanTimeout
in interface AsyncTableBuilder<C extends ScanResultConsumerBase>
AsyncTableBuilder.setScanTimeout(long, TimeUnit)
public AsyncTableBuilderBase<C> setRpcTimeout(long timeout, TimeUnit unit)
AsyncTableBuilder
Notice that this will NOT change the rpc timeout for read(get, scan) request and write request(put, delete).
setRpcTimeout
in interface AsyncTableBuilder<C extends ScanResultConsumerBase>
public AsyncTableBuilderBase<C> setReadRpcTimeout(long timeout, TimeUnit unit)
AsyncTableBuilder
setReadRpcTimeout
in interface AsyncTableBuilder<C extends ScanResultConsumerBase>
public AsyncTableBuilderBase<C> setWriteRpcTimeout(long timeout, TimeUnit unit)
AsyncTableBuilder
setWriteRpcTimeout
in interface AsyncTableBuilder<C extends ScanResultConsumerBase>
public AsyncTableBuilderBase<C> setRetryPause(long pause, TimeUnit unit)
AsyncTableBuilder
setRetryPause
in interface AsyncTableBuilder<C extends ScanResultConsumerBase>
AsyncTableBuilder.setRetryPauseForCQTBE(long, TimeUnit)
public AsyncTableBuilderBase<C> setRetryPauseForCQTBE(long pause, TimeUnit unit)
AsyncTableBuilder
CallQueueTooBigException
. We use an
exponential policy to generate sleep time when retrying.
This value should be greater than the normal pause value which could be set with the above
AsyncTableBuilder.setRetryPause(long, TimeUnit)
method, as usually CallQueueTooBigException
means the server is overloaded. We just use the normal pause value for
CallQueueTooBigException
if here you specify a smaller value.setRetryPauseForCQTBE
in interface AsyncTableBuilder<C extends ScanResultConsumerBase>
AsyncTableBuilder.setRetryPause(long, TimeUnit)
public AsyncTableBuilderBase<C> setMaxAttempts(int maxAttempts)
AsyncTableBuilder
setMaxAttempts
in interface AsyncTableBuilder<C extends ScanResultConsumerBase>
AsyncTableBuilder.setMaxRetries(int)
,
AsyncTableBuilder.setOperationTimeout(long, TimeUnit)
public AsyncTableBuilderBase<C> setStartLogErrorsCnt(int startLogErrorsCnt)
AsyncTableBuilder
setStartLogErrorsCnt
in interface AsyncTableBuilder<C extends ScanResultConsumerBase>
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.