@Override public long nextRetry(int failureCount, long startTime, OperationType type, String path) { return (failureCount <= limit) ? strategy.nextRetry(failureCount, startTime, type, path) : -1L; } };
@Override public long nextRetry(int failureCount, long startTime, OperationType type, String path) { return (failureCount <= limit) ? strategy.nextRetry(failureCount, startTime, type, path) : -1L; } };
@Override public long nextRetry(int failureCount, long startTime, OperationType type, String path) { long elapseTime = System.currentTimeMillis() - startTime; return elapseTime <= maxElapseMs ? strategy.nextRetry(failureCount, startTime, type, path) : -1L; } };
@Override public long nextRetry(int failureCount, long startTime, OperationType type, String path) { long elapseTime = System.currentTimeMillis() - startTime; return elapseTime <= maxElapseMs ? strategy.nextRetry(failureCount, startTime, type, path) : -1L; } };
private boolean doRetry(Throwable t) { if (!RetryUtils.canRetry(t)) { return false; } // Determine the relay delay long nextRetry = retryStrategy.nextRetry(failureCount.incrementAndGet(), startTime, type, path); if (nextRetry < 0) { return false; } // Schedule the retry. SCHEDULER.schedule(new Runnable() { @Override public void run() { Futures.addCallback(retryAction.get(), OperationFutureCallback.this); } }, nextRetry, TimeUnit.MILLISECONDS); return true; } }
private boolean doRetry(Throwable t) { if (!RetryUtils.canRetry(t)) { return false; } // Determine the relay delay long nextRetry = retryStrategy.nextRetry(failureCount.incrementAndGet(), startTime, type, path); if (nextRetry < 0) { return false; } // Schedule the retry. SCHEDULER.schedule(new Runnable() { @Override public void run() { Futures.addCallback(retryAction.get(), OperationFutureCallback.this); } }, nextRetry, TimeUnit.MILLISECONDS); return true; } }