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) |
void |
withAsyncBackoff(Client client,
BulkRequest bulkRequest,
ActionListener<BulkResponse> listener)
Invokes #bulk(BulkRequest, ActionListener) on the provided client.
|
BulkResponse |
withSyncBackoff(Client client,
BulkRequest bulkRequest)
Invokes #bulk(BulkRequest) on the provided client.
|
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 void withAsyncBackoff(Client client, BulkRequest bulkRequest, ActionListener<BulkResponse> listener)
client
- Client invoking the bulk request.bulkRequest
- 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 notpublic BulkResponse withSyncBackoff(Client client, BulkRequest bulkRequest) throws java.lang.Exception
client
- Client invoking the bulk request.bulkRequest
- The bulk request that should be executed.java.lang.Exception
- Any exception thrown by the callable.