@Override protected <T> T handleRetryExhausted(RecoveryCallback<T> recoveryCallback, RetryContext context, RetryState state) throws Throwable { BatchRetryState batchState = (BatchRetryState) state; BatchRetryContext batchContext = (BatchRetryContext) context; // Accumulate exceptions to be thrown so all the keys get a crack Throwable rethrowable = null; ExhaustedRetryException exhausted = null; Iterator<RetryContext> contextIterator = batchContext.contexts.iterator(); for (RetryState retryState : batchState.keys) { RetryContext nextContext = contextIterator.next(); try { super.handleRetryExhausted(null, nextContext, retryState); } catch (ExhaustedRetryException e) { exhausted = e; } catch (Throwable e) { rethrowable = e; } } if (recoveryCallback != null) { return recoveryCallback.recover(context); } if (exhausted != null) { throw exhausted; } throw rethrowable; }
return handleRetryExhausted(recoveryCallback, context, state);
@Override protected <T> T handleRetryExhausted(RecoveryCallback<T> recoveryCallback, RetryContext context, RetryState state) throws Throwable { BatchRetryState batchState = (BatchRetryState) state; BatchRetryContext batchContext = (BatchRetryContext) context; // Accumulate exceptions to be thrown so all the keys get a crack Throwable rethrowable = null; ExhaustedRetryException exhausted = null; Iterator<RetryContext> contextIterator = batchContext.contexts.iterator(); for (RetryState retryState : batchState.keys) { RetryContext nextContext = contextIterator.next(); try { super.handleRetryExhausted(null, nextContext, retryState); } catch (ExhaustedRetryException e) { exhausted = e; } catch (Throwable e) { rethrowable = e; } } if (recoveryCallback != null) { return recoveryCallback.recover(context); } if (exhausted != null) { throw exhausted; } throw rethrowable; }
@Override protected <T> T handleRetryExhausted(RecoveryCallback<T> recoveryCallback, RetryContext context, RetryState state) throws Throwable { BatchRetryState batchState = (BatchRetryState) state; BatchRetryContext batchContext = (BatchRetryContext) context; // Accumulate exceptions to be thrown so all the keys get a crack Throwable rethrowable = null; ExhaustedRetryException exhausted = null; Iterator<RetryContext> contextIterator = batchContext.contexts.iterator(); for (RetryState retryState : batchState.keys) { RetryContext nextContext = contextIterator.next(); try { super.handleRetryExhausted(null, nextContext, retryState); } catch (ExhaustedRetryException e) { exhausted = e; } catch (Throwable e) { rethrowable = e; } } if (recoveryCallback != null) { return recoveryCallback.recover(context); } if (exhausted != null) { throw exhausted; } throw rethrowable; }
@Override protected <T> T handleRetryExhausted(RecoveryCallback<T> recoveryCallback, RetryContext context, RetryState state) throws Throwable { BatchRetryState batchState = (BatchRetryState) state; BatchRetryContext batchContext = (BatchRetryContext) context; // Accumulate exceptions to be thrown so all the keys get a crack Throwable rethrowable = null; ExhaustedRetryException exhausted = null; Iterator<RetryContext> contextIterator = batchContext.contexts.iterator(); for (RetryState retryState : batchState.keys) { RetryContext nextContext = contextIterator.next(); try { super.handleRetryExhausted(null, nextContext, retryState); } catch (ExhaustedRetryException e) { exhausted = e; } catch (Throwable e) { rethrowable = e; } } if (recoveryCallback != null) { return recoveryCallback.recover(context); } if (exhausted != null) { throw exhausted; } throw rethrowable; }
return handleRetryExhausted(recoveryCallback, context, state);