public class Retry
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Retry |
on(java.lang.Class<? extends java.lang.Throwable> retryOnThrowable) |
Retry |
policy(BackoffPolicy backoffPolicy) |
Retry |
using(ThreadPool threadPool) |
void |
withAsyncBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer,
BulkRequest bulkRequest,
ActionListener<BulkResponse> listener,
Settings settings)
Invokes #apply(BulkRequest, ActionListener).
|
BulkResponse |
withSyncBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer,
BulkRequest bulkRequest,
Settings settings)
Invokes #apply(BulkRequest, ActionListener).
|
public static Retry on(java.lang.Class<? extends java.lang.Throwable> retryOnThrowable)
public Retry policy(BackoffPolicy backoffPolicy)
backoffPolicy
- The backoff policy that defines how long and how often to wait for retries.public Retry using(ThreadPool threadPool)
threadPool
- The threadPool that will be used to schedule retries.public void withAsyncBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest, ActionListener<BulkResponse> listener, Settings settings)
consumer
- The consumer to which apply the request and listenerbulkRequest
- The bulk request that should be executed.listener
- A listener that is invoked when the bulk request finishes or completes with an exception. The listener is notsettings
- settingspublic BulkResponse withSyncBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest, Settings settings) throws java.lang.Exception
consumer
- The consumer to which apply the request and listenerbulkRequest
- The bulk request that should be executed.settings
- settingsjava.lang.Exception
- Any exception thrown by the callable.