From eadfe05587ebd4a3d35cd1dada1bb2f10078d228 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Mon, 10 Jun 2019 21:52:22 -0500 Subject: [PATCH] [ML] Changes slice specification to auto. See #42996 (#43039) (#43070) --- .../xpack/ml/action/TransportDeleteCalendarAction.java | 3 ++- .../xpack/ml/action/TransportDeleteForecastAction.java | 3 ++- .../xpack/ml/action/TransportDeleteJobAction.java | 3 ++- .../elasticsearch/xpack/ml/job/persistence/JobDataDeleter.java | 3 ++- .../xpack/ml/job/retention/ExpiredForecastsRemover.java | 3 ++- .../xpack/ml/job/retention/ExpiredResultsRemover.java | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteCalendarAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteCalendarAction.java index ffc05485547..d4cdb48dd5a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteCalendarAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportDeleteCalendarAction.java @@ -14,6 +14,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.elasticsearch.index.reindex.DeleteByQueryAction; import org.elasticsearch.index.reindex.DeleteByQueryRequest; import org.elasticsearch.tasks.Task; @@ -77,7 +78,7 @@ public class TransportDeleteCalendarAction extends HandledTransportAction forecastsToDelete) { DeleteByQueryRequest request = new DeleteByQueryRequest(); - request.setSlices(5); + request.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES); request.indices(RESULTS_INDEX_PATTERN); BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().minimumShouldMatch(1); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/retention/ExpiredResultsRemover.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/retention/ExpiredResultsRemover.java index d7b16ef8c46..e24ecfbe8b0 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/retention/ExpiredResultsRemover.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/retention/ExpiredResultsRemover.java @@ -12,6 +12,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.Client; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.index.reindex.DeleteByQueryAction; import org.elasticsearch.index.reindex.DeleteByQueryRequest; @@ -85,7 +86,7 @@ public class ExpiredResultsRemover extends AbstractExpiredJobDataRemover { private DeleteByQueryRequest createDBQRequest(Job job, long cutoffEpochMs) { DeleteByQueryRequest request = new DeleteByQueryRequest(); - request.setSlices(5); + request.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES); request.indices(AnomalyDetectorsIndex.jobResultsAliasedName(job.getId())); QueryBuilder excludeFilter = QueryBuilders.termsQuery(Result.RESULT_TYPE.getPreferredName(),