Package com.google.gerrit.server.update
Class RetryHelper
- java.lang.Object
-
- com.google.gerrit.server.update.RetryHelper
-
public class RetryHelper extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
RetryHelper.Action<T>
static class
RetryHelper.ActionType
static interface
RetryHelper.ChangeAction<T>
static class
RetryHelper.Metrics
static class
RetryHelper.Options
Options for retrying a single operation.
-
Constructor Summary
Constructors Constructor Description RetryHelper(org.eclipse.jgit.lib.Config cfg, RetryHelper.Metrics metrics, BatchUpdate.Factory updateFactory, PluginSetContext<ExceptionHook> exceptionHooks, Consumer<com.github.rholder.retry.RetryerBuilder<?>> overwriteDefaultRetryerStrategySetup)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
execute(RetryHelper.ActionType actionType, RetryHelper.Action<T> action, RetryHelper.Options opts, Predicate<Throwable> exceptionPredicate)
<T> T
execute(RetryHelper.ActionType actionType, RetryHelper.Action<T> action, Predicate<Throwable> exceptionPredicate)
<T> T
execute(RetryHelper.ChangeAction<T> changeAction)
<T> T
execute(RetryHelper.ChangeAction<T> changeAction, RetryHelper.Options opts)
Duration
getDefaultTimeout(RetryHelper.ActionType actionType)
static RetryHelper.Options.Builder
options()
-
-
-
Constructor Detail
-
RetryHelper
public RetryHelper(org.eclipse.jgit.lib.Config cfg, RetryHelper.Metrics metrics, BatchUpdate.Factory updateFactory, PluginSetContext<ExceptionHook> exceptionHooks, Consumer<com.github.rholder.retry.RetryerBuilder<?>> overwriteDefaultRetryerStrategySetup)
-
-
Method Detail
-
options
public static RetryHelper.Options.Builder options()
-
getDefaultTimeout
public Duration getDefaultTimeout(RetryHelper.ActionType actionType)
-
execute
public <T> T execute(RetryHelper.ActionType actionType, RetryHelper.Action<T> action, Predicate<Throwable> exceptionPredicate) throws Exception
- Throws:
Exception
-
execute
public <T> T execute(RetryHelper.ActionType actionType, RetryHelper.Action<T> action, RetryHelper.Options opts, Predicate<Throwable> exceptionPredicate) throws Exception
- Throws:
Exception
-
execute
public <T> T execute(RetryHelper.ChangeAction<T> changeAction) throws RestApiException, UpdateException
- Throws:
RestApiException
UpdateException
-
execute
public <T> T execute(RetryHelper.ChangeAction<T> changeAction, RetryHelper.Options opts) throws RestApiException, UpdateException
- Throws:
RestApiException
UpdateException
-
-