(final Object arg)
| 2426 | |
| 2427 | final class RetryRpc implements Callback<Deferred<Object>, Object> { |
| 2428 | public Deferred<Object> call(final Object arg) { |
| 2429 | if (arg instanceof NonRecoverableException) { |
| 2430 | // No point in retrying here, so fail the RPC. |
| 2431 | HBaseException e = (NonRecoverableException) arg; |
| 2432 | if (e instanceof HasFailedRpcException |
| 2433 | && ((HasFailedRpcException) e).getFailedRpc() != request) { |
| 2434 | // If we get here it's because a dependent RPC (such as a META |
| 2435 | // lookup) has failed. Therefore the exception we're getting |
| 2436 | // indicates that the META lookup failed, but we need to return |
| 2437 | // to our caller here that it's their RPC that failed. Here we |
| 2438 | // re-create the exception but with the correct RPC in argument. |
| 2439 | e = e.make(e, request); // e is likely a PleaseThrottleException. |
| 2440 | } |
| 2441 | request.callback(e); |
| 2442 | return Deferred.fromError(e); |
| 2443 | } |
| 2444 | return sendRpcToRegion(request); // Retry the RPC. |
| 2445 | } |
| 2446 | public String toString() { |
| 2447 | return "retry RPC"; |
| 2448 | } |
nothing calls this directly
no test coverage detected