Package org.apache.hadoop.hbase.client
Class AsyncBatchRpcRetryingCaller<T>
java.lang.Object
org.apache.hadoop.hbase.client.AsyncBatchRpcRetryingCaller<T>
Retry caller for batch.
Notice that, the operationTimeoutNs is the total time limit now which is the same with
other single operations
And the maxAttempts is a limit for each single operation in the batch logically. In the
implementation, we will record a tries parameter for each operation group, and if it is
split to several groups when retrying, the sub groups will inherit the tries. You can
imagine that the whole retrying process is a tree, and the maxAttempts is the limit of
the depth of the tree.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IdentityHashMap<Action,List<RetriesExhaustedException.ThrowableWithExtraContext>> private final IdentityHashMap<Action,CompletableFuture<T>> private final AsyncConnectionImplprivate final List<CompletableFuture<T>>private static final org.slf4j.Loggerprivate static final intprivate final intprivate final longprivate final HBaseServerExceptionPauseManagerprivate final org.apache.hbase.thirdparty.io.netty.util.Timerprivate final longprivate final intprivate final longprivate final TableName -
Constructor Summary
ConstructorsConstructorDescriptionAsyncBatchRpcRetryingCaller(org.apache.hbase.thirdparty.io.netty.util.Timer retryTimer, AsyncConnectionImpl conn, TableName tableName, List<? extends Row> actions, long pauseNs, long pauseNsForServerOverloaded, int maxAttempts, long operationTimeoutNs, long rpcTimeoutNs, int startLogErrorsCnt, Map<String, byte[]> requestAttributes) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddError(Iterable<Action> actions, Throwable error, ServerName serverName) private voidaddError(Action action, Throwable error, ServerName serverName) private org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiRequestbuildReq(Map<byte[], AsyncBatchRpcRetryingCaller.RegionRequest> actionsByRegion, List<ExtendedCellScannable> cells, Map<Integer, Integer> indexMap) call()private voidprivate voidfailAll(Stream<Action> actions, int tries, Throwable error, ServerName serverName) private voidprivate StringgetExtraContextForError(ServerName serverName) private voidgroupAndSend(Stream<Action> actions, int tries) private static booleanhasIncrementOrAppend(Row action) private static booleanhasIncrementOrAppend(RowMutations mutations) (package private) static voidlogActionsException(int tries, int startLogErrorsCnt, AsyncBatchRpcRetryingCaller.RegionRequest regionReq, IdentityHashMap<Action, Throwable> action2Error, ServerName serverName) private voidlogRegionsException(int tries, Supplier<Stream<AsyncBatchRpcRetryingCaller.RegionRequest>> regionsSupplier, Throwable error, ServerName serverName) private voidonComplete(Map<byte[], AsyncBatchRpcRetryingCaller.RegionRequest> actionsByRegion, int tries, ServerName serverName, MultiResponse resp) private voidonComplete(Action action, AsyncBatchRpcRetryingCaller.RegionRequest regionReq, int tries, ServerName serverName, MultiResponse.RegionResult regionResult, List<Action> failedActions, Throwable regionException, org.apache.commons.lang3.mutable.MutableBoolean retryImmediately, IdentityHashMap<Action, Throwable> action2Error) private voidonError(Map<byte[], AsyncBatchRpcRetryingCaller.RegionRequest> actionsByRegion, int tries, Throwable t, ServerName serverName) removeErrors(Action action) private voidsendOrDelay(Map<ServerName, AsyncBatchRpcRetryingCaller.ServerRequest> actionsByServer, int tries) private voidsendToServer(ServerName serverName, AsyncBatchRpcRetryingCaller.ServerRequest serverReq, int tries) private voidtryResubmit(Stream<Action> actions, int tries, boolean immediately, Throwable error)
-
Field Details
-
LOG
-
retryTimer
-
conn
-
tableName
-
actions
-
futures
-
action2Future
-
action2Errors
-
maxAttempts
-
operationTimeoutNs
-
rpcTimeoutNs
-
startLogErrorsCnt
-
startNs
-
pauseManager
-
requestAttributes
-
MAX_SAMPLED_ERRORS
- See Also:
-
-
Constructor Details
-
AsyncBatchRpcRetryingCaller
public AsyncBatchRpcRetryingCaller(org.apache.hbase.thirdparty.io.netty.util.Timer retryTimer, AsyncConnectionImpl conn, TableName tableName, List<? extends Row> actions, long pauseNs, long pauseNsForServerOverloaded, int maxAttempts, long operationTimeoutNs, long rpcTimeoutNs, int startLogErrorsCnt, Map<String, byte[]> requestAttributes)
-
-
Method Details
-
hasIncrementOrAppend
-
hasIncrementOrAppend
-
removeErrors
-
logRegionsException
private void logRegionsException(int tries, Supplier<Stream<AsyncBatchRpcRetryingCaller.RegionRequest>> regionsSupplier, Throwable error, ServerName serverName) -
logActionsException
static void logActionsException(int tries, int startLogErrorsCnt, AsyncBatchRpcRetryingCaller.RegionRequest regionReq, IdentityHashMap<Action, Throwable> action2Error, ServerName serverName) -
getExtraContextForError
-
addError
-
addError
-
failOne
-
failAll
-
failAll
-
buildReq
private org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiRequest buildReq(Map<byte[], AsyncBatchRpcRetryingCaller.RegionRequest> actionsByRegion, List<ExtendedCellScannable> cells, Map<Integer, throws IOExceptionInteger> indexMap) - Throws:
IOException
-
onComplete
private void onComplete(Action action, AsyncBatchRpcRetryingCaller.RegionRequest regionReq, int tries, ServerName serverName, MultiResponse.RegionResult regionResult, List<Action> failedActions, Throwable regionException, org.apache.commons.lang3.mutable.MutableBoolean retryImmediately, IdentityHashMap<Action, Throwable> action2Error) -
onComplete
private void onComplete(Map<byte[], AsyncBatchRpcRetryingCaller.RegionRequest> actionsByRegion, int tries, ServerName serverName, MultiResponse resp) -
sendToServer
private void sendToServer(ServerName serverName, AsyncBatchRpcRetryingCaller.ServerRequest serverReq, int tries) -
sendOrDelay
private void sendOrDelay(Map<ServerName, AsyncBatchRpcRetryingCaller.ServerRequest> actionsByServer, int tries) -
onError
private void onError(Map<byte[], AsyncBatchRpcRetryingCaller.RegionRequest> actionsByRegion, int tries, Throwable t, ServerName serverName) -
tryResubmit
-
groupAndSend
-
call
-