@Override protected IFunctionThrowsException<T, R> getUserFunction() { this.count++; return super.getUserFunction(); }
public RetryableFunction<BT, BR> build() { final IRetryStrategy retryStrategy = new RetryStrategyConfiguration(this.conf).getRetryStrategy(); return new RetryableFunction<BT, BR>(this.func, retryStrategy); } }
public R apply(final T t) throws Exception { while (true) { try { return getUserFunction().apply(t); } catch (Exception e) { if (retryStrategy.shouldRetry()) { log.info(retryStrategy.retryMessage()); } else { log.info(retryStrategy.retryMessage()); throw e; } } } }