From 8b60083dda0b8cbe9b35bdb074f9bb198013454b Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Mon, 22 Jun 2015 14:34:16 +0200 Subject: [PATCH] Add high-level javadocs to delete-by-query This commit adds high-level javadocs to the delete-by-query explaining it's semantics and why it's moved to a plugin. Closes #11723 --- .../deletebyquery/DeleteByQueryRequest.java | 26 +++++++++++++++++++ .../DeleteByQueryRequestBuilder.java | 4 +++ .../deletebyquery/DeleteByQueryResponse.java | 1 + .../RestDeleteByQueryAction.java | 3 +++ 4 files changed, 34 insertions(+) diff --git a/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java b/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java index 1ffee65294472..bb7bafa7f8758 100644 --- a/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java +++ b/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java @@ -44,6 +44,32 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.search.Scroll.readScroll; +/** + * Creates a new {@link DeleteByQueryRequest}. Delete-by-query is since elasticsearch 2.0.0 moved into a plugin + * and is not part of elasticsearch core. In contrast to the previous, in-core, implementation delete-by-query now + * uses scan/scroll and the returned IDs do delete all documents matching the query. This can have performance + * as well as visibility implications. Delete-by-query now has the following semantics: + *
  • + * + * + * + * + * + * + * + *
  • + * + * The main reason why delete-by-query is now extracted as a plugin are: + *
  • + * + * + * + *
  • + * + * While delete-by-query is a very useful feature, it's implementation is very tricky in system that is based on per-document modifications. The move towards + * a plugin based solution was mainly done to minimize the risk of cluster failures or corrupted indices which where easily possible wiht the previous implementation. + * Users that rely delete by query should install the plugin in oder to use this functionality. + */ public class DeleteByQueryRequest extends ActionRequest implements IndicesRequest.Replaceable { private String[] indices = Strings.EMPTY_ARRAY; diff --git a/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequestBuilder.java b/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequestBuilder.java index 933c8eacd4077..9cf910341d9cd 100644 --- a/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequestBuilder.java +++ b/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequestBuilder.java @@ -31,6 +31,10 @@ import java.util.Map; +/** + * Creates a new {@link DeleteByQueryRequestBuilder} + * @see DeleteByQueryRequest + */ public class DeleteByQueryRequestBuilder extends ActionRequestBuilder { private QuerySourceBuilder sourceBuilder; diff --git a/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryResponse.java b/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryResponse.java index 33d73b5e484e4..b9ff364af1bf4 100644 --- a/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryResponse.java +++ b/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryResponse.java @@ -35,6 +35,7 @@ /** * Delete by query response + * @see DeleteByQueryRequest */ public class DeleteByQueryResponse extends ActionResponse implements ToXContent { diff --git a/plugins/delete-by-query/src/main/java/org/elasticsearch/rest/action/deletebyquery/RestDeleteByQueryAction.java b/plugins/delete-by-query/src/main/java/org/elasticsearch/rest/action/deletebyquery/RestDeleteByQueryAction.java index b224a0c95f41a..251953da66856 100644 --- a/plugins/delete-by-query/src/main/java/org/elasticsearch/rest/action/deletebyquery/RestDeleteByQueryAction.java +++ b/plugins/delete-by-query/src/main/java/org/elasticsearch/rest/action/deletebyquery/RestDeleteByQueryAction.java @@ -37,6 +37,9 @@ import static org.elasticsearch.action.deletebyquery.DeleteByQueryAction.INSTANCE; import static org.elasticsearch.rest.RestRequest.Method.DELETE; +/** + * @see DeleteByQueryRequest + */ public class RestDeleteByQueryAction extends BaseRestHandler { @Inject