Search in sources :

Example 1 with ThrowableWithExtraContext

use of org.apache.hadoop.hbase.client.RetriesExhaustedException.ThrowableWithExtraContext in project hbase by apache.

the class AsyncBatchRpcRetryingCaller method failOne.

private void failOne(Action action, int tries, Throwable error, long currentTime, String extras) {
    CompletableFuture<T> future = action2Future.get(action);
    if (future.isDone()) {
        return;
    }
    ThrowableWithExtraContext errorWithCtx = new ThrowableWithExtraContext(error, currentTime, extras);
    List<ThrowableWithExtraContext> errors = removeErrors(action);
    if (errors == null) {
        errors = Collections.singletonList(errorWithCtx);
    } else {
        errors.add(errorWithCtx);
    }
    future.completeExceptionally(new RetriesExhaustedException(tries - 1, errors));
}
Also used : ThrowableWithExtraContext(org.apache.hadoop.hbase.client.RetriesExhaustedException.ThrowableWithExtraContext)

Example 2 with ThrowableWithExtraContext

use of org.apache.hadoop.hbase.client.RetriesExhaustedException.ThrowableWithExtraContext in project hbase by apache.

the class AsyncBatchRpcRetryingCaller method addError.

private void addError(Action action, Throwable error, ServerName serverName) {
    List<ThrowableWithExtraContext> errors;
    synchronized (action2Errors) {
        errors = action2Errors.computeIfAbsent(action, k -> new ArrayList<>());
    }
    errors.add(new ThrowableWithExtraContext(error, EnvironmentEdgeManager.currentTime(), getExtraContextForError(serverName)));
}
Also used : ConnectionUtils.getPauseTime(org.apache.hadoop.hbase.client.ConnectionUtils.getPauseTime) ResponseConverter(org.apache.hadoop.hbase.shaded.protobuf.ResponseConverter) CompletableFuture(java.util.concurrent.CompletableFuture) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) ConcurrentMap(java.util.concurrent.ConcurrentMap) ConnectionUtils.translateException(org.apache.hadoop.hbase.client.ConnectionUtils.translateException) RegionResult(org.apache.hadoop.hbase.client.MultiResponse.RegionResult) Map(java.util.Map) ServerName(org.apache.hadoop.hbase.ServerName) Bytes(org.apache.hadoop.hbase.util.Bytes) CellScannable(org.apache.hadoop.hbase.CellScannable) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) TableName(org.apache.hadoop.hbase.TableName) IdentityHashMap(java.util.IdentityHashMap) CellUtil.createCellScanner(org.apache.hadoop.hbase.CellUtil.createCellScanner) ThrowableWithExtraContext(org.apache.hadoop.hbase.client.RetriesExhaustedException.ThrowableWithExtraContext) ClientProtos(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) IOException(java.io.IOException) HBaseRpcController(org.apache.hadoop.hbase.ipc.HBaseRpcController) CollectionUtils.computeIfAbsent(org.apache.hadoop.hbase.util.CollectionUtils.computeIfAbsent) Collectors(java.util.stream.Collectors) RequestConverter(org.apache.hadoop.hbase.shaded.protobuf.RequestConverter) TimeUnit(java.util.concurrent.TimeUnit) ConnectionUtils.resetController(org.apache.hadoop.hbase.client.ConnectionUtils.resetController) List(java.util.List) ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) Stream(java.util.stream.Stream) RegionSpecifierType(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType) HRegionLocation(org.apache.hadoop.hbase.HRegionLocation) SLEEP_DELTA_NS(org.apache.hadoop.hbase.client.ConnectionUtils.SLEEP_DELTA_NS) EnvironmentEdgeManager(org.apache.hadoop.hbase.util.EnvironmentEdgeManager) HashedWheelTimer(io.netty.util.HashedWheelTimer) Optional(java.util.Optional) Log(org.apache.commons.logging.Log) LogFactory(org.apache.commons.logging.LogFactory) InterfaceAudience(org.apache.hadoop.hbase.classification.InterfaceAudience) ClientService(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService) Collections(java.util.Collections) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) ThrowableWithExtraContext(org.apache.hadoop.hbase.client.RetriesExhaustedException.ThrowableWithExtraContext) ArrayList(java.util.ArrayList)

Aggregations

ThrowableWithExtraContext (org.apache.hadoop.hbase.client.RetriesExhaustedException.ThrowableWithExtraContext)2 HashedWheelTimer (io.netty.util.HashedWheelTimer)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 IdentityHashMap (java.util.IdentityHashMap)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)1 TimeUnit (java.util.concurrent.TimeUnit)1 Supplier (java.util.function.Supplier)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 Log (org.apache.commons.logging.Log)1 LogFactory (org.apache.commons.logging.LogFactory)1