parent
53eb630700
commit
eadfe05587
|
@ -14,6 +14,7 @@ import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.index.query.QueryBuilder;
|
import org.elasticsearch.index.query.QueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
|
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||||
import org.elasticsearch.tasks.Task;
|
import org.elasticsearch.tasks.Task;
|
||||||
|
@ -77,7 +78,7 @@ public class TransportDeleteCalendarAction extends HandledTransportAction<Delete
|
||||||
|
|
||||||
private DeleteByQueryRequest buildDeleteByQuery(String calendarId) {
|
private DeleteByQueryRequest buildDeleteByQuery(String calendarId) {
|
||||||
DeleteByQueryRequest request = new DeleteByQueryRequest(MlMetaIndex.INDEX_NAME);
|
DeleteByQueryRequest request = new DeleteByQueryRequest(MlMetaIndex.INDEX_NAME);
|
||||||
request.setSlices(5);
|
request.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES);
|
||||||
request.setRefresh(true);
|
request.setRefresh(true);
|
||||||
|
|
||||||
QueryBuilder query = QueryBuilders.termsQuery(Calendar.ID.getPreferredName(), calendarId);
|
QueryBuilder query = QueryBuilders.termsQuery(Calendar.ID.getPreferredName(), calendarId);
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.elasticsearch.common.xcontent.XContentType;
|
||||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilder;
|
import org.elasticsearch.index.query.QueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
|
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest;
|
||||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||||
|
@ -198,7 +199,7 @@ public class TransportDeleteForecastAction extends HandledTransportAction<Delete
|
||||||
DeleteByQueryRequest request = new DeleteByQueryRequest()
|
DeleteByQueryRequest request = new DeleteByQueryRequest()
|
||||||
.setAbortOnVersionConflict(false) //since these documents are not updated, a conflict just means it was deleted previously
|
.setAbortOnVersionConflict(false) //since these documents are not updated, a conflict just means it was deleted previously
|
||||||
.setMaxDocs(MAX_FORECAST_TO_SEARCH)
|
.setMaxDocs(MAX_FORECAST_TO_SEARCH)
|
||||||
.setSlices(5);
|
.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES);
|
||||||
|
|
||||||
request.indices(AnomalyDetectorsIndex.jobResultsAliasedName(jobId));
|
request.indices(AnomalyDetectorsIndex.jobResultsAliasedName(jobId));
|
||||||
BoolQueryBuilder innerBoolQuery = QueryBuilders.boolQuery();
|
BoolQueryBuilder innerBoolQuery = QueryBuilders.boolQuery();
|
||||||
|
|
|
@ -38,6 +38,7 @@ import org.elasticsearch.index.query.ConstantScoreQueryBuilder;
|
||||||
import org.elasticsearch.index.query.IdsQueryBuilder;
|
import org.elasticsearch.index.query.IdsQueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
import org.elasticsearch.index.query.TermQueryBuilder;
|
import org.elasticsearch.index.query.TermQueryBuilder;
|
||||||
|
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest;
|
||||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||||
|
@ -305,7 +306,7 @@ public class TransportDeleteJobAction extends TransportMasterNodeAction<DeleteJo
|
||||||
new ConstantScoreQueryBuilder(new TermQueryBuilder(Job.ID.getPreferredName(), jobId));
|
new ConstantScoreQueryBuilder(new TermQueryBuilder(Job.ID.getPreferredName(), jobId));
|
||||||
request.setQuery(query);
|
request.setQuery(query);
|
||||||
request.setIndicesOptions(MlIndicesUtils.addIgnoreUnavailable(IndicesOptions.lenientExpandOpen()));
|
request.setIndicesOptions(MlIndicesUtils.addIgnoreUnavailable(IndicesOptions.lenientExpandOpen()));
|
||||||
request.setSlices(5);
|
request.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES);
|
||||||
request.setAbortOnVersionConflict(false);
|
request.setAbortOnVersionConflict(false);
|
||||||
request.setRefresh(true);
|
request.setRefresh(true);
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.elasticsearch.index.query.ConstantScoreQueryBuilder;
|
||||||
import org.elasticsearch.index.query.IdsQueryBuilder;
|
import org.elasticsearch.index.query.IdsQueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilder;
|
import org.elasticsearch.index.query.QueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
|
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest;
|
||||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||||
import org.elasticsearch.index.reindex.BulkByScrollTask;
|
import org.elasticsearch.index.reindex.BulkByScrollTask;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
||||||
|
@ -129,7 +130,7 @@ public class JobDataDeleter {
|
||||||
private DeleteByQueryHolder(String index) {
|
private DeleteByQueryHolder(String index) {
|
||||||
dbqRequest = new DeleteByQueryRequest();
|
dbqRequest = new DeleteByQueryRequest();
|
||||||
dbqRequest.indices(index);
|
dbqRequest.indices(index);
|
||||||
dbqRequest.setSlices(5);
|
dbqRequest.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES);
|
||||||
dbqRequest.setAbortOnVersionConflict(false);
|
dbqRequest.setAbortOnVersionConflict(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.elasticsearch.common.xcontent.XContentType;
|
||||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilder;
|
import org.elasticsearch.index.query.QueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
|
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest;
|
||||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||||
|
@ -143,7 +144,7 @@ public class ExpiredForecastsRemover implements MlDataRemover {
|
||||||
|
|
||||||
private DeleteByQueryRequest buildDeleteByQuery(List<ForecastRequestStats> forecastsToDelete) {
|
private DeleteByQueryRequest buildDeleteByQuery(List<ForecastRequestStats> forecastsToDelete) {
|
||||||
DeleteByQueryRequest request = new DeleteByQueryRequest();
|
DeleteByQueryRequest request = new DeleteByQueryRequest();
|
||||||
request.setSlices(5);
|
request.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES);
|
||||||
|
|
||||||
request.indices(RESULTS_INDEX_PATTERN);
|
request.indices(RESULTS_INDEX_PATTERN);
|
||||||
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().minimumShouldMatch(1);
|
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().minimumShouldMatch(1);
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.index.query.QueryBuilder;
|
import org.elasticsearch.index.query.QueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
|
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest;
|
||||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||||
|
@ -85,7 +86,7 @@ public class ExpiredResultsRemover extends AbstractExpiredJobDataRemover {
|
||||||
|
|
||||||
private DeleteByQueryRequest createDBQRequest(Job job, long cutoffEpochMs) {
|
private DeleteByQueryRequest createDBQRequest(Job job, long cutoffEpochMs) {
|
||||||
DeleteByQueryRequest request = new DeleteByQueryRequest();
|
DeleteByQueryRequest request = new DeleteByQueryRequest();
|
||||||
request.setSlices(5);
|
request.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES);
|
||||||
|
|
||||||
request.indices(AnomalyDetectorsIndex.jobResultsAliasedName(job.getId()));
|
request.indices(AnomalyDetectorsIndex.jobResultsAliasedName(job.getId()));
|
||||||
QueryBuilder excludeFilter = QueryBuilders.termsQuery(Result.RESULT_TYPE.getPreferredName(),
|
QueryBuilder excludeFilter = QueryBuilders.termsQuery(Result.RESULT_TYPE.getPreferredName(),
|
||||||
|
|
Loading…
Reference in New Issue