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 interfaceRetryHelper.Action<T>static classRetryHelper.ActionTypestatic interfaceRetryHelper.ChangeAction<T>static classRetryHelper.Metricsstatic classRetryHelper.OptionsOptions 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> Texecute(RetryHelper.ActionType actionType, RetryHelper.Action<T> action, RetryHelper.Options opts, Predicate<Throwable> exceptionPredicate)<T> Texecute(RetryHelper.ActionType actionType, RetryHelper.Action<T> action, Predicate<Throwable> exceptionPredicate)<T> Texecute(RetryHelper.ChangeAction<T> changeAction)<T> Texecute(RetryHelper.ChangeAction<T> changeAction, RetryHelper.Options opts)DurationgetDefaultTimeout(RetryHelper.ActionType actionType)static RetryHelper.Options.Builderoptions()
-
-
-
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:
RestApiExceptionUpdateException
-
execute
public <T> T execute(RetryHelper.ChangeAction<T> changeAction, RetryHelper.Options opts) throws RestApiException, UpdateException
- Throws:
RestApiExceptionUpdateException
-
-