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:
parent
d44a6f9fbc
commit
89b45f1fc6
|
@ -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<PutPipelineRequest>
|
|||
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
|
||||
*/
|
||||
|
|
|
@ -31,11 +31,6 @@ public class PutPipelineRequestBuilder extends ActionRequestBuilder<PutPipelineR
|
|||
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,
|
||||
XContentType xContentType) {
|
||||
super(client, action, new PutPipelineRequest(id, source, xContentType));
|
||||
|
|
|
@ -26,11 +26,11 @@ 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 org.elasticsearch.index.VersionType;
|
||||
import org.elasticsearch.ingest.ConfigurationUtils;
|
||||
import org.elasticsearch.ingest.IngestDocument;
|
||||
import org.elasticsearch.ingest.IngestDocument.MetaData;
|
||||
import org.elasticsearch.ingest.IngestService;
|
||||
import org.elasticsearch.ingest.Pipeline;
|
||||
|
||||
|
@ -41,8 +41,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static org.elasticsearch.ingest.IngestDocument.MetaData;
|
||||
|
||||
public class SimulatePipelineRequest extends ActionRequest implements ToXContentObject {
|
||||
|
||||
private String id;
|
||||
|
@ -50,15 +48,6 @@ public class SimulatePipelineRequest extends ActionRequest implements ToXContent
|
|||
private BytesReference source;
|
||||
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
|
||||
*/
|
||||
|
|
|
@ -33,16 +33,6 @@ public class SimulatePipelineRequestBuilder extends ActionRequestBuilder<Simulat
|
|||
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
|
||||
*/
|
||||
|
|
|
@ -576,13 +576,6 @@ public interface ClusterAdminClient extends ElasticsearchClient {
|
|||
*/
|
||||
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
|
||||
*/
|
||||
|
@ -633,12 +626,6 @@ public interface ClusterAdminClient extends ElasticsearchClient {
|
|||
*/
|
||||
ActionFuture<SimulatePipelineResponse> simulatePipeline(SimulatePipelineRequest request);
|
||||
|
||||
/**
|
||||
* Simulates an ingest pipeline
|
||||
*/
|
||||
@Deprecated
|
||||
SimulatePipelineRequestBuilder prepareSimulatePipeline(BytesReference source);
|
||||
|
||||
/**
|
||||
* Simulates an ingest pipeline
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue