mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-23 13:26:02 +00:00
* Migrate ML Actions to use writeable ActionType (#44302) This commit converts all the StreamableResponseActionType actions in the ML core module to be ActionType and leverage the Writeable infrastructure.
This commit is contained in:
parent
642e9019ff
commit
901310a826
@ -18,35 +18,20 @@
|
||||
*/
|
||||
package org.elasticsearch.client.ml;
|
||||
|
||||
import org.elasticsearch.client.AbstractResponseTestCase;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.client.AbstractHlrcStreamableXContentTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.MlInfoAction.Response;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class MlInfoActionResponseTests extends
|
||||
AbstractHlrcStreamableXContentTestCase<Response, MlInfoResponse> {
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class MlInfoActionResponseTests extends AbstractResponseTestCase<Response, MlInfoResponse> {
|
||||
|
||||
@Override
|
||||
public MlInfoResponse doHlrcParseInstance(XContentParser parser) throws IOException {
|
||||
return MlInfoResponse.fromXContent(parser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response convertHlrcToInternal(MlInfoResponse instance) {
|
||||
return new Response(instance.getInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Predicate<String> getRandomFieldsExcludeFilter() {
|
||||
return p -> true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
protected Response createServerTestInstance() {
|
||||
int size = randomInt(10);
|
||||
Map<String, Object> info = new HashMap<>();
|
||||
for (int j = 0; j < size; j++) {
|
||||
@ -56,7 +41,12 @@ public class MlInfoActionResponseTests extends
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected MlInfoResponse doParseToClientInstance(XContentParser parser) throws IOException {
|
||||
return MlInfoResponse.fromXContent(parser);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void assertInstances(Response serverTestInstance, MlInfoResponse clientInstance) {
|
||||
assertThat(serverTestInstance.getInfo(), equalTo(clientInstance.getInfo()));
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,8 @@
|
||||
package org.elasticsearch.client.ml;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.generators.CodepointSetGenerator;
|
||||
import org.elasticsearch.client.AbstractResponseTestCase;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.client.AbstractHlrcStreamableXContentTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutCalendarAction;
|
||||
import org.elasticsearch.xpack.core.ml.calendars.Calendar;
|
||||
|
||||
@ -28,46 +28,13 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PutCalendarActionResponseTests
|
||||
extends AbstractHlrcStreamableXContentTestCase<PutCalendarAction.Response, PutCalendarResponse> {
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class PutCalendarActionResponseTests extends AbstractResponseTestCase<PutCalendarAction.Response, PutCalendarResponse> {
|
||||
|
||||
@Override
|
||||
protected PutCalendarAction.Response createTestInstance() {
|
||||
return new PutCalendarAction.Response(testInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PutCalendarAction.Response doParseInstance(XContentParser parser) throws IOException {
|
||||
return new PutCalendarAction.Response(Calendar.LENIENT_PARSER.parse(parser, null).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PutCalendarResponse doHlrcParseInstance(XContentParser parser) throws IOException {
|
||||
return PutCalendarResponse.fromXContent(parser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PutCalendarAction.Response convertHlrcToInternal(PutCalendarResponse instance) {
|
||||
org.elasticsearch.client.ml.calendars.Calendar hlrcCalendar = instance.getCalendar();
|
||||
Calendar internalCalendar = new Calendar(hlrcCalendar.getId(), hlrcCalendar.getJobIds(), hlrcCalendar.getDescription());
|
||||
return new PutCalendarAction.Response(internalCalendar);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PutCalendarAction.Response createBlankInstance() {
|
||||
return new PutCalendarAction.Response();
|
||||
}
|
||||
|
||||
public static Calendar testInstance() {
|
||||
return testInstance(new CodepointSetGenerator("abcdefghijklmnopqrstuvwxyz".toCharArray()).ofCodePointsLength(random(), 10, 10));
|
||||
}
|
||||
|
||||
public static Calendar testInstance(String calendarId) {
|
||||
protected PutCalendarAction.Response createServerTestInstance() {
|
||||
String calendarId = new CodepointSetGenerator("abcdefghijklmnopqrstuvwxyz".toCharArray()).ofCodePointsLength(random(), 10, 10);
|
||||
int size = randomInt(10);
|
||||
List<String> items = new ArrayList<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
@ -77,6 +44,20 @@ public class PutCalendarActionResponseTests
|
||||
if (randomBoolean()) {
|
||||
description = randomAlphaOfLength(20);
|
||||
}
|
||||
return new Calendar(calendarId, items, description);
|
||||
Calendar calendar = new Calendar(calendarId, items, description);
|
||||
return new PutCalendarAction.Response(calendar);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PutCalendarResponse doParseToClientInstance(XContentParser parser) throws IOException {
|
||||
return PutCalendarResponse.fromXContent(parser);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void assertInstances(PutCalendarAction.Response serverTestInstance, PutCalendarResponse clientInstance) {
|
||||
org.elasticsearch.client.ml.calendars.Calendar hlrcCalendar = clientInstance.getCalendar();
|
||||
Calendar internalCalendar = new Calendar(hlrcCalendar.getId(), hlrcCalendar.getJobIds(), hlrcCalendar.getDescription());
|
||||
PutCalendarAction.Response convertedServerTestInstance =new PutCalendarAction.Response(internalCalendar);
|
||||
assertThat(convertedServerTestInstance, equalTo(serverTestInstance));
|
||||
}
|
||||
}
|
||||
|
@ -68,10 +68,7 @@ public abstract class AbstractGetResourcesRequest extends ActionRequest {
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
resourceId = in.readOptionalString();
|
||||
pageParams = in.readOptionalWriteable(PageParams::new);
|
||||
allowNoResources = in.readBoolean();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,8 +41,7 @@ public abstract class AbstractGetResourcesResponse<T extends ToXContent & Writea
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
resources = new QueryPage<>(in, getReader());
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -84,5 +83,6 @@ public abstract class AbstractGetResourcesResponse<T extends ToXContent & Writea
|
||||
public final String toString() {
|
||||
return Strings.toString(this);
|
||||
}
|
||||
|
||||
protected abstract Reader<T> getReader();
|
||||
}
|
||||
|
@ -51,6 +51,12 @@ public class DeleteDatafeedAction extends ActionType<AcknowledgedResponse> {
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
datafeedId = in.readString();
|
||||
force = in.readBoolean();
|
||||
}
|
||||
|
||||
public String getDatafeedId() {
|
||||
return datafeedId;
|
||||
}
|
||||
@ -70,9 +76,7 @@ public class DeleteDatafeedAction extends ActionType<AcknowledgedResponse> {
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
datafeedId = in.readString();
|
||||
force = in.readBoolean();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -20,18 +20,13 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class DeleteExpiredDataAction extends StreamableResponseActionType<DeleteExpiredDataAction.Response> {
|
||||
public class DeleteExpiredDataAction extends ActionType<DeleteExpiredDataAction.Response> {
|
||||
|
||||
public static final DeleteExpiredDataAction INSTANCE = new DeleteExpiredDataAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/delete_expired_data";
|
||||
|
||||
private DeleteExpiredDataAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest {
|
||||
@ -61,12 +56,14 @@ public class DeleteExpiredDataAction extends StreamableResponseActionType<Delete
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
public Response() {}
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
deleted = in.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
deleted = in.readBoolean();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -54,6 +54,12 @@ public class DeleteJobAction extends ActionType<AcknowledgedResponse> {
|
||||
|
||||
public Request() {}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobId = in.readString();
|
||||
force = in.readBoolean();
|
||||
}
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
@ -94,9 +100,7 @@ public class DeleteJobAction extends ActionType<AcknowledgedResponse> {
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
force = in.readBoolean();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.Strings;
|
||||
@ -29,18 +29,13 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class EvaluateDataFrameAction extends StreamableResponseActionType<EvaluateDataFrameAction.Response> {
|
||||
public class EvaluateDataFrameAction extends ActionType<EvaluateDataFrameAction.Response> {
|
||||
|
||||
public static final EvaluateDataFrameAction INSTANCE = new EvaluateDataFrameAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/data_frame/evaluate";
|
||||
|
||||
private EvaluateDataFrameAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, EvaluateDataFrameAction.Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -79,6 +74,12 @@ public class EvaluateDataFrameAction extends StreamableResponseActionType<Evalua
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
indices = in.readStringArray();
|
||||
evaluation = in.readNamedWriteable(Evaluation.class);
|
||||
}
|
||||
|
||||
public String[] getIndices() {
|
||||
return indices;
|
||||
}
|
||||
@ -106,9 +107,7 @@ public class EvaluateDataFrameAction extends StreamableResponseActionType<Evalua
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
indices = in.readStringArray();
|
||||
evaluation = in.readNamedWriteable(Evaluation.class);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -155,7 +154,10 @@ public class EvaluateDataFrameAction extends StreamableResponseActionType<Evalua
|
||||
private String evaluationName;
|
||||
private List<EvaluationMetricResult> metrics;
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.evaluationName = in.readString();
|
||||
this.metrics = in.readNamedWriteableList(EvaluationMetricResult.class);
|
||||
}
|
||||
|
||||
public Response(String evaluationName, List<EvaluationMetricResult> metrics) {
|
||||
@ -165,9 +167,7 @@ public class EvaluateDataFrameAction extends StreamableResponseActionType<Evalua
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
this.evaluationName = in.readString();
|
||||
this.metrics = in.readNamedWriteableList(EvaluationMetricResult.class);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,14 +42,18 @@ public class FinalizeJobExecutionAction extends ActionType<AcknowledgedResponse>
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobIds = in.readStringArray();
|
||||
}
|
||||
|
||||
public String[] getJobIds() {
|
||||
return jobIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobIds = in.readStringArray();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
@ -31,18 +31,13 @@ import java.util.Objects;
|
||||
|
||||
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||
|
||||
public class FindFileStructureAction extends StreamableResponseActionType<FindFileStructureAction.Response> {
|
||||
public class FindFileStructureAction extends ActionType<FindFileStructureAction.Response> {
|
||||
|
||||
public static final FindFileStructureAction INSTANCE = new FindFileStructureAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/findfilestructure";
|
||||
|
||||
private FindFileStructureAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
static class RequestBuilder extends ActionRequestBuilder<Request, Response> {
|
||||
@ -60,17 +55,14 @@ public class FindFileStructureAction extends StreamableResponseActionType<FindFi
|
||||
this.fileStructure = fileStructure;
|
||||
}
|
||||
|
||||
Response() {
|
||||
}
|
||||
|
||||
public FileStructure getFileStructure() {
|
||||
return fileStructure;
|
||||
Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
fileStructure = new FileStructure(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
fileStructure = new FileStructure(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -148,6 +140,27 @@ public class FindFileStructureAction extends StreamableResponseActionType<FindFi
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
linesToSample = in.readOptionalVInt();
|
||||
if (in.getVersion().onOrAfter(Version.V_7_3_0)) {
|
||||
lineMergeSizeLimit = in.readOptionalVInt();
|
||||
}
|
||||
timeout = in.readOptionalTimeValue();
|
||||
charset = in.readOptionalString();
|
||||
format = in.readBoolean() ? in.readEnum(FileStructure.Format.class) : null;
|
||||
columnNames = in.readBoolean() ? in.readStringList() : null;
|
||||
hasHeaderRow = in.readOptionalBoolean();
|
||||
delimiter = in.readBoolean() ? (char) in.readVInt() : null;
|
||||
quote = in.readBoolean() ? (char) in.readVInt() : null;
|
||||
shouldTrimFields = in.readOptionalBoolean();
|
||||
grokPattern = in.readOptionalString();
|
||||
timestampFormat = in.readOptionalString();
|
||||
timestampField = in.readOptionalString();
|
||||
sample = in.readBytesReference();
|
||||
}
|
||||
|
||||
|
||||
public Integer getLinesToSample() {
|
||||
return linesToSample;
|
||||
}
|
||||
@ -336,23 +349,7 @@ public class FindFileStructureAction extends StreamableResponseActionType<FindFi
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
linesToSample = in.readOptionalVInt();
|
||||
if (in.getVersion().onOrAfter(Version.V_7_3_0)) {
|
||||
lineMergeSizeLimit = in.readOptionalVInt();
|
||||
}
|
||||
timeout = in.readOptionalTimeValue();
|
||||
charset = in.readOptionalString();
|
||||
format = in.readBoolean() ? in.readEnum(FileStructure.Format.class) : null;
|
||||
columnNames = in.readBoolean() ? in.readStringList() : null;
|
||||
hasHeaderRow = in.readOptionalBoolean();
|
||||
delimiter = in.readBoolean() ? (char) in.readVInt() : null;
|
||||
quote = in.readBoolean() ? (char) in.readVInt() : null;
|
||||
shouldTrimFields = in.readOptionalBoolean();
|
||||
grokPattern = in.readOptionalString();
|
||||
timestampFormat = in.readOptionalString();
|
||||
timestampField = in.readOptionalString();
|
||||
sample = in.readBytesReference();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -28,18 +28,13 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetBucketsAction extends StreamableResponseActionType<GetBucketsAction.Response> {
|
||||
public class GetBucketsAction extends ActionType<GetBucketsAction.Response> {
|
||||
|
||||
public static final GetBucketsAction INSTANCE = new GetBucketsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/job/results/buckets/get";
|
||||
|
||||
private GetBucketsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -90,6 +85,20 @@ public class GetBucketsAction extends StreamableResponseActionType<GetBucketsAct
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
timestamp = in.readOptionalString();
|
||||
expand = in.readBoolean();
|
||||
excludeInterim = in.readBoolean();
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
anomalyScore = in.readOptionalDouble();
|
||||
pageParams = in.readOptionalWriteable(PageParams::new);
|
||||
sort = in.readString();
|
||||
descending = in.readBoolean();
|
||||
}
|
||||
|
||||
public Request(String jobId) {
|
||||
this.jobId = ExceptionsHelper.requireNonNull(jobId, Job.ID.getPreferredName());
|
||||
}
|
||||
@ -201,17 +210,7 @@ public class GetBucketsAction extends StreamableResponseActionType<GetBucketsAct
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
timestamp = in.readOptionalString();
|
||||
expand = in.readBoolean();
|
||||
excludeInterim = in.readBoolean();
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
anomalyScore = in.readOptionalDouble();
|
||||
pageParams = in.readOptionalWriteable(PageParams::new);
|
||||
sort = in.readString();
|
||||
descending = in.readBoolean();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -292,7 +291,8 @@ public class GetBucketsAction extends StreamableResponseActionType<GetBucketsAct
|
||||
|
||||
public static class Response extends AbstractGetResourcesResponse<Bucket> implements ToXContentObject {
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public Response(QueryPage<Bucket> buckets) {
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.ValidateActions;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
@ -29,17 +29,12 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetCalendarEventsAction extends StreamableResponseActionType<GetCalendarEventsAction.Response> {
|
||||
public class GetCalendarEventsAction extends ActionType<GetCalendarEventsAction.Response> {
|
||||
public static final GetCalendarEventsAction INSTANCE = new GetCalendarEventsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/calendars/events/get";
|
||||
|
||||
private GetCalendarEventsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -74,6 +69,15 @@ public class GetCalendarEventsAction extends StreamableResponseActionType<GetCal
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
calendarId = in.readString();
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
jobId = in.readOptionalString();
|
||||
pageParams = new PageParams(in);
|
||||
}
|
||||
|
||||
public Request(String calendarId) {
|
||||
setCalendarId(calendarId);
|
||||
}
|
||||
@ -131,12 +135,7 @@ public class GetCalendarEventsAction extends StreamableResponseActionType<GetCal
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
calendarId = in.readString();
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
jobId = in.readOptionalString();
|
||||
pageParams = new PageParams(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -196,7 +195,8 @@ public class GetCalendarEventsAction extends StreamableResponseActionType<GetCal
|
||||
|
||||
public static class Response extends AbstractGetResourcesResponse<ScheduledEvent> implements ToXContentObject {
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public Response(QueryPage<ScheduledEvent> scheduledEvents) {
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -28,18 +28,13 @@ import java.util.Objects;
|
||||
|
||||
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||
|
||||
public class GetCalendarsAction extends StreamableResponseActionType<GetCalendarsAction.Response> {
|
||||
public class GetCalendarsAction extends ActionType<GetCalendarsAction.Response> {
|
||||
|
||||
public static final GetCalendarsAction INSTANCE = new GetCalendarsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/calendars/get";
|
||||
|
||||
private GetCalendarsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -67,6 +62,12 @@ public class GetCalendarsAction extends StreamableResponseActionType<GetCalendar
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
calendarId = in.readOptionalString();
|
||||
pageParams = in.readOptionalWriteable(PageParams::new);
|
||||
}
|
||||
|
||||
public void setCalendarId(String calendarId) {
|
||||
this.calendarId = calendarId;
|
||||
}
|
||||
@ -98,9 +99,7 @@ public class GetCalendarsAction extends StreamableResponseActionType<GetCalendar
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
calendarId = in.readOptionalString();
|
||||
pageParams = in.readOptionalWriteable(PageParams::new);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -154,7 +153,8 @@ public class GetCalendarsAction extends StreamableResponseActionType<GetCalendar
|
||||
super(calendars);
|
||||
}
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -29,18 +29,13 @@ import java.util.Objects;
|
||||
|
||||
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||
|
||||
public class GetCategoriesAction extends StreamableResponseActionType<GetCategoriesAction.Response> {
|
||||
public class GetCategoriesAction extends ActionType<GetCategoriesAction.Response> {
|
||||
|
||||
public static final GetCategoriesAction INSTANCE = new GetCategoriesAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/job/results/categories/get";
|
||||
|
||||
private GetCategoriesAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -76,6 +71,13 @@ public class GetCategoriesAction extends StreamableResponseActionType<GetCategor
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobId = in.readString();
|
||||
categoryId = in.readOptionalLong();
|
||||
pageParams = in.readOptionalWriteable(PageParams::new);
|
||||
}
|
||||
|
||||
public String getJobId() { return jobId; }
|
||||
|
||||
public PageParams getPageParams() { return pageParams; }
|
||||
@ -111,10 +113,7 @@ public class GetCategoriesAction extends StreamableResponseActionType<GetCategor
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
categoryId = in.readOptionalLong();
|
||||
pageParams = in.readOptionalWriteable(PageParams::new);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -170,7 +169,8 @@ public class GetCategoriesAction extends StreamableResponseActionType<GetCategor
|
||||
super(result);
|
||||
}
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public QueryPage<CategoryDefinition> getResult() {
|
||||
|
@ -6,7 +6,7 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -16,20 +16,14 @@ import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
||||
public class GetDataFrameAnalyticsAction extends StreamableResponseActionType<GetDataFrameAnalyticsAction.Response> {
|
||||
public class GetDataFrameAnalyticsAction extends ActionType<GetDataFrameAnalyticsAction.Response> {
|
||||
|
||||
public static final GetDataFrameAnalyticsAction INSTANCE = new GetDataFrameAnalyticsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/data_frame/analytics/get";
|
||||
|
||||
private GetDataFrameAnalyticsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response(new QueryPage<>(Collections.emptyList(), 0, Response.RESULTS_FIELD));
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends AbstractGetResourcesRequest {
|
||||
@ -46,7 +40,7 @@ public class GetDataFrameAnalyticsAction extends StreamableResponseActionType<Ge
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
readFrom(in);
|
||||
super(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -59,7 +53,9 @@ public class GetDataFrameAnalyticsAction extends StreamableResponseActionType<Ge
|
||||
|
||||
public static final ParseField RESULTS_FIELD = new ParseField("data_frame_analytics");
|
||||
|
||||
public Response() {}
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public Response(QueryPage<DataFrameAnalyticsConfig> analytics) {
|
||||
super(analytics);
|
||||
|
@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.master.MasterNodeReadOperationRequestBuilder;
|
||||
import org.elasticsearch.action.support.master.MasterNodeReadRequest;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
@ -23,7 +23,7 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetDatafeedsAction extends StreamableResponseActionType<GetDatafeedsAction.Response> {
|
||||
public class GetDatafeedsAction extends ActionType<GetDatafeedsAction.Response> {
|
||||
|
||||
public static final GetDatafeedsAction INSTANCE = new GetDatafeedsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/datafeeds/get";
|
||||
@ -31,12 +31,7 @@ public class GetDatafeedsAction extends StreamableResponseActionType<GetDatafeed
|
||||
public static final String ALL = "_all";
|
||||
|
||||
private GetDatafeedsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends MasterNodeReadRequest<Request> {
|
||||
@ -125,7 +120,9 @@ public class GetDatafeedsAction extends StreamableResponseActionType<GetDatafeed
|
||||
super(datafeeds);
|
||||
}
|
||||
|
||||
public Response() {}
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public QueryPage<DatafeedConfig> getResponse() {
|
||||
return getResources();
|
||||
|
@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.master.MasterNodeReadOperationRequestBuilder;
|
||||
import org.elasticsearch.action.support.master.MasterNodeReadRequest;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
@ -34,7 +34,7 @@ import java.util.Objects;
|
||||
|
||||
import static org.elasticsearch.Version.V_7_4_0;
|
||||
|
||||
public class GetDatafeedsStatsAction extends StreamableResponseActionType<GetDatafeedsStatsAction.Response> {
|
||||
public class GetDatafeedsStatsAction extends ActionType<GetDatafeedsStatsAction.Response> {
|
||||
|
||||
public static final GetDatafeedsStatsAction INSTANCE = new GetDatafeedsStatsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/datafeeds/stats/get";
|
||||
@ -46,12 +46,7 @@ public class GetDatafeedsStatsAction extends StreamableResponseActionType<GetDat
|
||||
private static final String TIMING_STATS = "timing_stats";
|
||||
|
||||
private GetDatafeedsStatsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends MasterNodeReadRequest<Request> {
|
||||
@ -256,7 +251,9 @@ public class GetDatafeedsStatsAction extends StreamableResponseActionType<GetDat
|
||||
super(datafeedsStats);
|
||||
}
|
||||
|
||||
public Response() {}
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public QueryPage<DatafeedStats> getResponse() {
|
||||
return getResources();
|
||||
|
@ -7,8 +7,9 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.xcontent.StatusToXContentObject;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.xpack.core.action.AbstractGetResourcesRequest;
|
||||
@ -17,21 +18,18 @@ import org.elasticsearch.xpack.core.action.util.PageParams;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.MlFilter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||
|
||||
|
||||
public class GetFiltersAction extends StreamableResponseActionType<GetFiltersAction.Response> {
|
||||
public class GetFiltersAction extends ActionType<GetFiltersAction.Response> {
|
||||
|
||||
public static final GetFiltersAction INSTANCE = new GetFiltersAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/filters/get";
|
||||
|
||||
private GetFiltersAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends AbstractGetResourcesRequest {
|
||||
@ -41,6 +39,10 @@ public class GetFiltersAction extends StreamableResponseActionType<GetFiltersAct
|
||||
super(null, null, true);
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public void setFilterId(String filterId) {
|
||||
setResourceId(filterId);
|
||||
}
|
||||
@ -79,7 +81,8 @@ public class GetFiltersAction extends StreamableResponseActionType<GetFiltersAct
|
||||
super(filters);
|
||||
}
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public QueryPage<MlFilter> getFilters() {
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -27,18 +27,13 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetInfluencersAction extends StreamableResponseActionType<GetInfluencersAction.Response> {
|
||||
public class GetInfluencersAction extends ActionType<GetInfluencersAction.Response> {
|
||||
|
||||
public static final GetInfluencersAction INSTANCE = new GetInfluencersAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/job/results/influencers/get";
|
||||
|
||||
private GetInfluencersAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -83,6 +78,18 @@ public class GetInfluencersAction extends StreamableResponseActionType<GetInflue
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobId = in.readString();
|
||||
excludeInterim = in.readBoolean();
|
||||
pageParams = new PageParams(in);
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
sort = in.readOptionalString();
|
||||
descending = in.readBoolean();
|
||||
influencerScore = in.readDouble();
|
||||
}
|
||||
|
||||
public Request(String jobId) {
|
||||
this.jobId = ExceptionsHelper.requireNonNull(jobId, Job.ID.getPreferredName());
|
||||
}
|
||||
@ -154,15 +161,7 @@ public class GetInfluencersAction extends StreamableResponseActionType<GetInflue
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
excludeInterim = in.readBoolean();
|
||||
pageParams = new PageParams(in);
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
sort = in.readOptionalString();
|
||||
descending = in.readBoolean();
|
||||
influencerScore = in.readDouble();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -229,6 +228,10 @@ public class GetInfluencersAction extends StreamableResponseActionType<GetInflue
|
||||
public Response() {
|
||||
}
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public Response(QueryPage<Influencer> influencers) {
|
||||
super(influencers);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.master.MasterNodeReadOperationRequestBuilder;
|
||||
import org.elasticsearch.action.support.master.MasterNodeReadRequest;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
@ -23,18 +23,13 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetJobsAction extends StreamableResponseActionType<GetJobsAction.Response> {
|
||||
public class GetJobsAction extends ActionType<GetJobsAction.Response> {
|
||||
|
||||
public static final GetJobsAction INSTANCE = new GetJobsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/job/get";
|
||||
|
||||
private GetJobsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends MasterNodeReadRequest<Request> {
|
||||
@ -123,7 +118,9 @@ public class GetJobsAction extends StreamableResponseActionType<GetJobsAction.Re
|
||||
super(jobs);
|
||||
}
|
||||
|
||||
public Response() {}
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public QueryPage<Job> getResponse() {
|
||||
return getResources();
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
@ -28,18 +28,13 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetModelSnapshotsAction extends StreamableResponseActionType<GetModelSnapshotsAction.Response> {
|
||||
public class GetModelSnapshotsAction extends ActionType<GetModelSnapshotsAction.Response> {
|
||||
|
||||
public static final GetModelSnapshotsAction INSTANCE = new GetModelSnapshotsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/job/model_snapshots/get";
|
||||
|
||||
private GetModelSnapshotsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GetModelSnapshotsAction.Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -84,6 +79,17 @@ public class GetModelSnapshotsAction extends StreamableResponseActionType<GetMod
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobId = in.readString();
|
||||
snapshotId = in.readOptionalString();
|
||||
sort = in.readOptionalString();
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
desc = in.readBoolean();
|
||||
pageParams = new PageParams(in);
|
||||
}
|
||||
|
||||
public Request(String jobId, String snapshotId) {
|
||||
this.jobId = ExceptionsHelper.requireNonNull(jobId, Job.ID.getPreferredName());
|
||||
this.snapshotId = snapshotId;
|
||||
@ -148,14 +154,7 @@ public class GetModelSnapshotsAction extends StreamableResponseActionType<GetMod
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
snapshotId = in.readOptionalString();
|
||||
sort = in.readOptionalString();
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
desc = in.readBoolean();
|
||||
pageParams = new PageParams(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -221,7 +220,8 @@ public class GetModelSnapshotsAction extends StreamableResponseActionType<GetMod
|
||||
super(page);
|
||||
}
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public QueryPage<ModelSnapshot> getPage() {
|
||||
|
@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -29,7 +29,6 @@ import org.elasticsearch.xpack.core.ml.job.results.OverallBucket;
|
||||
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import java.util.function.LongSupplier;
|
||||
|
||||
@ -47,18 +46,13 @@ import java.util.function.LongSupplier;
|
||||
* the interval.
|
||||
* </p>
|
||||
*/
|
||||
public class GetOverallBucketsAction extends StreamableResponseActionType<GetOverallBucketsAction.Response> {
|
||||
public class GetOverallBucketsAction extends ActionType<GetOverallBucketsAction.Response> {
|
||||
|
||||
public static final GetOverallBucketsAction INSTANCE = new GetOverallBucketsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/job/results/overall_buckets/get";
|
||||
|
||||
private GetOverallBucketsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -117,6 +111,18 @@ public class GetOverallBucketsAction extends StreamableResponseActionType<GetOve
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobId = in.readString();
|
||||
topN = in.readVInt();
|
||||
bucketSpan = in.readOptionalTimeValue();
|
||||
overallScore = in.readDouble();
|
||||
excludeInterim = in.readBoolean();
|
||||
start = in.readOptionalLong();
|
||||
end = in.readOptionalLong();
|
||||
allowNoJobs = in.readBoolean();
|
||||
}
|
||||
|
||||
public Request(String jobId) {
|
||||
this.jobId = ExceptionsHelper.requireNonNull(jobId, Job.ID.getPreferredName());
|
||||
}
|
||||
@ -203,15 +209,7 @@ public class GetOverallBucketsAction extends StreamableResponseActionType<GetOve
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
topN = in.readVInt();
|
||||
bucketSpan = in.readOptionalTimeValue();
|
||||
overallScore = in.readDouble();
|
||||
excludeInterim = in.readBoolean();
|
||||
start = in.readOptionalLong();
|
||||
end = in.readOptionalLong();
|
||||
allowNoJobs = in.readBoolean();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -282,8 +280,8 @@ public class GetOverallBucketsAction extends StreamableResponseActionType<GetOve
|
||||
|
||||
public static class Response extends AbstractGetResourcesResponse<OverallBucket> implements ToXContentObject {
|
||||
|
||||
public Response() {
|
||||
super(new QueryPage<>(Collections.emptyList(), 0, OverallBucket.RESULTS_FIELD));
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public Response(QueryPage<OverallBucket> overallBuckets) {
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -27,18 +27,13 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetRecordsAction extends StreamableResponseActionType<GetRecordsAction.Response> {
|
||||
public class GetRecordsAction extends ActionType<GetRecordsAction.Response> {
|
||||
|
||||
public static final GetRecordsAction INSTANCE = new GetRecordsAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/job/results/records/get";
|
||||
|
||||
private GetRecordsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -83,6 +78,18 @@ public class GetRecordsAction extends StreamableResponseActionType<GetRecordsAct
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobId = in.readString();
|
||||
excludeInterim = in.readBoolean();
|
||||
pageParams = new PageParams(in);
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
sort = in.readOptionalString();
|
||||
descending = in.readBoolean();
|
||||
recordScoreFilter = in.readDouble();
|
||||
}
|
||||
|
||||
public Request(String jobId) {
|
||||
this.jobId = ExceptionsHelper.requireNonNull(jobId, Job.ID.getPreferredName());
|
||||
}
|
||||
@ -153,15 +160,7 @@ public class GetRecordsAction extends StreamableResponseActionType<GetRecordsAct
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
excludeInterim = in.readBoolean();
|
||||
pageParams = new PageParams(in);
|
||||
start = in.readOptionalString();
|
||||
end = in.readOptionalString();
|
||||
sort = in.readOptionalString();
|
||||
descending = in.readBoolean();
|
||||
recordScoreFilter = in.readDouble();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -226,7 +225,8 @@ public class GetRecordsAction extends StreamableResponseActionType<GetRecordsAct
|
||||
|
||||
public static class Response extends AbstractGetResourcesResponse<AnomalyRecord> implements ToXContentObject {
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public Response(QueryPage<AnomalyRecord> records) {
|
||||
|
@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -21,18 +21,13 @@ import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class MlInfoAction extends StreamableResponseActionType<MlInfoAction.Response> {
|
||||
public class MlInfoAction extends ActionType<MlInfoAction.Response> {
|
||||
|
||||
public static final MlInfoAction INSTANCE = new MlInfoAction();
|
||||
public static final String NAME = "cluster:monitor/xpack/ml/info/get";
|
||||
|
||||
private MlInfoAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest {
|
||||
@ -70,10 +65,18 @@ public class MlInfoAction extends StreamableResponseActionType<MlInfoAction.Resp
|
||||
this.info = Collections.emptyMap();
|
||||
}
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
info = in.readMap();
|
||||
}
|
||||
|
||||
public Map<String, Object> getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
info = in.readMap();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -30,19 +30,14 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class PostCalendarEventsAction extends StreamableResponseActionType<PostCalendarEventsAction.Response> {
|
||||
public class PostCalendarEventsAction extends ActionType<PostCalendarEventsAction.Response> {
|
||||
public static final PostCalendarEventsAction INSTANCE = new PostCalendarEventsAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/calendars/events/post";
|
||||
|
||||
public static final ParseField EVENTS = new ParseField("events");
|
||||
|
||||
private PostCalendarEventsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest {
|
||||
@ -74,6 +69,12 @@ public class PostCalendarEventsAction extends StreamableResponseActionType<PostC
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
calendarId = in.readString();
|
||||
scheduledEvents = in.readList(ScheduledEvent::new);
|
||||
}
|
||||
|
||||
public Request(String calendarId, List<ScheduledEvent> scheduledEvents) {
|
||||
this.calendarId = ExceptionsHelper.requireNonNull(calendarId, Calendar.ID.getPreferredName());
|
||||
this.scheduledEvents = ExceptionsHelper.requireNonNull(scheduledEvents, EVENTS.getPreferredName());
|
||||
@ -98,9 +99,7 @@ public class PostCalendarEventsAction extends StreamableResponseActionType<PostC
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
calendarId = in.readString();
|
||||
scheduledEvents = in.readList(ScheduledEvent::new);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -139,7 +138,13 @@ public class PostCalendarEventsAction extends StreamableResponseActionType<PostC
|
||||
|
||||
private List<ScheduledEvent> scheduledEvents;
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
in.readList(ScheduledEvent::new);
|
||||
}
|
||||
|
||||
public Response(List<ScheduledEvent> scheduledEvents) {
|
||||
@ -148,12 +153,7 @@ public class PostCalendarEventsAction extends StreamableResponseActionType<PostC
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
in.readList(ScheduledEvent::new);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
@ -25,18 +25,13 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PreviewDatafeedAction extends StreamableResponseActionType<PreviewDatafeedAction.Response> {
|
||||
public class PreviewDatafeedAction extends ActionType<PreviewDatafeedAction.Response> {
|
||||
|
||||
public static final PreviewDatafeedAction INSTANCE = new PreviewDatafeedAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/datafeeds/preview";
|
||||
|
||||
private PreviewDatafeedAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -46,6 +41,11 @@ public class PreviewDatafeedAction extends StreamableResponseActionType<PreviewD
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
datafeedId = in.readString();
|
||||
}
|
||||
|
||||
public Request(String datafeedId) {
|
||||
setDatafeedId(datafeedId);
|
||||
}
|
||||
@ -65,8 +65,7 @@ public class PreviewDatafeedAction extends StreamableResponseActionType<PreviewD
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
datafeedId = in.readString();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -110,9 +109,11 @@ public class PreviewDatafeedAction extends StreamableResponseActionType<PreviewD
|
||||
|
||||
public static class Response extends ActionResponse implements ToXContentObject {
|
||||
|
||||
private BytesReference preview;
|
||||
private final BytesReference preview;
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
preview = in.readBytesReference();
|
||||
}
|
||||
|
||||
public Response(BytesReference preview) {
|
||||
@ -121,8 +122,7 @@ public class PreviewDatafeedAction extends StreamableResponseActionType<PreviewD
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
preview = in.readBytesReference();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -28,17 +28,12 @@ import java.util.Objects;
|
||||
|
||||
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||
|
||||
public class PutCalendarAction extends StreamableResponseActionType<PutCalendarAction.Response> {
|
||||
public class PutCalendarAction extends ActionType<PutCalendarAction.Response> {
|
||||
public static final PutCalendarAction INSTANCE = new PutCalendarAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/calendars/put";
|
||||
|
||||
private PutCalendarAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -61,6 +56,11 @@ public class PutCalendarAction extends StreamableResponseActionType<PutCalendarA
|
||||
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
calendar = new Calendar(in);
|
||||
}
|
||||
|
||||
public Request(Calendar calendar) {
|
||||
this.calendar = ExceptionsHelper.requireNonNull(calendar, "calendar");
|
||||
}
|
||||
@ -92,8 +92,7 @@ public class PutCalendarAction extends StreamableResponseActionType<PutCalendarA
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
calendar = new Calendar(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -137,7 +136,13 @@ public class PutCalendarAction extends StreamableResponseActionType<PutCalendarA
|
||||
|
||||
private Calendar calendar;
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
calendar = new Calendar(in);
|
||||
}
|
||||
|
||||
public Response(Calendar calendar) {
|
||||
@ -146,13 +151,7 @@ public class PutCalendarAction extends StreamableResponseActionType<PutCalendarA
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
calendar = new Calendar(in);
|
||||
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedRequest;
|
||||
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
@ -23,18 +23,13 @@ import org.elasticsearch.xpack.core.ml.job.messages.Messages;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PutDataFrameAnalyticsAction extends StreamableResponseActionType<PutDataFrameAnalyticsAction.Response> {
|
||||
public class PutDataFrameAnalyticsAction extends ActionType<PutDataFrameAnalyticsAction.Response> {
|
||||
|
||||
public static final PutDataFrameAnalyticsAction INSTANCE = new PutDataFrameAnalyticsAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/data_frame/analytics/put";
|
||||
|
||||
private PutDataFrameAnalyticsAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends AcknowledgedRequest<Request> implements ToXContentObject {
|
||||
@ -56,14 +51,18 @@ public class PutDataFrameAnalyticsAction extends StreamableResponseActionType<Pu
|
||||
|
||||
public Request() {}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
config = new DataFrameAnalyticsConfig(in);
|
||||
}
|
||||
|
||||
public Request(DataFrameAnalyticsConfig config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
config = new DataFrameAnalyticsConfig(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -111,10 +110,14 @@ public class PutDataFrameAnalyticsAction extends StreamableResponseActionType<Pu
|
||||
|
||||
Response() {}
|
||||
|
||||
Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
config = new DataFrameAnalyticsConfig(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
config = new DataFrameAnalyticsConfig(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedRequest;
|
||||
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
@ -22,18 +22,13 @@ import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PutDatafeedAction extends StreamableResponseActionType<PutDatafeedAction.Response> {
|
||||
public class PutDatafeedAction extends ActionType<PutDatafeedAction.Response> {
|
||||
|
||||
public static final PutDatafeedAction INSTANCE = new PutDatafeedAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/datafeeds/put";
|
||||
|
||||
private PutDatafeedAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends AcknowledgedRequest<Request> implements ToXContentObject {
|
||||
@ -53,6 +48,11 @@ public class PutDatafeedAction extends StreamableResponseActionType<PutDatafeedA
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
datafeed = new DatafeedConfig(in);
|
||||
}
|
||||
|
||||
public DatafeedConfig getDatafeed() {
|
||||
return datafeed;
|
||||
}
|
||||
@ -64,8 +64,7 @@ public class PutDatafeedAction extends StreamableResponseActionType<PutDatafeedA
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
datafeed = new DatafeedConfig(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -109,7 +108,13 @@ public class PutDatafeedAction extends StreamableResponseActionType<PutDatafeedA
|
||||
this.datafeed = datafeed;
|
||||
}
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
datafeed = new DatafeedConfig(in);
|
||||
}
|
||||
|
||||
public DatafeedConfig getResponse() {
|
||||
@ -118,12 +123,7 @@ public class PutDatafeedAction extends StreamableResponseActionType<PutDatafeedA
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
datafeed = new DatafeedConfig(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -25,18 +25,13 @@ import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class PutFilterAction extends StreamableResponseActionType<PutFilterAction.Response> {
|
||||
public class PutFilterAction extends ActionType<PutFilterAction.Response> {
|
||||
|
||||
public static final PutFilterAction INSTANCE = new PutFilterAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/filters/put";
|
||||
|
||||
private PutFilterAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -59,6 +54,11 @@ public class PutFilterAction extends StreamableResponseActionType<PutFilterActio
|
||||
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
filter = new MlFilter(in);
|
||||
}
|
||||
|
||||
public Request(MlFilter filter) {
|
||||
this.filter = ExceptionsHelper.requireNonNull(filter, "filter");
|
||||
}
|
||||
@ -74,8 +74,7 @@ public class PutFilterAction extends StreamableResponseActionType<PutFilterActio
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
filter = new MlFilter(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,14 +121,18 @@ public class PutFilterAction extends StreamableResponseActionType<PutFilterActio
|
||||
Response() {
|
||||
}
|
||||
|
||||
Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
filter = new MlFilter(in);
|
||||
}
|
||||
|
||||
public Response(MlFilter filter) {
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
filter = new MlFilter(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedRequest;
|
||||
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
@ -25,18 +25,13 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PutJobAction extends StreamableResponseActionType<PutJobAction.Response> {
|
||||
public class PutJobAction extends ActionType<PutJobAction.Response> {
|
||||
|
||||
public static final PutJobAction INSTANCE = new PutJobAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/job/put";
|
||||
|
||||
private PutJobAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends AcknowledgedRequest<Request> implements ToXContentObject {
|
||||
@ -77,6 +72,11 @@ public class PutJobAction extends StreamableResponseActionType<PutJobAction.Resp
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobBuilder = new Job.Builder(in);
|
||||
}
|
||||
|
||||
public Job.Builder getJobBuilder() {
|
||||
return jobBuilder;
|
||||
}
|
||||
@ -88,8 +88,7 @@ public class PutJobAction extends StreamableResponseActionType<PutJobAction.Resp
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobBuilder = new Job.Builder(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -132,13 +131,19 @@ public class PutJobAction extends StreamableResponseActionType<PutJobAction.Resp
|
||||
|
||||
public static class Response extends ActionResponse implements ToXContentObject {
|
||||
|
||||
private Job job;
|
||||
private final Job job;
|
||||
|
||||
public Response(Job job) {
|
||||
this.job = job;
|
||||
}
|
||||
|
||||
public Response() {
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
job = new Job(in);
|
||||
}
|
||||
|
||||
public Job getResponse() {
|
||||
@ -147,12 +152,7 @@ public class PutJobAction extends StreamableResponseActionType<PutJobAction.Resp
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
job = new Job(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedRequest;
|
||||
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
@ -29,18 +29,13 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class RevertModelSnapshotAction extends StreamableResponseActionType<RevertModelSnapshotAction.Response> {
|
||||
public class RevertModelSnapshotAction extends ActionType<RevertModelSnapshotAction.Response> {
|
||||
|
||||
public static final RevertModelSnapshotAction INSTANCE = new RevertModelSnapshotAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/job/model_snapshots/revert";
|
||||
|
||||
private RevertModelSnapshotAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends AcknowledgedRequest<Request> implements ToXContentObject {
|
||||
@ -74,6 +69,13 @@ public class RevertModelSnapshotAction extends StreamableResponseActionType<Reve
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobId = in.readString();
|
||||
snapshotId = in.readString();
|
||||
deleteInterveningResults = in.readBoolean();
|
||||
}
|
||||
|
||||
public Request(String jobId, String snapshotId) {
|
||||
this.jobId = ExceptionsHelper.requireNonNull(jobId, Job.ID.getPreferredName());
|
||||
this.snapshotId = ExceptionsHelper.requireNonNull(snapshotId, SNAPSHOT_ID.getPreferredName());
|
||||
@ -102,10 +104,7 @@ public class RevertModelSnapshotAction extends StreamableResponseActionType<Reve
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
snapshotId = in.readString();
|
||||
deleteInterveningResults = in.readBoolean();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -157,10 +156,16 @@ public class RevertModelSnapshotAction extends StreamableResponseActionType<Reve
|
||||
private static final ParseField MODEL = new ParseField("model");
|
||||
private ModelSnapshot model;
|
||||
|
||||
public Response() {
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
model = new ModelSnapshot(in);
|
||||
}
|
||||
|
||||
|
||||
public Response(ModelSnapshot modelSnapshot) {
|
||||
model = modelSnapshot;
|
||||
}
|
||||
@ -171,12 +176,7 @@ public class RevertModelSnapshotAction extends StreamableResponseActionType<Reve
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||
//the acknowledged flag was removed
|
||||
in.readBoolean();
|
||||
}
|
||||
model = new ModelSnapshot(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -18,17 +18,12 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class UpdateCalendarJobAction extends StreamableResponseActionType<PutCalendarAction.Response> {
|
||||
public class UpdateCalendarJobAction extends ActionType<PutCalendarAction.Response> {
|
||||
public static final UpdateCalendarJobAction INSTANCE = new UpdateCalendarJobAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/calendars/jobs/update";
|
||||
|
||||
private UpdateCalendarJobAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PutCalendarAction.Response newResponse() {
|
||||
return new PutCalendarAction.Response();
|
||||
super(NAME, PutCalendarAction.Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest {
|
||||
@ -40,6 +35,13 @@ public class UpdateCalendarJobAction extends StreamableResponseActionType<PutCal
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
calendarId = in.readString();
|
||||
jobIdsToAddExpression = in.readOptionalString();
|
||||
jobIdsToRemoveExpression = in.readOptionalString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Job id expressions may be a single job, job group or comma separated
|
||||
* list of job Ids or groups
|
||||
@ -69,10 +71,7 @@ public class UpdateCalendarJobAction extends StreamableResponseActionType<PutCal
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
calendarId = in.readString();
|
||||
jobIdsToAddExpression = in.readOptionalString();
|
||||
jobIdsToRemoveExpression = in.readOptionalString();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,7 +6,7 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedRequest;
|
||||
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
@ -20,18 +20,13 @@ import org.elasticsearch.xpack.core.ml.datafeed.DatafeedUpdate;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class UpdateDatafeedAction extends StreamableResponseActionType<PutDatafeedAction.Response> {
|
||||
public class UpdateDatafeedAction extends ActionType<PutDatafeedAction.Response> {
|
||||
|
||||
public static final UpdateDatafeedAction INSTANCE = new UpdateDatafeedAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/datafeeds/update";
|
||||
|
||||
private UpdateDatafeedAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PutDatafeedAction.Response newResponse() {
|
||||
return new PutDatafeedAction.Response();
|
||||
super(NAME, PutDatafeedAction.Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends AcknowledgedRequest<Request> implements ToXContentObject {
|
||||
@ -51,6 +46,11 @@ public class UpdateDatafeedAction extends StreamableResponseActionType<PutDatafe
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
update = new DatafeedUpdate(in);
|
||||
}
|
||||
|
||||
public DatafeedUpdate getUpdate() {
|
||||
return update;
|
||||
}
|
||||
@ -62,8 +62,7 @@ public class UpdateDatafeedAction extends StreamableResponseActionType<PutDatafe
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
update = new DatafeedUpdate(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
@ -32,18 +32,13 @@ import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
|
||||
public class UpdateFilterAction extends StreamableResponseActionType<PutFilterAction.Response> {
|
||||
public class UpdateFilterAction extends ActionType<PutFilterAction.Response> {
|
||||
|
||||
public static final UpdateFilterAction INSTANCE = new UpdateFilterAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/filters/update";
|
||||
|
||||
private UpdateFilterAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PutFilterAction.Response newResponse() {
|
||||
return new PutFilterAction.Response();
|
||||
super(NAME, PutFilterAction.Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -81,6 +76,14 @@ public class UpdateFilterAction extends StreamableResponseActionType<PutFilterAc
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
filterId = in.readString();
|
||||
description = in.readOptionalString();
|
||||
addItems = new TreeSet<>(Arrays.asList(in.readStringArray()));
|
||||
removeItems = new TreeSet<>(Arrays.asList(in.readStringArray()));
|
||||
}
|
||||
|
||||
public Request(String filterId) {
|
||||
this.filterId = ExceptionsHelper.requireNonNull(filterId, MlFilter.ID.getPreferredName());
|
||||
}
|
||||
@ -124,11 +127,7 @@ public class UpdateFilterAction extends StreamableResponseActionType<PutFilterAc
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
filterId = in.readString();
|
||||
description = in.readOptionalString();
|
||||
addItems = new TreeSet<>(Arrays.asList(in.readStringArray()));
|
||||
removeItems = new TreeSet<>(Arrays.asList(in.readStringArray()));
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedRequest;
|
||||
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
@ -24,17 +24,12 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class UpdateJobAction extends StreamableResponseActionType<PutJobAction.Response> {
|
||||
public class UpdateJobAction extends ActionType<PutJobAction.Response> {
|
||||
public static final UpdateJobAction INSTANCE = new UpdateJobAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/job/update";
|
||||
|
||||
private UpdateJobAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PutJobAction.Response newResponse() {
|
||||
return new PutJobAction.Response();
|
||||
super(NAME, PutJobAction.Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends AcknowledgedRequest<UpdateJobAction.Request> implements ToXContentObject {
|
||||
@ -66,6 +61,20 @@ public class UpdateJobAction extends StreamableResponseActionType<PutJobAction.R
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobId = in.readString();
|
||||
update = new JobUpdate(in);
|
||||
if (in.getVersion().onOrAfter(Version.V_6_2_2)) {
|
||||
isInternal = in.readBoolean();
|
||||
} else {
|
||||
isInternal = false;
|
||||
}
|
||||
if (in.getVersion().onOrAfter(Version.V_6_3_0) && in.getVersion().before(Version.V_7_0_0)) {
|
||||
in.readBoolean(); // was waitForAck
|
||||
}
|
||||
}
|
||||
|
||||
public static Request internal(String jobId, JobUpdate update) {
|
||||
return new Request(jobId, update, true);
|
||||
}
|
||||
@ -89,17 +98,7 @@ public class UpdateJobAction extends StreamableResponseActionType<PutJobAction.R
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
update = new JobUpdate(in);
|
||||
if (in.getVersion().onOrAfter(Version.V_6_2_2)) {
|
||||
isInternal = in.readBoolean();
|
||||
} else {
|
||||
isInternal = false;
|
||||
}
|
||||
if (in.getVersion().onOrAfter(Version.V_6_3_0) && in.getVersion().before(Version.V_7_0_0)) {
|
||||
in.readBoolean(); // was waitForAck
|
||||
}
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.StreamableResponseActionType;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.Strings;
|
||||
@ -29,18 +29,13 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class UpdateModelSnapshotAction extends StreamableResponseActionType<UpdateModelSnapshotAction.Response> {
|
||||
public class UpdateModelSnapshotAction extends ActionType<UpdateModelSnapshotAction.Response> {
|
||||
|
||||
public static final UpdateModelSnapshotAction INSTANCE = new UpdateModelSnapshotAction();
|
||||
public static final String NAME = "cluster:admin/xpack/ml/job/model_snapshots/update";
|
||||
|
||||
private UpdateModelSnapshotAction() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateModelSnapshotAction.Response newResponse() {
|
||||
return new Response();
|
||||
super(NAME, Response::new);
|
||||
}
|
||||
|
||||
public static class Request extends ActionRequest implements ToXContentObject {
|
||||
@ -73,6 +68,14 @@ public class UpdateModelSnapshotAction extends StreamableResponseActionType<Upda
|
||||
public Request() {
|
||||
}
|
||||
|
||||
public Request(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
jobId = in.readString();
|
||||
snapshotId = in.readString();
|
||||
description = in.readOptionalString();
|
||||
retain = in.readOptionalBoolean();
|
||||
}
|
||||
|
||||
public Request(String jobId, String snapshotId) {
|
||||
this.jobId = ExceptionsHelper.requireNonNull(jobId, Job.ID.getPreferredName());
|
||||
this.snapshotId = ExceptionsHelper.requireNonNull(snapshotId, ModelSnapshotField.SNAPSHOT_ID.getPreferredName());
|
||||
@ -109,11 +112,7 @@ public class UpdateModelSnapshotAction extends StreamableResponseActionType<Upda
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
jobId = in.readString();
|
||||
snapshotId = in.readString();
|
||||
description = in.readOptionalString();
|
||||
retain = in.readOptionalBoolean();
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -166,10 +165,11 @@ public class UpdateModelSnapshotAction extends StreamableResponseActionType<Upda
|
||||
private static final ParseField ACKNOWLEDGED = new ParseField("acknowledged");
|
||||
private static final ParseField MODEL = new ParseField("model");
|
||||
|
||||
private ModelSnapshot model;
|
||||
|
||||
public Response() {
|
||||
private final ModelSnapshot model;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
model = new ModelSnapshot(in);
|
||||
}
|
||||
|
||||
public Response(ModelSnapshot modelSnapshot) {
|
||||
@ -182,8 +182,7 @@ public class UpdateModelSnapshotAction extends StreamableResponseActionType<Upda
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
model = new ModelSnapshot(in);
|
||||
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,10 +5,11 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.DeleteDatafeedAction.Request;
|
||||
|
||||
public class DeleteDatafeedRequestTests extends AbstractStreamableTestCase<Request> {
|
||||
public class DeleteDatafeedRequestTests extends AbstractWireSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected Request createTestInstance() {
|
||||
@ -16,7 +17,7 @@ public class DeleteDatafeedRequestTests extends AbstractStreamableTestCase<Reque
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,11 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.DeleteExpiredDataAction.Response;
|
||||
|
||||
public class DeleteExpiredDataActionResponseTests extends AbstractStreamableTestCase<Response> {
|
||||
public class DeleteExpiredDataActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -16,7 +17,7 @@ public class DeleteExpiredDataActionResponseTests extends AbstractStreamableTest
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,10 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.DeleteJobAction;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
|
||||
public class DeleteJobRequestTests extends AbstractStreamableTestCase<DeleteJobAction.Request> {
|
||||
public class DeleteJobRequestTests extends AbstractWireSerializingTestCase<DeleteJobAction.Request> {
|
||||
|
||||
@Override
|
||||
protected DeleteJobAction.Request createTestInstance() {
|
||||
@ -18,7 +18,7 @@ public class DeleteJobRequestTests extends AbstractStreamableTestCase<DeleteJobA
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DeleteJobAction.Request createBlankInstance() {
|
||||
return new DeleteJobAction.Request();
|
||||
protected Writeable.Reader<DeleteJobAction.Request> instanceReader() {
|
||||
return DeleteJobAction.Request::new;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,9 +6,10 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.EvaluateDataFrameAction.Request;
|
||||
import org.elasticsearch.xpack.core.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider;
|
||||
import org.elasticsearch.xpack.core.ml.dataframe.evaluation.softclassification.BinarySoftClassificationTests;
|
||||
@ -16,7 +17,7 @@ import org.elasticsearch.xpack.core.ml.dataframe.evaluation.softclassification.B
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EvaluateDataFrameActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class EvaluateDataFrameActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected NamedWriteableRegistry getNamedWriteableRegistry() {
|
||||
@ -42,13 +43,13 @@ public class EvaluateDataFrameActionRequestTests extends AbstractStreamableXCont
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,7 +7,8 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.filestructurefinder.FileStructure;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -15,7 +16,7 @@ import java.util.Arrays;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.startsWith;
|
||||
|
||||
public class FindFileStructureActionRequestTests extends AbstractStreamableTestCase<FindFileStructureAction.Request> {
|
||||
public class FindFileStructureActionRequestTests extends AbstractWireSerializingTestCase<FindFileStructureAction.Request> {
|
||||
|
||||
@Override
|
||||
protected FindFileStructureAction.Request createTestInstance() {
|
||||
@ -73,8 +74,8 @@ public class FindFileStructureActionRequestTests extends AbstractStreamableTestC
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FindFileStructureAction.Request createBlankInstance() {
|
||||
return new FindFileStructureAction.Request();
|
||||
protected Writeable.Reader<FindFileStructureAction.Request> instanceReader() {
|
||||
return FindFileStructureAction.Request::new;
|
||||
}
|
||||
|
||||
public void testValidateLinesToSample() {
|
||||
|
@ -5,10 +5,11 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.filestructurefinder.FileStructureTests;
|
||||
|
||||
public class FindFileStructureActionResponseTests extends AbstractStreamableTestCase<FindFileStructureAction.Response> {
|
||||
public class FindFileStructureActionResponseTests extends AbstractWireSerializingTestCase<FindFileStructureAction.Response> {
|
||||
|
||||
@Override
|
||||
protected FindFileStructureAction.Response createTestInstance() {
|
||||
@ -16,7 +17,7 @@ public class FindFileStructureActionResponseTests extends AbstractStreamableTest
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FindFileStructureAction.Response createBlankInstance() {
|
||||
return new FindFileStructureAction.Response();
|
||||
protected Writeable.Reader<FindFileStructureAction.Response> instanceReader() {
|
||||
return FindFileStructureAction.Response::new;
|
||||
}
|
||||
}
|
||||
|
@ -5,12 +5,13 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetBucketsAction.Request;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.PageParams;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetBucketsAction.Request;
|
||||
|
||||
public class GetBucketActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class GetBucketActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected Request createTestInstance() {
|
||||
@ -51,13 +52,13 @@ public class GetBucketActionRequestTests extends AbstractStreamableXContentTestC
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new GetBucketsAction.Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,7 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetBucketsAction.Response;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecord;
|
||||
@ -17,7 +18,7 @@ import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class GetBucketActionResponseTests extends AbstractStreamableTestCase<Response> {
|
||||
public class GetBucketActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -75,8 +76,7 @@ public class GetBucketActionResponseTests extends AbstractStreamableTestCase<Res
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new GetBucketsAction.Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,12 +6,12 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetCalendarEventsAction;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.PageParams;
|
||||
|
||||
public class GetCalendarEventsActionRequestTests extends AbstractStreamableXContentTestCase<GetCalendarEventsAction.Request> {
|
||||
public class GetCalendarEventsActionRequestTests extends AbstractSerializingTestCase<GetCalendarEventsAction.Request> {
|
||||
|
||||
@Override
|
||||
protected GetCalendarEventsAction.Request createTestInstance() {
|
||||
@ -33,8 +33,8 @@ public class GetCalendarEventsActionRequestTests extends AbstractStreamableXCont
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GetCalendarEventsAction.Request createBlankInstance() {
|
||||
return new GetCalendarEventsAction.Request();
|
||||
protected Writeable.Reader<GetCalendarEventsAction.Request> instanceReader() {
|
||||
return GetCalendarEventsAction.Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,12 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetCalendarsAction;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.PageParams;
|
||||
|
||||
public class GetCalendarsActionRequestTests extends AbstractStreamableXContentTestCase<GetCalendarsAction.Request> {
|
||||
public class GetCalendarsActionRequestTests extends AbstractSerializingTestCase<GetCalendarsAction.Request> {
|
||||
|
||||
@Override
|
||||
protected GetCalendarsAction.Request createTestInstance() {
|
||||
@ -25,8 +25,8 @@ public class GetCalendarsActionRequestTests extends AbstractStreamableXContentTe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GetCalendarsAction.Request createBlankInstance() {
|
||||
return new GetCalendarsAction.Request();
|
||||
protected Writeable.Reader<GetCalendarsAction.Request> instanceReader() {
|
||||
return GetCalendarsAction.Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,11 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.PageParams;
|
||||
|
||||
public class GetCategoriesRequestTests extends AbstractStreamableXContentTestCase<GetCategoriesAction.Request> {
|
||||
public class GetCategoriesRequestTests extends AbstractSerializingTestCase<GetCategoriesAction.Request> {
|
||||
|
||||
@Override
|
||||
protected GetCategoriesAction.Request createTestInstance() {
|
||||
@ -26,13 +27,13 @@ public class GetCategoriesRequestTests extends AbstractStreamableXContentTestCas
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<GetCategoriesAction.Request> instanceReader() {
|
||||
return GetCategoriesAction.Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GetCategoriesAction.Request createBlankInstance() {
|
||||
return new GetCategoriesAction.Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,13 +5,14 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.job.results.CategoryDefinition;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class GetCategoriesResponseTests extends AbstractStreamableTestCase<GetCategoriesAction.Response> {
|
||||
public class GetCategoriesResponseTests extends AbstractWireSerializingTestCase<GetCategoriesAction.Response> {
|
||||
|
||||
@Override
|
||||
protected GetCategoriesAction.Response createTestInstance() {
|
||||
@ -22,7 +23,7 @@ public class GetCategoriesResponseTests extends AbstractStreamableTestCase<GetCa
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GetCategoriesAction.Response createBlankInstance() {
|
||||
return new GetCategoriesAction.Response();
|
||||
protected Writeable.Reader<GetCategoriesAction.Response> instanceReader() {
|
||||
return GetCategoriesAction.Response::new;
|
||||
}
|
||||
}
|
||||
|
@ -6,10 +6,11 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.search.SearchModule;
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetDataFrameAnalyticsAction.Response;
|
||||
import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig;
|
||||
@ -20,7 +21,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class GetDataFrameAnalyticsActionResponseTests extends AbstractStreamableTestCase<Response> {
|
||||
public class GetDataFrameAnalyticsActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected NamedWriteableRegistry getNamedWriteableRegistry() {
|
||||
@ -49,7 +50,7 @@ public class GetDataFrameAnalyticsActionResponseTests extends AbstractStreamable
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
}
|
||||
|
@ -8,12 +8,13 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetDatafeedsStatsAction.Response;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;
|
||||
@ -34,7 +35,7 @@ import static org.hamcrest.Matchers.hasEntry;
|
||||
import static org.hamcrest.Matchers.hasKey;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
|
||||
public class GetDatafeedStatsActionResponseTests extends AbstractStreamableTestCase<Response> {
|
||||
public class GetDatafeedStatsActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -61,8 +62,8 @@ public class GetDatafeedStatsActionResponseTests extends AbstractStreamableTestC
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -6,9 +6,10 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.search.SearchModule;
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetDatafeedsAction.Response;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;
|
||||
@ -18,7 +19,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class GetDatafeedsActionResponseTests extends AbstractStreamableTestCase<Response> {
|
||||
public class GetDatafeedsActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -31,8 +32,8 @@ public class GetDatafeedsActionResponseTests extends AbstractStreamableTestCase<
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,11 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetFiltersAction.Request;
|
||||
import org.elasticsearch.xpack.core.action.util.PageParams;
|
||||
|
||||
public class GetFiltersActionRequestTests extends AbstractStreamableTestCase<GetFiltersAction.Request> {
|
||||
public class GetFiltersActionRequestTests extends AbstractWireSerializingTestCase<Request> {
|
||||
|
||||
|
||||
@Override
|
||||
@ -28,8 +29,7 @@ public class GetFiltersActionRequestTests extends AbstractStreamableTestCase<Get
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetFiltersAction.Response;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.MlFilter;
|
||||
@ -13,7 +14,7 @@ import org.elasticsearch.xpack.core.ml.job.config.MlFilterTests;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class GetFiltersActionResponseTests extends AbstractStreamableTestCase<GetFiltersAction.Response> {
|
||||
public class GetFiltersActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -24,8 +25,7 @@ public class GetFiltersActionResponseTests extends AbstractStreamableTestCase<Ge
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,12 +5,13 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction.Request;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.PageParams;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction.Request;
|
||||
|
||||
public class GetInfluencersActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class GetInfluencersActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected Request doParseInstance(XContentParser parser) {
|
||||
@ -49,13 +50,12 @@ public class GetInfluencersActionRequestTests extends AbstractStreamableXContent
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,16 +5,17 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction.Response;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction.Response;
|
||||
import org.elasticsearch.xpack.core.ml.job.results.Influencer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class GetInfluencersActionResponseTests extends AbstractStreamableTestCase<GetInfluencersAction.Response> {
|
||||
public class GetInfluencersActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -34,8 +35,7 @@ public class GetInfluencersActionResponseTests extends AbstractStreamableTestCas
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetJobsAction.Response;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.Job;
|
||||
@ -14,7 +15,7 @@ import org.elasticsearch.xpack.core.ml.job.config.JobTests;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GetJobsActionResponseTests extends AbstractStreamableTestCase<GetJobsAction.Response> {
|
||||
public class GetJobsActionResponseTests extends AbstractWireSerializingTestCase<GetJobsAction.Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -32,8 +33,7 @@ public class GetJobsActionResponseTests extends AbstractStreamableTestCase<GetJo
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,16 +5,17 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction.Request;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.PageParams;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction.Request;
|
||||
|
||||
public class GetModelSnapshotsActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class GetModelSnapshotsActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected Request doParseInstance(XContentParser parser) {
|
||||
return GetModelSnapshotsAction.Request.parseRequest(null, null, parser);
|
||||
return Request.parseRequest(null, null, parser);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -41,13 +42,12 @@ public class GetModelSnapshotsActionRequestTests extends AbstractStreamableXCont
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction.Response;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot;
|
||||
@ -14,7 +15,7 @@ import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapsho
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GetModelSnapshotsActionResponseTests extends AbstractStreamableTestCase<GetModelSnapshotsAction.Response> {
|
||||
public class GetModelSnapshotsActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -28,7 +29,7 @@ public class GetModelSnapshotsActionResponseTests extends AbstractStreamableTest
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
}
|
||||
|
@ -5,12 +5,13 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetOverallBucketsAction.Request;
|
||||
|
||||
public class GetOverallBucketsActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class GetOverallBucketsActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected Request createTestInstance() {
|
||||
@ -39,13 +40,13 @@ public class GetOverallBucketsActionRequestTests extends AbstractStreamableXCont
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,7 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetOverallBucketsAction.Response;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.job.results.OverallBucket;
|
||||
@ -14,7 +15,7 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class GetOverallBucketsActionResponseTests extends AbstractStreamableTestCase<Response> {
|
||||
public class GetOverallBucketsActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -34,7 +35,7 @@ public class GetOverallBucketsActionResponseTests extends AbstractStreamableTest
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
}
|
||||
|
@ -5,12 +5,13 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetRecordsAction.Request;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.action.util.PageParams;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetRecordsAction.Request;
|
||||
|
||||
public class GetRecordsActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class GetRecordsActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected Request doParseInstance(XContentParser parser) {
|
||||
@ -49,13 +50,12 @@ public class GetRecordsActionRequestTests extends AbstractStreamableXContentTest
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetRecordsAction.Response;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecord;
|
||||
@ -14,7 +15,7 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class GetRecordsActionResponseTests extends AbstractStreamableTestCase<GetRecordsAction.Response> {
|
||||
public class GetRecordsActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -30,8 +31,7 @@ public class GetRecordsActionResponseTests extends AbstractStreamableTestCase<Ge
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,9 +7,10 @@ package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.ElasticsearchStatusException;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.calendars.ScheduledEvent;
|
||||
import org.elasticsearch.xpack.core.ml.calendars.ScheduledEventTests;
|
||||
|
||||
@ -17,7 +18,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PostCalendarEventActionRequestTests extends AbstractStreamableTestCase<PostCalendarEventsAction.Request> {
|
||||
public class PostCalendarEventActionRequestTests extends AbstractWireSerializingTestCase<PostCalendarEventsAction.Request> {
|
||||
|
||||
@Override
|
||||
protected PostCalendarEventsAction.Request createTestInstance() {
|
||||
@ -25,6 +26,11 @@ public class PostCalendarEventActionRequestTests extends AbstractStreamableTestC
|
||||
return createTestInstance(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Writeable.Reader<PostCalendarEventsAction.Request> instanceReader() {
|
||||
return PostCalendarEventsAction.Request::new;
|
||||
}
|
||||
|
||||
private PostCalendarEventsAction.Request createTestInstance(String calendarId) {
|
||||
int numEvents = randomIntBetween(1, 10);
|
||||
List<ScheduledEvent> events = new ArrayList<>();
|
||||
@ -36,12 +42,6 @@ public class PostCalendarEventActionRequestTests extends AbstractStreamableTestC
|
||||
return request;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PostCalendarEventsAction.Request createBlankInstance() {
|
||||
return new PostCalendarEventsAction.Request();
|
||||
}
|
||||
|
||||
|
||||
public void testParseRequest() throws IOException {
|
||||
PostCalendarEventsAction.Request sourceRequest = createTestInstance();
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.PreviewDatafeedAction.Request;
|
||||
|
||||
public class PreviewDatafeedActionRequestTests extends AbstractStreamableTestCase<Request> {
|
||||
public class PreviewDatafeedActionRequestTests extends AbstractWireSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected Request createTestInstance() {
|
||||
@ -16,7 +17,7 @@ public class PreviewDatafeedActionRequestTests extends AbstractStreamableTestCas
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
}
|
||||
|
@ -5,12 +5,13 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.calendars.CalendarTests;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.JobTests;
|
||||
|
||||
public class PutCalendarActionRequestTests extends AbstractStreamableXContentTestCase<PutCalendarAction.Request> {
|
||||
public class PutCalendarActionRequestTests extends AbstractSerializingTestCase<PutCalendarAction.Request> {
|
||||
|
||||
private final String calendarId = JobTests.randomValidJobId();
|
||||
|
||||
@ -20,13 +21,13 @@ public class PutCalendarActionRequestTests extends AbstractStreamableXContentTes
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<PutCalendarAction.Request> instanceReader() {
|
||||
return PutCalendarAction.Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PutCalendarAction.Request createBlankInstance() {
|
||||
return new PutCalendarAction.Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,11 +6,12 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.search.SearchModule;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutDataFrameAnalyticsAction.Request;
|
||||
import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfigTests;
|
||||
import org.elasticsearch.xpack.core.ml.dataframe.analyses.MlDataFrameAnalysisNamedXContentProvider;
|
||||
@ -20,7 +21,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class PutDataFrameAnalyticsActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class PutDataFrameAnalyticsActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
private String id;
|
||||
|
||||
@ -51,13 +52,13 @@ public class PutDataFrameAnalyticsActionRequestTests extends AbstractStreamableX
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,10 +6,10 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.search.SearchModule;
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutDataFrameAnalyticsAction.Response;
|
||||
import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfigTests;
|
||||
import org.elasticsearch.xpack.core.ml.dataframe.analyses.MlDataFrameAnalysisNamedXContentProvider;
|
||||
@ -18,7 +18,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class PutDataFrameAnalyticsActionResponseTests extends AbstractStreamableTestCase<Response> {
|
||||
public class PutDataFrameAnalyticsActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected NamedWriteableRegistry getNamedWriteableRegistry() {
|
||||
@ -28,21 +28,13 @@ public class PutDataFrameAnalyticsActionResponseTests extends AbstractStreamable
|
||||
return new NamedWriteableRegistry(namedWriteables);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NamedXContentRegistry xContentRegistry() {
|
||||
List<NamedXContentRegistry.Entry> namedXContent = new ArrayList<>();
|
||||
namedXContent.addAll(new MlDataFrameAnalysisNamedXContentProvider().getNamedXContentParsers());
|
||||
namedXContent.addAll(new SearchModule(Settings.EMPTY, false, Collections.emptyList()).getNamedXContents());
|
||||
return new NamedXContentRegistry(namedXContent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
return new Response(DataFrameAnalyticsConfigTests.createRandom(DataFrameAnalyticsConfigTests.randomValidId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
}
|
||||
|
@ -6,11 +6,12 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.search.SearchModule;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutDatafeedAction.Request;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfigTests;
|
||||
@ -18,7 +19,7 @@ import org.junit.Before;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class PutDatafeedActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class PutDatafeedActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
private String datafeedId;
|
||||
|
||||
@ -35,13 +36,13 @@ public class PutDatafeedActionRequestTests extends AbstractStreamableXContentTes
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,9 +6,10 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.search.SearchModule;
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutDatafeedAction.Response;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfigTests;
|
||||
@ -16,7 +17,7 @@ import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfigTests;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
public class PutDatafeedActionResponseTests extends AbstractStreamableTestCase<Response> {
|
||||
public class PutDatafeedActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -27,8 +28,8 @@ public class PutDatafeedActionResponseTests extends AbstractStreamableTestCase<R
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,12 +5,13 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutFilterAction.Request;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.MlFilterTests;
|
||||
|
||||
public class PutFilterActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class PutFilterActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
private final String filterId = MlFilterTests.randomValidFilterId();
|
||||
|
||||
@ -20,13 +21,13 @@ public class PutFilterActionRequestTests extends AbstractStreamableXContentTestC
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new PutFilterAction.Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,14 +5,15 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.MlFilter;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.MlFilterTests;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PutFilterActionResponseTests extends AbstractStreamableXContentTestCase<PutFilterAction.Response> {
|
||||
public class PutFilterActionResponseTests extends AbstractSerializingTestCase<PutFilterAction.Response> {
|
||||
|
||||
@Override
|
||||
protected PutFilterAction.Response createTestInstance() {
|
||||
@ -20,8 +21,8 @@ public class PutFilterActionResponseTests extends AbstractStreamableXContentTest
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PutFilterAction.Response createBlankInstance() {
|
||||
return new PutFilterAction.Response();
|
||||
protected Writeable.Reader<PutFilterAction.Response> instanceReader() {
|
||||
return PutFilterAction.Response::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,10 +6,11 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutJobAction.Request;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.Job;
|
||||
|
||||
@ -19,7 +20,7 @@ import java.util.Date;
|
||||
import static org.elasticsearch.xpack.core.ml.job.config.JobTests.buildJobBuilder;
|
||||
import static org.elasticsearch.xpack.core.ml.job.config.JobTests.randomValidJobId;
|
||||
|
||||
public class PutJobActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class PutJobActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
private final String jobId = randomValidJobId();
|
||||
|
||||
@ -30,8 +31,8 @@ public class PutJobActionRequestTests extends AbstractStreamableXContentTestCase
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,14 +5,15 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutJobAction.Response;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.Job;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ml.job.config.JobTests.buildJobBuilder;
|
||||
import static org.elasticsearch.xpack.core.ml.job.config.JobTests.randomValidJobId;
|
||||
|
||||
public class PutJobActionResponseTests extends AbstractStreamableTestCase<Response> {
|
||||
public class PutJobActionResponseTests extends AbstractWireSerializingTestCase<Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -21,8 +22,7 @@ public class PutJobActionResponseTests extends AbstractStreamableTestCase<Respon
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,12 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction.Request;
|
||||
|
||||
public class RevertModelSnapshotActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class RevertModelSnapshotActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected Request createTestInstance() {
|
||||
@ -23,13 +23,13 @@ public class RevertModelSnapshotActionRequestTests extends AbstractStreamableXCo
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new RevertModelSnapshotAction.Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,11 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction.Response;
|
||||
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshotTests;
|
||||
|
||||
public class RevertModelSnapshotActionResponseTests extends AbstractStreamableTestCase<RevertModelSnapshotAction.Response> {
|
||||
public class RevertModelSnapshotActionResponseTests extends AbstractWireSerializingTestCase<RevertModelSnapshotAction.Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -17,8 +18,7 @@ public class RevertModelSnapshotActionResponseTests extends AbstractStreamableTe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new RevertModelSnapshotAction.Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,9 +5,10 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
|
||||
public class UpdateCalendarJobActionResquestTests extends AbstractStreamableTestCase<UpdateCalendarJobAction.Request> {
|
||||
public class UpdateCalendarJobActionResquestTests extends AbstractWireSerializingTestCase<UpdateCalendarJobAction.Request> {
|
||||
|
||||
@Override
|
||||
protected UpdateCalendarJobAction.Request createTestInstance() {
|
||||
@ -17,7 +18,7 @@ public class UpdateCalendarJobActionResquestTests extends AbstractStreamableTest
|
||||
}
|
||||
|
||||
@Override
|
||||
protected UpdateCalendarJobAction.Request createBlankInstance() {
|
||||
return new UpdateCalendarJobAction.Request();
|
||||
protected Writeable.Reader<UpdateCalendarJobAction.Request> instanceReader() {
|
||||
return UpdateCalendarJobAction.Request::new;
|
||||
}
|
||||
}
|
||||
|
@ -6,11 +6,12 @@
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.search.SearchModule;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.UpdateDatafeedAction.Request;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfigTests;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedUpdateTests;
|
||||
@ -18,7 +19,7 @@ import org.junit.Before;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class UpdateDatafeedActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class UpdateDatafeedActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
private String datafeedId;
|
||||
|
||||
@ -33,13 +34,13 @@ public class UpdateDatafeedActionRequestTests extends AbstractStreamableXContent
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,15 +5,16 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.UpdateFilterAction.Request;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class UpdateFilterActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class UpdateFilterActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
private String filterId = randomAlphaOfLength(20);
|
||||
|
||||
@ -32,6 +33,11 @@ public class UpdateFilterActionRequestTests extends AbstractStreamableXContentTe
|
||||
return request;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
private static Collection<String> generateRandomStrings() {
|
||||
int size = randomIntBetween(0, 10);
|
||||
List<String> strings = new ArrayList<>(size);
|
||||
@ -46,11 +52,6 @@ public class UpdateFilterActionRequestTests extends AbstractStreamableXContentTe
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request doParseInstance(XContentParser parser) {
|
||||
return Request.parseRequest(filterId, parser);
|
||||
|
@ -5,12 +5,13 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.AnalysisLimits;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.JobUpdate;
|
||||
|
||||
public class UpdateJobActionRequestTests
|
||||
extends AbstractStreamableTestCase<UpdateJobAction.Request> {
|
||||
extends AbstractWireSerializingTestCase<UpdateJobAction.Request> {
|
||||
|
||||
@Override
|
||||
protected UpdateJobAction.Request createTestInstance() {
|
||||
@ -30,8 +31,7 @@ public class UpdateJobActionRequestTests
|
||||
}
|
||||
|
||||
@Override
|
||||
protected UpdateJobAction.Request createBlankInstance() {
|
||||
return new UpdateJobAction.Request();
|
||||
protected Writeable.Reader<UpdateJobAction.Request> instanceReader() {
|
||||
return UpdateJobAction.Request::new;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,12 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction.Request;
|
||||
|
||||
public class UpdateModelSnapshotActionRequestTests
|
||||
extends AbstractStreamableXContentTestCase<Request> {
|
||||
public class UpdateModelSnapshotActionRequestTests extends AbstractSerializingTestCase<Request> {
|
||||
|
||||
@Override
|
||||
protected Request doParseInstance(XContentParser parser) {
|
||||
@ -31,12 +31,12 @@ public class UpdateModelSnapshotActionRequestTests
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
protected Writeable.Reader<Request> instanceReader() {
|
||||
return Request::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request createBlankInstance() {
|
||||
return new Request();
|
||||
protected boolean supportsUnknownFields() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -5,12 +5,13 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.ml.action;
|
||||
|
||||
import org.elasticsearch.test.AbstractStreamableTestCase;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction.Response;
|
||||
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshotTests;
|
||||
|
||||
public class UpdateModelSnapshotActionResponseTests
|
||||
extends AbstractStreamableTestCase<UpdateModelSnapshotAction.Response> {
|
||||
extends AbstractWireSerializingTestCase<UpdateModelSnapshotAction.Response> {
|
||||
|
||||
@Override
|
||||
protected Response createTestInstance() {
|
||||
@ -18,7 +19,7 @@ public class UpdateModelSnapshotActionResponseTests
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response createBlankInstance() {
|
||||
return new Response();
|
||||
protected Writeable.Reader<Response> instanceReader() {
|
||||
return Response::new;
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class TransportDeleteDatafeedAction extends TransportMasterNodeAction<Del
|
||||
Client client, PersistentTasksService persistentTasksService,
|
||||
NamedXContentRegistry xContentRegistry) {
|
||||
super(DeleteDatafeedAction.NAME, transportService, clusterService, threadPool, actionFilters,
|
||||
indexNameExpressionResolver, DeleteDatafeedAction.Request::new);
|
||||
DeleteDatafeedAction.Request::new, indexNameExpressionResolver);
|
||||
this.client = client;
|
||||
this.datafeedConfigProvider = new DatafeedConfigProvider(client, xContentRegistry);
|
||||
this.persistentTasksService = persistentTasksService;
|
||||
|
@ -44,8 +44,7 @@ public class TransportDeleteFilterAction extends HandledTransportAction<DeleteFi
|
||||
public TransportDeleteFilterAction(TransportService transportService,
|
||||
ActionFilters actionFilters, Client client,
|
||||
JobConfigProvider jobConfigProvider) {
|
||||
super(DeleteFilterAction.NAME, transportService, DeleteFilterAction.Request::new, actionFilters
|
||||
);
|
||||
super(DeleteFilterAction.NAME, transportService, DeleteFilterAction.Request::new, actionFilters);
|
||||
this.client = client;
|
||||
this.jobConfigProvider = jobConfigProvider;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ public class TransportDeleteJobAction extends TransportMasterNodeAction<DeleteJo
|
||||
JobConfigProvider jobConfigProvider, DatafeedConfigProvider datafeedConfigProvider,
|
||||
MlMemoryTracker memoryTracker) {
|
||||
super(DeleteJobAction.NAME, transportService, clusterService, threadPool, actionFilters,
|
||||
indexNameExpressionResolver, DeleteJobAction.Request::new);
|
||||
DeleteJobAction.Request::new, indexNameExpressionResolver);
|
||||
this.client = client;
|
||||
this.persistentTasksService = persistentTasksService;
|
||||
this.auditor = auditor;
|
||||
|
@ -30,7 +30,7 @@ public class TransportEvaluateDataFrameAction extends HandledTransportAction<Eva
|
||||
@Inject
|
||||
public TransportEvaluateDataFrameAction(TransportService transportService, ActionFilters actionFilters, ThreadPool threadPool,
|
||||
Client client) {
|
||||
super(EvaluateDataFrameAction.NAME, transportService, EvaluateDataFrameAction.Request::new, actionFilters);
|
||||
super(EvaluateDataFrameAction.NAME, transportService, actionFilters, EvaluateDataFrameAction.Request::new);
|
||||
this.threadPool = threadPool;
|
||||
this.client = client;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class TransportFinalizeJobExecutionAction extends TransportMasterNodeActi
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client) {
|
||||
super(FinalizeJobExecutionAction.NAME, transportService, clusterService, threadPool, actionFilters,
|
||||
indexNameExpressionResolver, FinalizeJobExecutionAction.Request::new);
|
||||
FinalizeJobExecutionAction.Request::new, indexNameExpressionResolver);
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class TransportFindFileStructureAction
|
||||
|
||||
@Inject
|
||||
public TransportFindFileStructureAction(TransportService transportService, ActionFilters actionFilters, ThreadPool threadPool) {
|
||||
super(FindFileStructureAction.NAME, transportService, FindFileStructureAction.Request::new, actionFilters);
|
||||
super(FindFileStructureAction.NAME, transportService, actionFilters, FindFileStructureAction.Request::new);
|
||||
this.threadPool = threadPool;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class TransportGetBucketsAction extends HandledTransportAction<GetBuckets
|
||||
@Inject
|
||||
public TransportGetBucketsAction(TransportService transportService, ActionFilters actionFilters, JobResultsProvider jobResultsProvider,
|
||||
JobManager jobManager, Client client) {
|
||||
super(GetBucketsAction.NAME, transportService, GetBucketsAction.Request::new, actionFilters);
|
||||
super(GetBucketsAction.NAME, transportService, actionFilters, GetBucketsAction.Request::new);
|
||||
this.jobResultsProvider = jobResultsProvider;
|
||||
this.jobManager = jobManager;
|
||||
this.client = client;
|
||||
|
@ -27,8 +27,7 @@ public class TransportGetCalendarsAction extends HandledTransportAction<GetCalen
|
||||
@Inject
|
||||
public TransportGetCalendarsAction(TransportService transportService, ActionFilters actionFilters,
|
||||
JobResultsProvider jobResultsProvider) {
|
||||
super(GetCalendarsAction.NAME, transportService, GetCalendarsAction.Request::new, actionFilters
|
||||
);
|
||||
super(GetCalendarsAction.NAME, transportService, actionFilters, GetCalendarsAction.Request::new);
|
||||
this.jobResultsProvider = jobResultsProvider;
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,7 @@ public class TransportGetCategoriesAction extends HandledTransportAction<GetCate
|
||||
@Inject
|
||||
public TransportGetCategoriesAction(TransportService transportService, ActionFilters actionFilters,
|
||||
JobResultsProvider jobResultsProvider, Client client, JobManager jobManager) {
|
||||
super(GetCategoriesAction.NAME, transportService, GetCategoriesAction.Request::new, actionFilters
|
||||
);
|
||||
super(GetCategoriesAction.NAME, transportService, actionFilters, GetCategoriesAction.Request::new);
|
||||
this.jobResultsProvider = jobResultsProvider;
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
|
@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.master.StreamableTransportMasterNodeReadAction;
|
||||
import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||
@ -15,15 +15,17 @@ import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetadata;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetDatafeedsAction;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;
|
||||
import org.elasticsearch.xpack.ml.datafeed.persistence.DatafeedConfigProvider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
@ -32,8 +34,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class TransportGetDatafeedsAction extends
|
||||
StreamableTransportMasterNodeReadAction<GetDatafeedsAction.Request, GetDatafeedsAction.Response> {
|
||||
public class TransportGetDatafeedsAction extends TransportMasterNodeReadAction<GetDatafeedsAction.Request, GetDatafeedsAction.Response> {
|
||||
|
||||
private final DatafeedConfigProvider datafeedConfigProvider;
|
||||
|
||||
@ -55,8 +56,8 @@ public class TransportGetDatafeedsAction extends
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GetDatafeedsAction.Response newResponse() {
|
||||
return new GetDatafeedsAction.Response();
|
||||
protected GetDatafeedsAction.Response read(StreamInput in) throws IOException {
|
||||
return new GetDatafeedsAction.Response(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.master.StreamableTransportMasterNodeReadAction;
|
||||
import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||
@ -15,22 +15,24 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.MlTasks;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetDatafeedsStatsAction;
|
||||
import org.elasticsearch.xpack.core.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedState;
|
||||
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedTimingStats;
|
||||
import org.elasticsearch.xpack.ml.datafeed.persistence.DatafeedConfigProvider;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.JobResultsProvider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TransportGetDatafeedsStatsAction extends StreamableTransportMasterNodeReadAction<GetDatafeedsStatsAction.Request,
|
||||
public class TransportGetDatafeedsStatsAction extends TransportMasterNodeReadAction<GetDatafeedsStatsAction.Request,
|
||||
GetDatafeedsStatsAction.Response> {
|
||||
|
||||
private final DatafeedConfigProvider datafeedConfigProvider;
|
||||
@ -53,8 +55,8 @@ public class TransportGetDatafeedsStatsAction extends StreamableTransportMasterN
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GetDatafeedsStatsAction.Response newResponse() {
|
||||
return new GetDatafeedsStatsAction.Response();
|
||||
protected GetDatafeedsStatsAction.Response read(StreamInput in) throws IOException {
|
||||
return new GetDatafeedsStatsAction.Response(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,8 +26,7 @@ public class TransportGetInfluencersAction extends HandledTransportAction<GetInf
|
||||
@Inject
|
||||
public TransportGetInfluencersAction(TransportService transportService, ActionFilters actionFilters,
|
||||
JobResultsProvider jobResultsProvider, Client client, JobManager jobManager) {
|
||||
super(GetInfluencersAction.NAME, transportService, GetInfluencersAction.Request::new, actionFilters
|
||||
);
|
||||
super(GetInfluencersAction.NAME, transportService, actionFilters, GetInfluencersAction.Request::new);
|
||||
this.jobResultsProvider = jobResultsProvider;
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
|
@ -7,19 +7,22 @@ package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.master.StreamableTransportMasterNodeReadAction;
|
||||
import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetJobsAction;
|
||||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
|
||||
public class TransportGetJobsAction extends StreamableTransportMasterNodeReadAction<GetJobsAction.Request, GetJobsAction.Response> {
|
||||
import java.io.IOException;
|
||||
|
||||
public class TransportGetJobsAction extends TransportMasterNodeReadAction<GetJobsAction.Request, GetJobsAction.Response> {
|
||||
|
||||
private final JobManager jobManager;
|
||||
|
||||
@ -39,8 +42,8 @@ public class TransportGetJobsAction extends StreamableTransportMasterNodeReadAct
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GetJobsAction.Response newResponse() {
|
||||
return new GetJobsAction.Response();
|
||||
protected GetJobsAction.Response read(StreamInput in) throws IOException {
|
||||
return new GetJobsAction.Response(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,7 +28,7 @@ public class TransportGetModelSnapshotsAction extends HandledTransportAction<Get
|
||||
@Inject
|
||||
public TransportGetModelSnapshotsAction(TransportService transportService, ActionFilters actionFilters,
|
||||
JobResultsProvider jobResultsProvider, JobManager jobManager) {
|
||||
super(GetModelSnapshotsAction.NAME, transportService, GetModelSnapshotsAction.Request::new, actionFilters);
|
||||
super(GetModelSnapshotsAction.NAME, transportService, actionFilters, GetModelSnapshotsAction.Request::new);
|
||||
this.jobResultsProvider = jobResultsProvider;
|
||||
this.jobManager = jobManager;
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ import org.elasticsearch.xpack.ml.job.persistence.overallbuckets.OverallBucketsP
|
||||
import org.elasticsearch.xpack.ml.job.persistence.overallbuckets.OverallBucketsProvider;
|
||||
import org.elasticsearch.xpack.ml.utils.MlIndicesUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@ -64,8 +65,7 @@ public class TransportGetOverallBucketsAction extends HandledTransportAction<Get
|
||||
@Inject
|
||||
public TransportGetOverallBucketsAction(ThreadPool threadPool, TransportService transportService, ActionFilters actionFilters,
|
||||
ClusterService clusterService, JobManager jobManager, Client client) {
|
||||
super(GetOverallBucketsAction.NAME, transportService, GetOverallBucketsAction.Request::new, actionFilters
|
||||
);
|
||||
super(GetOverallBucketsAction.NAME, transportService, actionFilters, GetOverallBucketsAction.Request::new);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.client = client;
|
||||
@ -78,7 +78,8 @@ public class TransportGetOverallBucketsAction extends HandledTransportAction<Get
|
||||
jobManager.expandJobs(request.getJobId(), request.allowNoJobs(), ActionListener.wrap(
|
||||
jobPage -> {
|
||||
if (jobPage.count() == 0) {
|
||||
listener.onResponse(new GetOverallBucketsAction.Response());
|
||||
listener.onResponse(new GetOverallBucketsAction.Response(
|
||||
new QueryPage<>(Collections.emptyList(), 0, Job.RESULTS_FIELD)));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -107,7 +108,7 @@ public class TransportGetOverallBucketsAction extends HandledTransportAction<Get
|
||||
|
||||
ActionListener<ChunkedBucketSearcher> chunkedBucketSearcherListener = ActionListener.wrap(searcher -> {
|
||||
if (searcher == null) {
|
||||
listener.onResponse(new GetOverallBucketsAction.Response());
|
||||
listener.onResponse(new GetOverallBucketsAction.Response(new QueryPage<>(Collections.emptyList(), 0, Job.RESULTS_FIELD)));
|
||||
return;
|
||||
}
|
||||
searcher.searchAndComputeOverallBuckets(overallBucketsListener);
|
||||
|
@ -26,7 +26,7 @@ public class TransportGetRecordsAction extends HandledTransportAction<GetRecords
|
||||
@Inject
|
||||
public TransportGetRecordsAction(TransportService transportService, ActionFilters actionFilters, JobResultsProvider jobResultsProvider,
|
||||
JobManager jobManager, Client client) {
|
||||
super(GetRecordsAction.NAME, transportService, GetRecordsAction.Request::new, actionFilters);
|
||||
super(GetRecordsAction.NAME, transportService, actionFilters, GetRecordsAction.Request::new);
|
||||
this.jobResultsProvider = jobResultsProvider;
|
||||
this.jobManager = jobManager;
|
||||
this.client = client;
|
||||
|
@ -38,7 +38,7 @@ public class TransportMlInfoAction extends HandledTransportAction<MlInfoAction.R
|
||||
@Inject
|
||||
public TransportMlInfoAction(TransportService transportService, ActionFilters actionFilters,
|
||||
ClusterService clusterService, Environment env) {
|
||||
super(MlInfoAction.NAME, transportService, MlInfoAction.Request::new, actionFilters);
|
||||
super(MlInfoAction.NAME, transportService, actionFilters, MlInfoAction.Request::new);
|
||||
this.clusterService = clusterService;
|
||||
|
||||
try {
|
||||
|
@ -95,8 +95,8 @@ public class TransportOpenJobAction extends TransportMasterNodeAction<OpenJobAct
|
||||
PersistentTasksService persistentTasksService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
JobConfigProvider jobConfigProvider, MlMemoryTracker memoryTracker) {
|
||||
super(OpenJobAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
|
||||
OpenJobAction.Request::new);
|
||||
super(OpenJobAction.NAME, transportService, clusterService, threadPool, actionFilters,OpenJobAction.Request::new,
|
||||
indexNameExpressionResolver);
|
||||
this.licenseState = licenseState;
|
||||
this.persistentTasksService = persistentTasksService;
|
||||
this.jobConfigProvider = jobConfigProvider;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user