[ML] Job's CreateTime must be non-null (elastic/x-pack-elasticsearch#616)
Also simplifies Job.Builder to only have one build() method. Original commit: elastic/x-pack-elasticsearch@50e4b4c210
This commit is contained in:
parent
9a5b410110
commit
41811efcf1
|
@ -38,6 +38,7 @@ import org.elasticsearch.xpack.ml.job.JobManager;
|
||||||
import org.elasticsearch.xpack.ml.job.config.Job;
|
import org.elasticsearch.xpack.ml.job.config.Job;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class PutJobAction extends Action<PutJobAction.Request, PutJobAction.Response, PutJobAction.RequestBuilder> {
|
public class PutJobAction extends Action<PutJobAction.Request, PutJobAction.Response, PutJobAction.RequestBuilder> {
|
||||||
|
@ -62,8 +63,14 @@ public class PutJobAction extends Action<PutJobAction.Request, PutJobAction.Resp
|
||||||
public static class Request extends AcknowledgedRequest<Request> implements ToXContent {
|
public static class Request extends AcknowledgedRequest<Request> implements ToXContent {
|
||||||
|
|
||||||
public static Request parseRequest(String jobId, XContentParser parser) {
|
public static Request parseRequest(String jobId, XContentParser parser) {
|
||||||
Job job = Job.PARSER.apply(parser, null).build(true, jobId);
|
Job.Builder job = Job.PARSER.apply(parser, null);
|
||||||
return new Request(job);
|
if (job.getId() == null) {
|
||||||
|
job.setId(jobId);
|
||||||
|
}
|
||||||
|
if (job.getCreateTime() == null) {
|
||||||
|
job.setCreateTime(new Date());
|
||||||
|
}
|
||||||
|
return new Request(job.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Job job;
|
private Job job;
|
||||||
|
|
|
@ -28,6 +28,7 @@ import org.elasticsearch.transport.TransportService;
|
||||||
import org.elasticsearch.xpack.ml.job.config.Job;
|
import org.elasticsearch.xpack.ml.job.config.Job;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class ValidateJobConfigAction
|
public class ValidateJobConfigAction
|
||||||
|
@ -66,7 +67,8 @@ extends Action<ValidateJobConfigAction.Request, ValidateJobConfigAction.Response
|
||||||
Job.Builder job = Job.PARSER.apply(parser, null);
|
Job.Builder job = Job.PARSER.apply(parser, null);
|
||||||
// When jobs are PUT their ID must be supplied in the URL - assume this will
|
// When jobs are PUT their ID must be supplied in the URL - assume this will
|
||||||
// be valid unless an invalid job ID is specified in the JSON to be validated
|
// be valid unless an invalid job ID is specified in the JSON to be validated
|
||||||
return new Request(job.build(true, (job.getId() != null) ? job.getId() : "ok"));
|
job.setId(job.getId() != null ? job.getId() : "ok");
|
||||||
|
return new Request(job.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
Request() {
|
Request() {
|
||||||
|
|
|
@ -539,6 +539,10 @@ public class Job extends AbstractDiffable<Job> implements Writeable, ToXContent
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
public void setCustomSettings(Map<String, Object> customSettings) {
|
public void setCustomSettings(Map<String, Object> customSettings) {
|
||||||
this.customSettings = customSettings;
|
this.customSettings = customSettings;
|
||||||
}
|
}
|
||||||
|
@ -617,31 +621,16 @@ public class Job extends AbstractDiffable<Job> implements Writeable, ToXContent
|
||||||
}
|
}
|
||||||
|
|
||||||
public Job build() {
|
public Job build() {
|
||||||
return build(false, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Job build(boolean fromApi, String urlJobId) {
|
|
||||||
|
|
||||||
Date createTime;
|
Date createTime;
|
||||||
Date finishedTime;
|
Date finishedTime;
|
||||||
Date lastDataTime;
|
Date lastDataTime;
|
||||||
String modelSnapshotId;
|
String modelSnapshotId;
|
||||||
if (fromApi) {
|
|
||||||
if (id == null) {
|
createTime = ExceptionsHelper.requireNonNull(this.createTime, CREATE_TIME.getPreferredName());
|
||||||
id = urlJobId;
|
finishedTime = this.finishedTime;
|
||||||
} else if (!id.equals(urlJobId)) {
|
lastDataTime = this.lastDataTime;
|
||||||
throw new IllegalArgumentException(Messages.getMessage(Messages.INCONSISTENT_ID, ID.getPreferredName(), id, urlJobId));
|
modelSnapshotId = this.modelSnapshotId;
|
||||||
}
|
|
||||||
createTime = this.createTime == null ? new Date() : this.createTime;
|
|
||||||
finishedTime = null;
|
|
||||||
lastDataTime = null;
|
|
||||||
modelSnapshotId = null;
|
|
||||||
} else {
|
|
||||||
createTime = this.createTime;
|
|
||||||
finishedTime = this.finishedTime;
|
|
||||||
lastDataTime = this.lastDataTime;
|
|
||||||
modelSnapshotId = this.modelSnapshotId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (analysisConfig == null) {
|
if (analysisConfig == null) {
|
||||||
throw new IllegalArgumentException(Messages.getMessage(Messages.JOB_CONFIG_MISSING_ANALYSISCONFIG));
|
throw new IllegalArgumentException(Messages.getMessage(Messages.JOB_CONFIG_MISSING_ANALYSISCONFIG));
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
|
||||||
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
||||||
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
||||||
PlainListenableActionFuture<PutJobAction.Response> listener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PutJobAction.Response> listener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build(true, "foo")), listener);
|
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build()), listener);
|
||||||
listener.actionGet();
|
listener.actionGet();
|
||||||
fail("put job action should not be enabled!");
|
fail("put job action should not be enabled!");
|
||||||
} catch (ElasticsearchSecurityException e) {
|
} catch (ElasticsearchSecurityException e) {
|
||||||
|
@ -70,7 +70,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
|
||||||
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
||||||
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
||||||
PlainListenableActionFuture<PutJobAction.Response> listener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PutJobAction.Response> listener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build(true, "foo")), listener);
|
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build()), listener);
|
||||||
PutJobAction.Response response = listener.actionGet();
|
PutJobAction.Response response = listener.actionGet();
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
|
||||||
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
||||||
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
||||||
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build(true, "foo")), putJobListener);
|
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build()), putJobListener);
|
||||||
PutJobAction.Response response = putJobListener.actionGet();
|
PutJobAction.Response response = putJobListener.actionGet();
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
|
||||||
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
||||||
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
||||||
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build(true, "foo")), putJobListener);
|
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build()), putJobListener);
|
||||||
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
||||||
assertNotNull(putJobResponse);
|
assertNotNull(putJobResponse);
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
|
||||||
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
||||||
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
||||||
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build(true, "foo")), putJobListener);
|
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build()), putJobListener);
|
||||||
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
||||||
assertNotNull(putJobResponse);
|
assertNotNull(putJobResponse);
|
||||||
PlainListenableActionFuture<PutDatafeedAction.Response> putDatafeedListener = new PlainListenableActionFuture<>(
|
PlainListenableActionFuture<PutDatafeedAction.Response> putDatafeedListener = new PlainListenableActionFuture<>(
|
||||||
|
@ -224,7 +224,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
|
||||||
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
||||||
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
||||||
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build(true, "foo")), putJobListener);
|
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build()), putJobListener);
|
||||||
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
||||||
assertNotNull(putJobResponse);
|
assertNotNull(putJobResponse);
|
||||||
PlainListenableActionFuture<PutDatafeedAction.Response> putDatafeedListener = new PlainListenableActionFuture<>(
|
PlainListenableActionFuture<PutDatafeedAction.Response> putDatafeedListener = new PlainListenableActionFuture<>(
|
||||||
|
@ -264,7 +264,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
|
||||||
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
||||||
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
||||||
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build(true, "foo")), putJobListener);
|
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build()), putJobListener);
|
||||||
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
||||||
assertNotNull(putJobResponse);
|
assertNotNull(putJobResponse);
|
||||||
PlainListenableActionFuture<PersistentActionResponse> openJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PersistentActionResponse> openJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
|
@ -294,7 +294,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
|
||||||
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
||||||
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
||||||
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build(true, "foo")), putJobListener);
|
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build()), putJobListener);
|
||||||
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
||||||
assertNotNull(putJobResponse);
|
assertNotNull(putJobResponse);
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
|
||||||
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
try (TransportClient client = new TestXPackTransportClient(internalCluster().transportClient().settings())) {
|
||||||
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
|
||||||
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
PlainListenableActionFuture<PutJobAction.Response> putJobListener = new PlainListenableActionFuture<>(client.threadPool());
|
||||||
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build(true, "foo")), putJobListener);
|
new MachineLearningClient(client).putJob(new PutJobAction.Request(createJob("foo").build()), putJobListener);
|
||||||
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
PutJobAction.Response putJobResponse = putJobListener.actionGet();
|
||||||
assertNotNull(putJobResponse);
|
assertNotNull(putJobResponse);
|
||||||
PlainListenableActionFuture<PutDatafeedAction.Response> putDatafeedListener = new PlainListenableActionFuture<>(
|
PlainListenableActionFuture<PutDatafeedAction.Response> putDatafeedListener = new PlainListenableActionFuture<>(
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class DatafeedJobsIT extends BaseMlIntegTestCase {
|
||||||
indexDocs("data-2", numDocs2, oneWeekAgo, now);
|
indexDocs("data-2", numDocs2, oneWeekAgo, now);
|
||||||
|
|
||||||
Job.Builder job = createScheduledJob("lookback-job");
|
Job.Builder job = createScheduledJob("lookback-job");
|
||||||
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build(true, job.getId()));
|
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build());
|
||||||
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
||||||
assertTrue(putJobResponse.isAcknowledged());
|
assertTrue(putJobResponse.isAcknowledged());
|
||||||
client().execute(OpenJobAction.INSTANCE, new OpenJobAction.Request(job.getId()));
|
client().execute(OpenJobAction.INSTANCE, new OpenJobAction.Request(job.getId()));
|
||||||
|
@ -91,7 +91,7 @@ public class DatafeedJobsIT extends BaseMlIntegTestCase {
|
||||||
indexDocs("data", numDocs1, lastWeek, now);
|
indexDocs("data", numDocs1, lastWeek, now);
|
||||||
|
|
||||||
Job.Builder job = createScheduledJob("realtime-job");
|
Job.Builder job = createScheduledJob("realtime-job");
|
||||||
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build(true, job.getId()));
|
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build());
|
||||||
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
||||||
assertTrue(putJobResponse.isAcknowledged());
|
assertTrue(putJobResponse.isAcknowledged());
|
||||||
client().execute(OpenJobAction.INSTANCE, new OpenJobAction.Request(job.getId()));
|
client().execute(OpenJobAction.INSTANCE, new OpenJobAction.Request(job.getId()));
|
||||||
|
|
|
@ -10,17 +10,20 @@ import org.elasticsearch.xpack.ml.action.PutJobAction.Request;
|
||||||
import org.elasticsearch.xpack.ml.job.config.Job;
|
import org.elasticsearch.xpack.ml.job.config.Job;
|
||||||
import org.elasticsearch.xpack.ml.support.AbstractStreamableXContentTestCase;
|
import org.elasticsearch.xpack.ml.support.AbstractStreamableXContentTestCase;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import static org.elasticsearch.xpack.ml.job.config.JobTests.buildJobBuilder;
|
import static org.elasticsearch.xpack.ml.job.config.JobTests.buildJobBuilder;
|
||||||
import static org.elasticsearch.xpack.ml.job.config.JobTests.randomValidJobId;
|
import static org.elasticsearch.xpack.ml.job.config.JobTests.randomValidJobId;
|
||||||
|
|
||||||
public class PutJobActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
public class PutJobActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
|
||||||
|
|
||||||
private final String jobId = randomValidJobId();
|
private final String jobId = randomValidJobId();
|
||||||
|
private final Date date = new Date();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Request createTestInstance() {
|
protected Request createTestInstance() {
|
||||||
Job.Builder jobConfiguration = buildJobBuilder(jobId);
|
Job.Builder jobConfiguration = buildJobBuilder(jobId, date);
|
||||||
return new Request(jobConfiguration.build(true, jobConfiguration.getId()));
|
return new Request(jobConfiguration.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,7 +15,9 @@ import org.elasticsearch.xpack.ml.job.config.Job;
|
||||||
import org.elasticsearch.xpack.ml.support.AbstractStreamableXContentTestCase;
|
import org.elasticsearch.xpack.ml.support.AbstractStreamableXContentTestCase;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class ValidateJobConfigActionRequestTests extends AbstractStreamableXContentTestCase<ValidateJobConfigAction.Request> {
|
public class ValidateJobConfigActionRequestTests extends AbstractStreamableXContentTestCase<ValidateJobConfigAction.Request> {
|
||||||
|
|
||||||
|
@ -72,7 +74,9 @@ public class ValidateJobConfigActionRequestTests extends AbstractStreamableXCont
|
||||||
if (randomBoolean()) {
|
if (randomBoolean()) {
|
||||||
job.setAnalysisLimits(new AnalysisLimits(randomNonNegativeLong(), randomNonNegativeLong()));
|
job.setAnalysisLimits(new AnalysisLimits(randomNonNegativeLong(), randomNonNegativeLong()));
|
||||||
}
|
}
|
||||||
return new Request(job.build(true, "ok"));
|
job.setCreateTime(new Date());
|
||||||
|
job.setId(randomAsciiOfLength(5).replace(".", "-").replace("_", "-").toLowerCase(Locale.ENGLISH));
|
||||||
|
return new Request(job.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -310,6 +310,7 @@ public class DatafeedJobRunnerTests extends ESTestCase {
|
||||||
|
|
||||||
Job.Builder builder = new Job.Builder("foo");
|
Job.Builder builder = new Job.Builder("foo");
|
||||||
builder.setAnalysisConfig(acBuilder);
|
builder.setAnalysisConfig(acBuilder);
|
||||||
|
builder.setCreateTime(new Date());
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -257,6 +257,7 @@ public class AutodetectResultProcessorIT extends ESSingleNodeTestCase {
|
||||||
AnalysisConfig.Builder analysisConfBuilder = new AnalysisConfig.Builder(Collections.singletonList(detectorBuilder.build()));
|
AnalysisConfig.Builder analysisConfBuilder = new AnalysisConfig.Builder(Collections.singletonList(detectorBuilder.build()));
|
||||||
analysisConfBuilder.setInfluencers(Collections.singletonList("influence_field"));
|
analysisConfBuilder.setInfluencers(Collections.singletonList("influence_field"));
|
||||||
jobBuilder.setAnalysisConfig(analysisConfBuilder);
|
jobBuilder.setAnalysisConfig(analysisConfBuilder);
|
||||||
|
jobBuilder.setCreateTime(new Date());
|
||||||
|
|
||||||
ClusterState cs = ClusterState.builder(new ClusterName("_name"))
|
ClusterState cs = ClusterState.builder(new ClusterName("_name"))
|
||||||
.metaData(MetaData.builder().putCustom(MlMetadata.TYPE, MlMetadata.EMPTY_METADATA).indices(ImmutableOpenMap.of())).build();
|
.metaData(MetaData.builder().putCustom(MlMetadata.TYPE, MlMetadata.EMPTY_METADATA).indices(ImmutableOpenMap.of())).build();
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.elasticsearch.xpack.persistent.PersistentTasksInProgress.PersistentTa
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -42,7 +43,7 @@ public class BasicDistributedJobsIT extends BaseMlIntegTestCase {
|
||||||
ensureStableCluster(4);
|
ensureStableCluster(4);
|
||||||
|
|
||||||
Job.Builder job = createJob("job_id");
|
Job.Builder job = createJob("job_id");
|
||||||
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build(true, job.getId()));
|
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build());
|
||||||
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
||||||
assertTrue(putJobResponse.isAcknowledged());
|
assertTrue(putJobResponse.isAcknowledged());
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
|
@ -79,7 +80,7 @@ public class BasicDistributedJobsIT extends BaseMlIntegTestCase {
|
||||||
ensureStableCluster(4);
|
ensureStableCluster(4);
|
||||||
|
|
||||||
Job.Builder job = createScheduledJob("job_id");
|
Job.Builder job = createScheduledJob("job_id");
|
||||||
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build(true, job.getId()));
|
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build());
|
||||||
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
||||||
assertTrue(putJobResponse.isAcknowledged());
|
assertTrue(putJobResponse.isAcknowledged());
|
||||||
DatafeedConfig config = createDatafeed("data_feed_id", job.getId(), Collections.singletonList("*"));
|
DatafeedConfig config = createDatafeed("data_feed_id", job.getId(), Collections.singletonList("*"));
|
||||||
|
@ -152,7 +153,7 @@ public class BasicDistributedJobsIT extends BaseMlIntegTestCase {
|
||||||
ensureStableCluster(3);
|
ensureStableCluster(3);
|
||||||
|
|
||||||
Job.Builder job = createJob("job_id");
|
Job.Builder job = createJob("job_id");
|
||||||
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build(true, job.getId()));
|
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build());
|
||||||
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
||||||
assertTrue(putJobResponse.isAcknowledged());
|
assertTrue(putJobResponse.isAcknowledged());
|
||||||
|
|
||||||
|
@ -247,7 +248,7 @@ public class BasicDistributedJobsIT extends BaseMlIntegTestCase {
|
||||||
int numJobs = numMlNodes * 10;
|
int numJobs = numMlNodes * 10;
|
||||||
for (int i = 0; i < numJobs; i++) {
|
for (int i = 0; i < numJobs; i++) {
|
||||||
Job.Builder job = createJob(Integer.toString(i));
|
Job.Builder job = createJob(Integer.toString(i));
|
||||||
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build(true, job.getId()));
|
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build());
|
||||||
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
||||||
assertTrue(putJobResponse.isAcknowledged());
|
assertTrue(putJobResponse.isAcknowledged());
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class TooManyJobsIT extends BaseMlIntegTestCase {
|
||||||
|
|
||||||
// create and open first job, which succeeds:
|
// create and open first job, which succeeds:
|
||||||
Job.Builder job = createJob("1");
|
Job.Builder job = createJob("1");
|
||||||
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build(true, job.getId()));
|
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build());
|
||||||
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
||||||
assertTrue(putJobResponse.isAcknowledged());
|
assertTrue(putJobResponse.isAcknowledged());
|
||||||
client().execute(OpenJobAction.INSTANCE, new OpenJobAction.Request(job.getId())).get();
|
client().execute(OpenJobAction.INSTANCE, new OpenJobAction.Request(job.getId())).get();
|
||||||
|
@ -40,7 +40,7 @@ public class TooManyJobsIT extends BaseMlIntegTestCase {
|
||||||
|
|
||||||
// create and try to open second job, which fails:
|
// create and try to open second job, which fails:
|
||||||
job = createJob("2");
|
job = createJob("2");
|
||||||
putJobRequest = new PutJobAction.Request(job.build(true, job.getId()));
|
putJobRequest = new PutJobAction.Request(job.build());
|
||||||
putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
||||||
assertTrue(putJobResponse.isAcknowledged());
|
assertTrue(putJobResponse.isAcknowledged());
|
||||||
expectThrows(ElasticsearchStatusException.class,
|
expectThrows(ElasticsearchStatusException.class,
|
||||||
|
@ -74,7 +74,7 @@ public class TooManyJobsIT extends BaseMlIntegTestCase {
|
||||||
int clusterWideMaxNumberOfJobs = numNodes * maxNumberOfJobsPerNode;
|
int clusterWideMaxNumberOfJobs = numNodes * maxNumberOfJobsPerNode;
|
||||||
for (int i = 1; i <= (clusterWideMaxNumberOfJobs + 1); i++) {
|
for (int i = 1; i <= (clusterWideMaxNumberOfJobs + 1); i++) {
|
||||||
Job.Builder job = createJob(Integer.toString(i));
|
Job.Builder job = createJob(Integer.toString(i));
|
||||||
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build(true, job.getId()));
|
PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build());
|
||||||
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get();
|
||||||
assertTrue(putJobResponse.isAcknowledged());
|
assertTrue(putJobResponse.isAcknowledged());
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class JobTests extends AbstractSerializingTestCase<Job> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testConstructor_GivenEmptyJobConfiguration() {
|
public void testConstructor_GivenEmptyJobConfiguration() {
|
||||||
Job job = buildJobBuilder("foo").build(true, "foo");
|
Job job = buildJobBuilder("foo").build();
|
||||||
|
|
||||||
assertEquals("foo", job.getId());
|
assertEquals("foo", job.getId());
|
||||||
assertNotNull(job.getCreateTime());
|
assertNotNull(job.getCreateTime());
|
||||||
|
@ -58,12 +58,7 @@ public class JobTests extends AbstractSerializingTestCase<Job> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNoId() {
|
public void testNoId() {
|
||||||
expectThrows(IllegalArgumentException.class, () -> buildJobBuilder("").build(true, ""));
|
expectThrows(IllegalArgumentException.class, () -> buildJobBuilder("").build());
|
||||||
}
|
|
||||||
|
|
||||||
public void testInconsistentId() {
|
|
||||||
Exception e = expectThrows(IllegalArgumentException.class, () -> buildJobBuilder("foo").build(true, "bar"));
|
|
||||||
assertEquals(Messages.getMessage(Messages.INCONSISTENT_ID, Job.ID.getPreferredName(), "foo", "bar"), e.getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEquals_GivenDifferentClass() {
|
public void testEquals_GivenDifferentClass() {
|
||||||
|
@ -82,42 +77,54 @@ public class JobTests extends AbstractSerializingTestCase<Job> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEquals_GivenDifferentRenormalizationWindowDays() {
|
public void testEquals_GivenDifferentRenormalizationWindowDays() {
|
||||||
|
Date date = new Date();
|
||||||
Job.Builder jobDetails1 = new Job.Builder("foo");
|
Job.Builder jobDetails1 = new Job.Builder("foo");
|
||||||
jobDetails1.setAnalysisConfig(createAnalysisConfig());
|
jobDetails1.setAnalysisConfig(createAnalysisConfig());
|
||||||
jobDetails1.setRenormalizationWindowDays(3L);
|
jobDetails1.setRenormalizationWindowDays(3L);
|
||||||
|
jobDetails1.setCreateTime(date);
|
||||||
Job.Builder jobDetails2 = new Job.Builder("foo");
|
Job.Builder jobDetails2 = new Job.Builder("foo");
|
||||||
jobDetails2.setRenormalizationWindowDays(4L);
|
jobDetails2.setRenormalizationWindowDays(4L);
|
||||||
jobDetails2.setAnalysisConfig(createAnalysisConfig());
|
jobDetails2.setAnalysisConfig(createAnalysisConfig());
|
||||||
|
jobDetails2.setCreateTime(date);
|
||||||
assertFalse(jobDetails1.build().equals(jobDetails2.build()));
|
assertFalse(jobDetails1.build().equals(jobDetails2.build()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEquals_GivenDifferentBackgroundPersistInterval() {
|
public void testEquals_GivenDifferentBackgroundPersistInterval() {
|
||||||
|
Date date = new Date();
|
||||||
Job.Builder jobDetails1 = new Job.Builder("foo");
|
Job.Builder jobDetails1 = new Job.Builder("foo");
|
||||||
jobDetails1.setAnalysisConfig(createAnalysisConfig());
|
jobDetails1.setAnalysisConfig(createAnalysisConfig());
|
||||||
jobDetails1.setBackgroundPersistInterval(10000L);
|
jobDetails1.setBackgroundPersistInterval(10000L);
|
||||||
|
jobDetails1.setCreateTime(date);
|
||||||
Job.Builder jobDetails2 = new Job.Builder("foo");
|
Job.Builder jobDetails2 = new Job.Builder("foo");
|
||||||
jobDetails2.setBackgroundPersistInterval(8000L);
|
jobDetails2.setBackgroundPersistInterval(8000L);
|
||||||
jobDetails2.setAnalysisConfig(createAnalysisConfig());
|
jobDetails2.setAnalysisConfig(createAnalysisConfig());
|
||||||
|
jobDetails2.setCreateTime(date);
|
||||||
assertFalse(jobDetails1.build().equals(jobDetails2.build()));
|
assertFalse(jobDetails1.build().equals(jobDetails2.build()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEquals_GivenDifferentModelSnapshotRetentionDays() {
|
public void testEquals_GivenDifferentModelSnapshotRetentionDays() {
|
||||||
|
Date date = new Date();
|
||||||
Job.Builder jobDetails1 = new Job.Builder("foo");
|
Job.Builder jobDetails1 = new Job.Builder("foo");
|
||||||
jobDetails1.setAnalysisConfig(createAnalysisConfig());
|
jobDetails1.setAnalysisConfig(createAnalysisConfig());
|
||||||
jobDetails1.setModelSnapshotRetentionDays(10L);
|
jobDetails1.setModelSnapshotRetentionDays(10L);
|
||||||
|
jobDetails1.setCreateTime(date);
|
||||||
Job.Builder jobDetails2 = new Job.Builder("foo");
|
Job.Builder jobDetails2 = new Job.Builder("foo");
|
||||||
jobDetails2.setModelSnapshotRetentionDays(8L);
|
jobDetails2.setModelSnapshotRetentionDays(8L);
|
||||||
jobDetails2.setAnalysisConfig(createAnalysisConfig());
|
jobDetails2.setAnalysisConfig(createAnalysisConfig());
|
||||||
|
jobDetails2.setCreateTime(date);
|
||||||
assertFalse(jobDetails1.build().equals(jobDetails2.build()));
|
assertFalse(jobDetails1.build().equals(jobDetails2.build()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEquals_GivenDifferentResultsRetentionDays() {
|
public void testEquals_GivenDifferentResultsRetentionDays() {
|
||||||
|
Date date = new Date();
|
||||||
Job.Builder jobDetails1 = new Job.Builder("foo");
|
Job.Builder jobDetails1 = new Job.Builder("foo");
|
||||||
jobDetails1.setAnalysisConfig(createAnalysisConfig());
|
jobDetails1.setAnalysisConfig(createAnalysisConfig());
|
||||||
|
jobDetails1.setCreateTime(date);
|
||||||
jobDetails1.setResultsRetentionDays(30L);
|
jobDetails1.setResultsRetentionDays(30L);
|
||||||
Job.Builder jobDetails2 = new Job.Builder("foo");
|
Job.Builder jobDetails2 = new Job.Builder("foo");
|
||||||
jobDetails2.setResultsRetentionDays(4L);
|
jobDetails2.setResultsRetentionDays(4L);
|
||||||
jobDetails2.setAnalysisConfig(createAnalysisConfig());
|
jobDetails2.setAnalysisConfig(createAnalysisConfig());
|
||||||
|
jobDetails2.setCreateTime(date);
|
||||||
assertFalse(jobDetails1.build().equals(jobDetails2.build()));
|
assertFalse(jobDetails1.build().equals(jobDetails2.build()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,9 +340,9 @@ public class JobTests extends AbstractSerializingTestCase<Job> {
|
||||||
assertEquals(Messages.getMessage(Messages.INVALID_ID, Job.RESULTS_INDEX_NAME.getPreferredName()), e.getMessage());
|
assertEquals(Messages.getMessage(Messages.INVALID_ID, Job.RESULTS_INDEX_NAME.getPreferredName()), e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Job.Builder buildJobBuilder(String id) {
|
public static Job.Builder buildJobBuilder(String id, Date date) {
|
||||||
Job.Builder builder = new Job.Builder(id);
|
Job.Builder builder = new Job.Builder(id);
|
||||||
builder.setCreateTime(new Date());
|
builder.setCreateTime(date);
|
||||||
AnalysisConfig.Builder ac = createAnalysisConfig();
|
AnalysisConfig.Builder ac = createAnalysisConfig();
|
||||||
DataDescription.Builder dc = new DataDescription.Builder();
|
DataDescription.Builder dc = new DataDescription.Builder();
|
||||||
builder.setAnalysisConfig(ac);
|
builder.setAnalysisConfig(ac);
|
||||||
|
@ -343,6 +350,10 @@ public class JobTests extends AbstractSerializingTestCase<Job> {
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Job.Builder buildJobBuilder(String id) {
|
||||||
|
return buildJobBuilder(id, new Date());
|
||||||
|
}
|
||||||
|
|
||||||
public static String randomValidJobId() {
|
public static String randomValidJobId() {
|
||||||
CodepointSetGenerator generator = new CodepointSetGenerator("abcdefghijklmnopqrstuvwxyz".toCharArray());
|
CodepointSetGenerator generator = new CodepointSetGenerator("abcdefghijklmnopqrstuvwxyz".toCharArray());
|
||||||
return generator.ofCodePointsLength(random(), 10, 10);
|
return generator.ofCodePointsLength(random(), 10, 10);
|
||||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.xpack.ml.support.AbstractSerializingTestCase;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -125,6 +126,7 @@ public class JobUpdateTests extends AbstractSerializingTestCase<JobUpdate> {
|
||||||
AnalysisConfig.Builder ac = new AnalysisConfig.Builder(Arrays.asList(d1.build(), d2.build()));
|
AnalysisConfig.Builder ac = new AnalysisConfig.Builder(Arrays.asList(d1.build(), d2.build()));
|
||||||
ac.setCategorizationFieldName("cat_field");
|
ac.setCategorizationFieldName("cat_field");
|
||||||
jobBuilder.setAnalysisConfig(ac);
|
jobBuilder.setAnalysisConfig(ac);
|
||||||
|
jobBuilder.setCreateTime(new Date());
|
||||||
|
|
||||||
Job updatedJob = update.mergeWithJob(jobBuilder.build());
|
Job updatedJob = update.mergeWithJob(jobBuilder.build());
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
@ -129,6 +130,7 @@ public class AutodetectCommunicatorTests extends ESTestCase {
|
||||||
|
|
||||||
builder.setDataDescription(dd);
|
builder.setDataDescription(dd);
|
||||||
builder.setAnalysisConfig(ac);
|
builder.setAnalysisConfig(ac);
|
||||||
|
builder.setCreateTime(new Date());
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -366,6 +366,7 @@ public class AutodetectProcessManagerTests extends ESTestCase {
|
||||||
Job.Builder builder = new Job.Builder(jobId);
|
Job.Builder builder = new Job.Builder(jobId);
|
||||||
builder.setDataDescription(dd);
|
builder.setDataDescription(dd);
|
||||||
builder.setAnalysisConfig(ac);
|
builder.setAnalysisConfig(ac);
|
||||||
|
builder.setCreateTime(new Date());
|
||||||
|
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ public class ScoresUpdaterTests extends ESTestCase {
|
||||||
AnalysisConfig.Builder configBuilder = new AnalysisConfig.Builder(detectors);
|
AnalysisConfig.Builder configBuilder = new AnalysisConfig.Builder(detectors);
|
||||||
configBuilder.setBucketSpan(DEFAULT_BUCKET_SPAN);
|
configBuilder.setBucketSpan(DEFAULT_BUCKET_SPAN);
|
||||||
jobBuilder.setAnalysisConfig(configBuilder);
|
jobBuilder.setAnalysisConfig(configBuilder);
|
||||||
|
jobBuilder.setCreateTime(new Date());
|
||||||
|
|
||||||
job = jobBuilder.build();
|
job = jobBuilder.build();
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ import org.elasticsearch.xpack.ml.job.process.autodetect.state.DataCounts;
|
||||||
import org.elasticsearch.xpack.persistent.RemovePersistentTaskAction;
|
import org.elasticsearch.xpack.persistent.RemovePersistentTaskAction;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
@ -84,6 +85,7 @@ public abstract class BaseMlIntegTestCase extends SecurityIntegTestCase {
|
||||||
|
|
||||||
Job.Builder builder = new Job.Builder();
|
Job.Builder builder = new Job.Builder();
|
||||||
builder.setId(id);
|
builder.setId(id);
|
||||||
|
builder.setCreateTime(new Date());
|
||||||
|
|
||||||
builder.setAnalysisConfig(analysisConfig);
|
builder.setAnalysisConfig(analysisConfig);
|
||||||
builder.setDataDescription(dataDescription);
|
builder.setDataDescription(dataDescription);
|
||||||
|
@ -103,6 +105,7 @@ public abstract class BaseMlIntegTestCase extends SecurityIntegTestCase {
|
||||||
|
|
||||||
builder.setAnalysisConfig(analysisConfig);
|
builder.setAnalysisConfig(analysisConfig);
|
||||||
builder.setDataDescription(dataDescription);
|
builder.setDataDescription(dataDescription);
|
||||||
|
builder.setCreateTime(new Date());
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue