public class Retry extends Object
Modifier and Type | Method and Description |
---|---|
static Retry |
on(Class<? extends 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 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 Exception
client
- Client invoking the bulk request.bulkRequest
- The bulk request that should be executed.Exception
- Any exception thrown by the callable.Copyright © 2009–2016. All rights reserved.