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.
This commit is contained in:
Christoph Büscher 2019-01-14 11:14:38 +01:00 committed by GitHub
parent d44a6f9fbc
commit 89b45f1fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 1 additions and 68 deletions

View File

@ -26,7 +26,6 @@ import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import java.io.IOException; import java.io.IOException;
@ -38,15 +37,6 @@ public class PutPipelineRequest extends AcknowledgedRequest<PutPipelineRequest>
private BytesReference source; private BytesReference source;
private XContentType xContentType; 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 * Create a new pipeline request with the id and source along with the content type of the source
*/ */

View File

@ -31,11 +31,6 @@ public class PutPipelineRequestBuilder extends ActionRequestBuilder<PutPipelineR
super(client, action, new PutPipelineRequest()); super(client, action, new PutPipelineRequest());
} }
@Deprecated
public PutPipelineRequestBuilder(ElasticsearchClient client, PutPipelineAction action, String id, BytesReference source) {
super(client, action, new PutPipelineRequest(id, source));
}
public PutPipelineRequestBuilder(ElasticsearchClient client, PutPipelineAction action, String id, BytesReference source, public PutPipelineRequestBuilder(ElasticsearchClient client, PutPipelineAction action, String id, BytesReference source,
XContentType xContentType) { XContentType xContentType) {
super(client, action, new PutPipelineRequest(id, source, xContentType)); super(client, action, new PutPipelineRequest(id, source, xContentType));

View File

@ -26,11 +26,11 @@ import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.VersionType; import org.elasticsearch.index.VersionType;
import org.elasticsearch.ingest.ConfigurationUtils; import org.elasticsearch.ingest.ConfigurationUtils;
import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.ingest.IngestDocument;
import org.elasticsearch.ingest.IngestDocument.MetaData;
import org.elasticsearch.ingest.IngestService; import org.elasticsearch.ingest.IngestService;
import org.elasticsearch.ingest.Pipeline; import org.elasticsearch.ingest.Pipeline;
@ -41,8 +41,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import static org.elasticsearch.ingest.IngestDocument.MetaData;
public class SimulatePipelineRequest extends ActionRequest implements ToXContentObject { public class SimulatePipelineRequest extends ActionRequest implements ToXContentObject {
private String id; private String id;
@ -50,15 +48,6 @@ public class SimulatePipelineRequest extends ActionRequest implements ToXContent
private BytesReference source; private BytesReference source;
private XContentType xContentType; private XContentType xContentType;
/**
* Create a new request
* @deprecated use {@link #SimulatePipelineRequest(BytesReference, XContentType)} that does not attempt content autodetection
*/
@Deprecated
public SimulatePipelineRequest(BytesReference source) {
this(source, XContentHelper.xContentType(source));
}
/** /**
* Creates a new request with the given source and its content type * Creates a new request with the given source and its content type
*/ */

View File

@ -33,16 +33,6 @@ public class SimulatePipelineRequestBuilder extends ActionRequestBuilder<Simulat
super(client, action, new SimulatePipelineRequest()); super(client, action, new SimulatePipelineRequest());
} }
/**
* Create a new builder for {@link SimulatePipelineRequest}s
* @deprecated use {@link #SimulatePipelineRequestBuilder(ElasticsearchClient, SimulatePipelineAction, BytesReference, XContentType)} to
* avoid content type auto-detection on the source bytes
*/
@Deprecated
public SimulatePipelineRequestBuilder(ElasticsearchClient client, SimulatePipelineAction action, BytesReference source) {
super(client, action, new SimulatePipelineRequest(source));
}
/** /**
* Create a new builder for {@link SimulatePipelineRequest}s * Create a new builder for {@link SimulatePipelineRequest}s
*/ */

View File

@ -576,13 +576,6 @@ public interface ClusterAdminClient extends ElasticsearchClient {
*/ */
ActionFuture<AcknowledgedResponse> putPipeline(PutPipelineRequest request); ActionFuture<AcknowledgedResponse> 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 * Stores an ingest pipeline
*/ */
@ -633,12 +626,6 @@ public interface ClusterAdminClient extends ElasticsearchClient {
*/ */
ActionFuture<SimulatePipelineResponse> simulatePipeline(SimulatePipelineRequest request); ActionFuture<SimulatePipelineResponse> simulatePipeline(SimulatePipelineRequest request);
/**
* Simulates an ingest pipeline
*/
@Deprecated
SimulatePipelineRequestBuilder prepareSimulatePipeline(BytesReference source);
/** /**
* Simulates an ingest pipeline * Simulates an ingest pipeline
*/ */

View File

@ -1066,11 +1066,6 @@ public abstract class AbstractClient implements Client {
return execute(PutPipelineAction.INSTANCE, request); return execute(PutPipelineAction.INSTANCE, request);
} }
@Override
public PutPipelineRequestBuilder preparePutPipeline(String id, BytesReference source) {
return new PutPipelineRequestBuilder(this, PutPipelineAction.INSTANCE, id, source);
}
@Override @Override
public PutPipelineRequestBuilder preparePutPipeline(String id, BytesReference source, XContentType xContentType) { public PutPipelineRequestBuilder preparePutPipeline(String id, BytesReference source, XContentType xContentType) {
return new PutPipelineRequestBuilder(this, PutPipelineAction.INSTANCE, id, source, 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); return execute(SimulatePipelineAction.INSTANCE, request);
} }
@Override
public SimulatePipelineRequestBuilder prepareSimulatePipeline(BytesReference source) {
return new SimulatePipelineRequestBuilder(this, SimulatePipelineAction.INSTANCE, source);
}
@Override @Override
public SimulatePipelineRequestBuilder prepareSimulatePipeline(BytesReference source, XContentType xContentType) { public SimulatePipelineRequestBuilder prepareSimulatePipeline(BytesReference source, XContentType xContentType) {
return new SimulatePipelineRequestBuilder(this, SimulatePipelineAction.INSTANCE, source, xContentType); return new SimulatePipelineRequestBuilder(this, SimulatePipelineAction.INSTANCE, source, xContentType);

View File

@ -326,12 +326,4 @@ public final class UTF8StreamWriter extends Writer {
_index = 0; _index = 0;
_outputStream = null; _outputStream = null;
} }
/**
* @deprecated Replaced by {@link #setOutput(OutputStream)}
*/
@Deprecated
public UTF8StreamWriter setOutputStream(OutputStream out) {
return this.setOutput(out);
}
} }