Package org.elasticsearch.action.bulk
Class Retry
org.elasticsearch.action.bulk.Retry
public class Retry
extends
Encapsulates synchronous and asynchronous retry logic.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest)
Invokes #accept(BulkRequest, ActionListener).void
<BulkRequest,ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest, ActionListener<BulkResponse> listener)
Invokes #accept(BulkRequest, ActionListener).Methods inherited from class java.lang.
, , , , , , , , , ,
-
Constructor Details
-
Retry
-
-
Method Details
-
withBackoff
public void withBackoff(<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
public <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.
-