Package org.apache.hadoop.hbase.client
Class AsyncTableBuilderBase<C extends ScanResultConsumerBase>
java.lang.Object
org.apache.hadoop.hbase.client.AsyncTableBuilderBase<C>
- All Implemented Interfaces:
AsyncTableBuilder<C>
@Private
abstract class AsyncTableBuilderBase<C extends ScanResultConsumerBase>
extends Object
implements AsyncTableBuilder<C>
Base class for all asynchronous table builders.
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected long
protected long
protected long
protected long
protected long
protected long
protected int
protected TableName
protected long
-
Constructor Summary
ConstructorDescriptionAsyncTableBuilderBase
(TableName tableName, AsyncConnectionConfiguration connConf) -
Method Summary
Modifier and TypeMethodDescriptionsetMaxAttempts
(int maxAttempts) Set the max attempt 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.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.client.AsyncTableBuilder
build, setMaxRetries, setRetryPauseForCQTBE
-
Field Details
-
tableName
-
operationTimeoutNs
-
scanTimeoutNs
-
rpcTimeoutNs
-
readRpcTimeoutNs
-
writeRpcTimeoutNs
-
pauseNs
-
pauseNsForServerOverloaded
-
maxAttempts
-
startLogErrorsCnt
-
requestAttributes
-
-
Constructor Details
-
AsyncTableBuilderBase
AsyncTableBuilderBase(TableName tableName, AsyncConnectionConfiguration connConf)
-
-
Method Details
-
setOperationTimeout
Description copied from interface:AsyncTableBuilder
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.
- Specified by:
setOperationTimeout
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
- See Also:
-
setScanTimeout
Description copied from interface:AsyncTableBuilder
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.- Specified by:
setScanTimeout
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
- See Also:
-
setRpcTimeout
Description copied from interface:AsyncTableBuilder
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).
- Specified by:
setRpcTimeout
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
-
setReadRpcTimeout
Description copied from interface:AsyncTableBuilder
Set timeout for each read(get, scan) rpc request.- Specified by:
setReadRpcTimeout
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
-
setWriteRpcTimeout
Description copied from interface:AsyncTableBuilder
Set timeout for each write(put, delete) rpc request.- Specified by:
setWriteRpcTimeout
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
-
setRetryPause
Description copied from interface:AsyncTableBuilder
Set the base pause time for retrying. We use an exponential policy to generate sleep time when retrying.- Specified by:
setRetryPause
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
- See Also:
-
setRetryPauseForServerOverloaded
Description copied from interface:AsyncTableBuilder
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 aboveAsyncTableBuilder.setRetryPause(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.- Specified by:
setRetryPauseForServerOverloaded
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
- See Also:
-
setMaxAttempts
Description copied from interface:AsyncTableBuilder
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.- Specified by:
setMaxAttempts
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
- See Also:
-
setStartLogErrorsCnt
Description copied from interface:AsyncTableBuilder
Set the number of retries that are allowed before we start to log.- Specified by:
setStartLogErrorsCnt
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
-
setRequestAttribute
Description copied from interface:AsyncTableBuilder
Set a request attribute- Specified by:
setRequestAttribute
in interfaceAsyncTableBuilder<C extends ScanResultConsumerBase>
-