From 6a7fc4e049bff4d82f7f5cec6a5478ad7673707b Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 1 May 2018 16:35:19 -0400 Subject: [PATCH 1/5] Client: Deprecate many argument performRequest Deprecate the many arguments versions of `performRequest` and `performRequestAsync` in favor of the `Request` object flavored variants introduced in #29623. We'll be dropping the many arguments variants in 7.0 because they make it difficult to add new features in a backwards compatible way and they create a *ton* of intellisense noise. --- .../org/elasticsearch/client/RestClient.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java index 1d4036c210308..d34b228f72389 100644 --- a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java +++ b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java @@ -210,7 +210,9 @@ public void performRequestAsync(Request request, ResponseListener responseListen * @throws IOException in case of a problem or the connection was aborted * @throws ClientProtocolException in case of an http protocol error * @throws ResponseException in case Elasticsearch responded with a status code that indicated an error + * @deprecated prefer {@link #performRequest(Request))} */ + @Deprecated public Response performRequest(String method, String endpoint, Header... headers) throws IOException { Request request = new Request(method, endpoint); request.setHeaders(headers); @@ -229,7 +231,9 @@ public Response performRequest(String method, String endpoint, Header... headers * @throws IOException in case of a problem or the connection was aborted * @throws ClientProtocolException in case of an http protocol error * @throws ResponseException in case Elasticsearch responded with a status code that indicated an error + * @deprecated prefer {@link #performRequest(Request))} */ + @Deprecated public Response performRequest(String method, String endpoint, Map params, Header... headers) throws IOException { Request request = new Request(method, endpoint); addParameters(request, params); @@ -252,7 +256,9 @@ public Response performRequest(String method, String endpoint, Map params, HttpEntity entity, Header... headers) throws IOException { Request request = new Request(method, endpoint); @@ -289,7 +295,9 @@ public Response performRequest(String method, String endpoint, Map params, HttpEntity entity, HttpAsyncResponseConsumerFactory httpAsyncResponseConsumerFactory, Header... headers) throws IOException { @@ -310,7 +318,9 @@ public Response performRequest(String method, String endpoint, Map params, ResponseListener responseListener, Header... headers) { Request request; @@ -361,7 +373,9 @@ public void performRequestAsync(String method, String endpoint, Map params, HttpEntity entity, ResponseListener responseListener, Header... headers) { Request request; @@ -394,7 +408,9 @@ public void performRequestAsync(String method, String endpoint, Map params, HttpEntity entity, HttpAsyncResponseConsumerFactory httpAsyncResponseConsumerFactory, ResponseListener responseListener, Header... headers) { From 9727dd259e59a8baa857eda1232d96ad72f46d46 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 1 May 2018 16:59:25 -0400 Subject: [PATCH 2/5] Add changelog --- docs/CHANGELOG.asciidoc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.asciidoc b/docs/CHANGELOG.asciidoc index 0fb3bae6a6de5..0669f974c42b4 100644 --- a/docs/CHANGELOG.asciidoc +++ b/docs/CHANGELOG.asciidoc @@ -65,8 +65,8 @@ written to by an older Elasticsearch after writing to it with a newer Elasticsea {ref-64}/breaking_64_api_changes.html#copy-source-settings-on-resize[Allow copying source settings on index resize operations] ({pull}30255[#30255]) -Added new "Request" object flavored request methods. Prefer these instead of the -multi-argument versions. ({pull}29623[#29623]) +Added new "Request" object flavored request methods in the RestClient. Prefer +these instead of the multi-argument versions. ({pull}29623[#29623]) [float] @@ -80,3 +80,9 @@ Do not ignore request analysis/similarity settings on index resize operations wh //[float] //=== Known Issues + +[float] +=== Deprecation + +Deprecated multi-argument versions of the request methods in the RestClient. +Prefer the "Request" object falvored methods. ({pull}30315[#30315]) From 183fcce961808353b1112d032d28a7519fe87171 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 2 May 2018 10:12:22 -0400 Subject: [PATCH 3/5] Fix --- .../main/java/org/elasticsearch/client/RestClient.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java index d34b228f72389..05fa4d536b3b6 100644 --- a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java +++ b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java @@ -210,7 +210,7 @@ public void performRequestAsync(Request request, ResponseListener responseListen * @throws IOException in case of a problem or the connection was aborted * @throws ClientProtocolException in case of an http protocol error * @throws ResponseException in case Elasticsearch responded with a status code that indicated an error - * @deprecated prefer {@link #performRequest(Request))} + * @deprecated prefer {@link #performRequest(Request)} */ @Deprecated public Response performRequest(String method, String endpoint, Header... headers) throws IOException { @@ -231,7 +231,7 @@ public Response performRequest(String method, String endpoint, Header... headers * @throws IOException in case of a problem or the connection was aborted * @throws ClientProtocolException in case of an http protocol error * @throws ResponseException in case Elasticsearch responded with a status code that indicated an error - * @deprecated prefer {@link #performRequest(Request))} + * @deprecated prefer {@link #performRequest(Request)} */ @Deprecated public Response performRequest(String method, String endpoint, Map params, Header... headers) throws IOException { @@ -256,7 +256,7 @@ public Response performRequest(String method, String endpoint, Map params, @@ -295,7 +295,7 @@ public Response performRequest(String method, String endpoint, Map params, From 4e2988a2ca1cfda1d749410b82bf7a6af1c1b15e Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 7 May 2018 16:56:04 -0400 Subject: [PATCH 4/5] Spelling --- docs/CHANGELOG.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CHANGELOG.asciidoc b/docs/CHANGELOG.asciidoc index 0669f974c42b4..154b8123fbc31 100644 --- a/docs/CHANGELOG.asciidoc +++ b/docs/CHANGELOG.asciidoc @@ -85,4 +85,4 @@ Do not ignore request analysis/similarity settings on index resize operations wh === Deprecation Deprecated multi-argument versions of the request methods in the RestClient. -Prefer the "Request" object falvored methods. ({pull}30315[#30315]) +Prefer the "Request" object flavored methods. ({pull}30315[#30315]) From da061ba9134aa88b6252ce6c78281ac786e1b005 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 7 May 2018 16:56:57 -0400 Subject: [PATCH 5/5] Fixup changelog --- docs/CHANGELOG.asciidoc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/CHANGELOG.asciidoc b/docs/CHANGELOG.asciidoc index 10e625201a72e..339891dd59b3a 100644 --- a/docs/CHANGELOG.asciidoc +++ b/docs/CHANGELOG.asciidoc @@ -3,7 +3,7 @@ [partintro] -- -// To add a release, copy and paste the template text +// To add a release, copy and paste the template text // and add a link to the new section. Note that release subheads must // be floated and sections cannot be empty. @@ -137,8 +137,11 @@ coming[6.4.0] //[float] //=== Breaking Java Changes -//[float] -//=== Deprecations +[float] +=== Deprecations + +Deprecated multi-argument versions of the request methods in the RestClient. +Prefer the "Request" object flavored methods. ({pull}30315[#30315]) [float] === New Features @@ -228,9 +231,3 @@ Respect accept header on requests with no handler ({pull}30383[#30383]) //[float] //=== Known Issues - -[float] -=== Deprecation - -Deprecated multi-argument versions of the request methods in the RestClient. -Prefer the "Request" object flavored methods. ({pull}30315[#30315])