From 89b45f1fc6ed7bb46df5071f7ad34d80e6e87761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Mon, 14 Jan 2019 11:14:38 +0100 Subject: [PATCH] Remove deprecated pipeline request contructors (#37366) The constructors in PutPipelineRequest and SimulatePipelineRequest that guess the xContent type from the provided source are deprecated since 6.0 and each have a counterpart that takes the xContent type as an explicit argument. Removing these ctors together with the builders and methods in ClusterAdminClient that don't have the xContent type as argument. --- .../action/ingest/PutPipelineRequest.java | 10 ---------- .../action/ingest/PutPipelineRequestBuilder.java | 5 ----- .../action/ingest/SimulatePipelineRequest.java | 13 +------------ .../ingest/SimulatePipelineRequestBuilder.java | 10 ---------- .../elasticsearch/client/ClusterAdminClient.java | 13 ------------- .../client/support/AbstractClient.java | 10 ---------- .../elasticsearch/common/io/UTF8StreamWriter.java | 8 -------- 7 files changed, 1 insertion(+), 68 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java index abff28bcf55..46a34717c89 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java @@ -26,7 +26,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentType; import java.io.IOException; @@ -38,15 +37,6 @@ public class PutPipelineRequest extends AcknowledgedRequest private BytesReference source; private XContentType xContentType; - /** - * Create a new pipeline request - * @deprecated use {@link #PutPipelineRequest(String, BytesReference, XContentType)} to avoid content type auto-detection - */ - @Deprecated - public PutPipelineRequest(String id, BytesReference source) { - this(id, source, XContentHelper.xContentType(source)); - } - /** * Create a new pipeline request with the id and source along with the content type of the source */ diff --git a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java index 1919d98c7e1..aa2aff8bb99 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java @@ -31,11 +31,6 @@ public class PutPipelineRequestBuilder extends ActionRequestBuilder putPipeline(PutPipelineRequest request); - /** - * Stores an ingest pipeline - * @deprecated use {@link #preparePutPipeline(String, BytesReference, XContentType)} - */ - @Deprecated - PutPipelineRequestBuilder preparePutPipeline(String id, BytesReference source); - /** * Stores an ingest pipeline */ @@ -633,12 +626,6 @@ public interface ClusterAdminClient extends ElasticsearchClient { */ ActionFuture simulatePipeline(SimulatePipelineRequest request); - /** - * Simulates an ingest pipeline - */ - @Deprecated - SimulatePipelineRequestBuilder prepareSimulatePipeline(BytesReference source); - /** * Simulates an ingest pipeline */ diff --git a/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java b/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java index d642101e1c3..3fc931a85c0 100644 --- a/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java +++ b/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java @@ -1066,11 +1066,6 @@ public abstract class AbstractClient implements Client { return execute(PutPipelineAction.INSTANCE, request); } - @Override - public PutPipelineRequestBuilder preparePutPipeline(String id, BytesReference source) { - return new PutPipelineRequestBuilder(this, PutPipelineAction.INSTANCE, id, source); - } - @Override public PutPipelineRequestBuilder preparePutPipeline(String id, BytesReference source, XContentType xContentType) { return new PutPipelineRequestBuilder(this, PutPipelineAction.INSTANCE, id, source, xContentType); @@ -1121,11 +1116,6 @@ public abstract class AbstractClient implements Client { return execute(SimulatePipelineAction.INSTANCE, request); } - @Override - public SimulatePipelineRequestBuilder prepareSimulatePipeline(BytesReference source) { - return new SimulatePipelineRequestBuilder(this, SimulatePipelineAction.INSTANCE, source); - } - @Override public SimulatePipelineRequestBuilder prepareSimulatePipeline(BytesReference source, XContentType xContentType) { return new SimulatePipelineRequestBuilder(this, SimulatePipelineAction.INSTANCE, source, xContentType); diff --git a/server/src/main/java/org/elasticsearch/common/io/UTF8StreamWriter.java b/server/src/main/java/org/elasticsearch/common/io/UTF8StreamWriter.java index 0ed5fd498de..cb038d12fc2 100644 --- a/server/src/main/java/org/elasticsearch/common/io/UTF8StreamWriter.java +++ b/server/src/main/java/org/elasticsearch/common/io/UTF8StreamWriter.java @@ -326,12 +326,4 @@ public final class UTF8StreamWriter extends Writer { _index = 0; _outputStream = null; } - - /** - * @deprecated Replaced by {@link #setOutput(OutputStream)} - */ - @Deprecated - public UTF8StreamWriter setOutputStream(OutputStream out) { - return this.setOutput(out); - } } \ No newline at end of file