|
@@ -22,7 +22,6 @@ import org.apache.logging.log4j.Logger;
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
import org.elasticsearch.action.ActionListener;
|
|
|
import org.elasticsearch.action.support.PlainActionFuture;
|
|
|
-import org.elasticsearch.common.settings.Settings;
|
|
|
import org.elasticsearch.common.unit.TimeValue;
|
|
|
import org.elasticsearch.common.util.concurrent.FutureUtils;
|
|
|
import org.elasticsearch.rest.RestStatus;
|
|
@@ -61,21 +60,6 @@ public class Retry {
|
|
|
r.execute(bulkRequest);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 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.
|
|
|
- * @param consumer The consumer to which apply the request and listener
|
|
|
- * @param bulkRequest The bulk request that should be executed.
|
|
|
- * @param listener A listener that is invoked when the bulk request finishes or completes with an exception. The listener is not
|
|
|
- * @param settings settings
|
|
|
- * @deprecated Prefer {@link #withBackoff(BiConsumer, BulkRequest, ActionListener)}. The {@link Settings} isn't used.
|
|
|
- */
|
|
|
- @Deprecated
|
|
|
- public void withBackoff(BiConsumer<BulkRequest, ActionListener<BulkResponse>> consumer, BulkRequest bulkRequest,
|
|
|
- ActionListener<BulkResponse> listener, Settings settings) {
|
|
|
- withBackoff(consumer, bulkRequest, listener);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Invokes #accept(BulkRequest, ActionListener). Backs off on the provided exception. Retries will be scheduled using
|
|
|
* the class's thread pool.
|
|
@@ -91,22 +75,6 @@ public class Retry {
|
|
|
return future;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Invokes #accept(BulkRequest, ActionListener). Backs off on the provided exception. Retries will be scheduled using
|
|
|
- * the class's thread pool.
|
|
|
- *
|
|
|
- * @param consumer The consumer to which apply the request and listener
|
|
|
- * @param bulkRequest The bulk request that should be executed.
|
|
|
- * @param settings settings
|
|
|
- * @return a future representing the bulk response returned by the client.
|
|
|
- * @deprecated prefer {@link #withBackoff(BiConsumer, BulkRequest)}. The {@link Settings} isn't used.
|
|
|
- */
|
|
|
- @Deprecated
|
|
|
- public PlainActionFuture<BulkResponse> withBackoff(BiConsumer<BulkRequest, ActionListener<BulkResponse>> consumer,
|
|
|
- BulkRequest bulkRequest, Settings settings) {
|
|
|
- return withBackoff(consumer, bulkRequest);
|
|
|
- }
|
|
|
-
|
|
|
static class RetryHandler implements ActionListener<BulkResponse> {
|
|
|
private static final RestStatus RETRY_STATUS = RestStatus.TOO_MANY_REQUESTS;
|
|
|
private static final Logger logger = LogManager.getLogger(RetryHandler.class);
|