Package org.apache.hadoop.hbase.client
Interface AsyncTableBuilder<C extends ScanResultConsumerBase>
- All Known Implementing Classes:
AsyncTableBuilderBase
For creating
AsyncTable
.
The implementation should have default configurations set before returning the builder to user. So users are free to only set the configs they care about to create a new AsyncTable/RawAsyncTable instance.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create theAsyncTable
instance.setMaxAttempts
(int maxAttempts) Set the max attempt times for an operation.default AsyncTableBuilder<C>
setMaxRetries
(int maxRetries) Set the max retry times for an operation.setOperationTimeout
(long timeout, TimeUnit unit) Set timeout for a whole operation such as get, put or delete.setReadRpcTimeout
(long timeout, TimeUnit unit) Set timeout for each read(get, scan) rpc request.setRequestAttribute
(String key, byte[] value) Set a request attributesetRetryPause
(long pause, TimeUnit unit) Set the base pause time for retrying.default AsyncTableBuilder<C>
setRetryPauseForCQTBE
(long pause, TimeUnit unit) Deprecated.Since 2.5.0, will be removed in 4.0.0.setRetryPauseForServerOverloaded
(long pause, TimeUnit unit) Set the base pause time for retrying whenHBaseServerException.isServerOverloaded()
.setRpcTimeout
(long timeout, TimeUnit unit) Set timeout for each rpc request.setScanTimeout
(long timeout, TimeUnit unit) As now we have heartbeat support for scan, ideally a scan will never timeout unless the RS is crash.setStartLogErrorsCnt
(int startLogErrorsCnt) Set the number of retries that are allowed before we start to log.setWriteRpcTimeout
(long timeout, TimeUnit unit) Set timeout for each write(put, delete) rpc request.
-
Method Details
-
setOperationTimeout
Set timeout for a whole operation such as get, put or delete. Notice that scan will not be effected by this value, see scanTimeoutNs.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.
-
setScanTimeout
As now we have heartbeat support for scan, ideally a scan will never timeout unless the RS is crash. The RS will always return something before the rpc timed out or scan timed out to tell the client that it is still alive. The scan timeout is used as operation timeout for every operation in a scan, such as openScanner or next.- See Also:
-
setRpcTimeout
Set timeout for each rpc request.Notice that this will NOT change the rpc timeout for read(get, scan) request and write request(put, delete).
-
setReadRpcTimeout
Set timeout for each read(get, scan) rpc request. -
setWriteRpcTimeout
Set timeout for each write(put, delete) rpc request. -
setRetryPause
Set the base pause time for retrying. We use an exponential policy to generate sleep time when retrying. -
setRetryPauseForCQTBE
Deprecated.Since 2.5.0, will be removed in 4.0.0. Please usesetRetryPauseForServerOverloaded(long, TimeUnit)
instead.Set the base pause time for retrying whenHBaseServerException.isServerOverloaded()
. 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 abovesetRetryPause(long, TimeUnit)
method, as usuallyHBaseServerException.isServerOverloaded()
means the server is overloaded. We just use the normal pause value forHBaseServerException.isServerOverloaded()
if here you specify a smaller value.- See Also:
-
setRetryPauseForServerOverloaded
Set the base pause time for retrying whenHBaseServerException.isServerOverloaded()
. 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 abovesetRetryPause(long, TimeUnit)
method, as usuallyHBaseServerException.isServerOverloaded()
means the server is overloaded. We just use the normal pause value forHBaseServerException.isServerOverloaded()
if here you specify a smaller value.- See Also:
-
setMaxRetries
Set the max retry times for an operation. Usually it is the max attempt times minus 1.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.
-
setMaxAttempts
Set the max attempt times for an operation. Usually it is the max retry times plus 1. 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. -
setStartLogErrorsCnt
Set the number of retries that are allowed before we start to log. -
setRequestAttribute
Set a request attribute -
build
AsyncTable<C> build()Create theAsyncTable
instance.
-