Package org.elasticsearch.action.bulk
Class Retry
- java.lang.Object
-
- org.elasticsearch.action.bulk.Retry
-
public class Retry extends java.lang.Object
Encapsulates synchronous and asynchronous retry logic.
-
-
Constructor Summary
Constructors Constructor Description Retry(BackoffPolicy backoffPolicy, Scheduler scheduler)
-
Method Summary
Modifier and Type Method Description PlainActionFuture<BulkResponse>
withBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest)
Invokes #accept(BulkRequest, ActionListener).void
withBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest, ActionListener<BulkResponse> listener)
Invokes #accept(BulkRequest, ActionListener).void
withBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest, ActionListener<BulkResponse> listener, Settings settings)
Deprecated.PlainActionFuture<BulkResponse>
withBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest, Settings settings)
Deprecated.
-
-
-
Constructor Detail
-
Retry
public Retry(BackoffPolicy backoffPolicy, Scheduler scheduler)
-
-
Method Detail
-
withBackoff
public void withBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest, ActionListener<BulkResponse> listener)
Invokes #accept(BulkRequest, ActionListener). Backs off on the provided exception and delegates results to the provided listener. Retries will be scheduled using the class's thread pool.- Parameters:
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 not
-
withBackoff
@Deprecated public void withBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest, ActionListener<BulkResponse> listener, Settings settings)
Deprecated.PreferwithBackoff(BiConsumer, BulkRequest, ActionListener)
. TheSettings
isn't used.Invokes #accept(BulkRequest, ActionListener). Backs off on the provided exception and delegates results to the provided listener. Retries will be scheduled using the class's thread pool.- Parameters:
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
- settings
-
withBackoff
public PlainActionFuture<BulkResponse> withBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest)
Invokes #accept(BulkRequest, ActionListener). Backs off on the provided exception. Retries will be scheduled using the class's thread pool.- Parameters:
consumer
- The consumer to which apply the request and listenerbulkRequest
- The bulk request that should be executed.- Returns:
- a future representing the bulk response returned by the client.
-
withBackoff
@Deprecated public PlainActionFuture<BulkResponse> withBackoff(java.util.function.BiConsumer<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest, Settings settings)
Deprecated.preferwithBackoff(BiConsumer, BulkRequest)
. TheSettings
isn't used.Invokes #accept(BulkRequest, ActionListener). Backs off on the provided exception. Retries will be scheduled using the class's thread pool.- Parameters:
consumer
- The consumer to which apply the request and listenerbulkRequest
- The bulk request that should be executed.settings
- settings- Returns:
- a future representing the bulk response returned by the client.
-
-