Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ public TaskParams(StreamInput in) throws IOException {
} else {
progressOnStart = Collections.emptyList();
}
// TODO: change version in backport
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_5_0)) {
allowLazyStart = in.readBoolean();
} else {
allowLazyStart = false;
Expand Down Expand Up @@ -234,8 +233,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_7_5_0)) {
out.writeList(progressOnStart);
}
// TODO: change version in backport
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_5_0)) {
out.writeBoolean(allowLazyStart);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ public DataFrameAnalyticsConfig(StreamInput in) throws IOException {
createTime = null;
version = null;
}
// TODO: change version in backport
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_5_0)) {
allowLazyStart = in.readBoolean();
} else {
allowLazyStart = false;
Expand Down Expand Up @@ -271,8 +270,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(false);
}
}
// TODO: change version in backport
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_5_0)) {
out.writeBoolean(allowLazyStart);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public static DataFrameAnalyticsState fromStream(StreamInput in) throws IOExcept
@Override
public void writeTo(StreamOutput out) throws IOException {
DataFrameAnalyticsState toWrite = this;
// TODO: change version in backport
if (out.getVersion().before(Version.V_8_0_0) && toWrite == STARTING) {
if (out.getVersion().before(Version.V_7_5_0) && toWrite == STARTING) {
// Before 7.5.0 there was no STARTING state and jobs for which
// tasks existed but were unassigned were considered STOPPED
toWrite = STOPPED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ public Job(StreamInput in) throws IOException {
}
resultsIndexName = in.readString();
deleting = in.readBoolean();
// TODO: change version in backport
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_5_0)) {
allowLazyOpen = in.readBoolean();
} else {
allowLazyOpen = false;
Expand Down Expand Up @@ -495,8 +494,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
out.writeString(resultsIndexName);
out.writeBoolean(deleting);
// TODO: change version in backport
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_5_0)) {
out.writeBoolean(allowLazyOpen);
}
}
Expand Down Expand Up @@ -718,8 +716,7 @@ public Builder(StreamInput in) throws IOException {
}
resultsIndexName = in.readOptionalString();
deleting = in.readBoolean();
// TODO: change version in backport
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_5_0)) {
allowLazyOpen = in.readBoolean();
}
}
Expand Down Expand Up @@ -915,8 +912,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
out.writeOptionalString(resultsIndexName);
out.writeBoolean(deleting);
// TODO: change version in backport
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_5_0)) {
out.writeBoolean(allowLazyOpen);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ public JobUpdate(StreamInput in) throws IOException {
} else {
modelSnapshotMinVersion = null;
}
// TODO: change version in backport
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_5_0)) {
allowLazyOpen = in.readOptionalBoolean();
} else {
allowLazyOpen = null;
Expand Down Expand Up @@ -187,8 +186,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(false);
}
}
// TODO: change version in backport
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_5_0)) {
out.writeOptionalBoolean(allowLazyOpen);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public void testWriteStartingStateToPre75() throws IOException {

public void testWriteStartingStateToPost75() throws IOException {
StreamOutput streamOutput = mock(StreamOutput.class);
// TODO: change version in backport
when(streamOutput.getVersion()).thenReturn(Version.V_8_0_0);
when(streamOutput.getVersion()).thenReturn(Version.V_7_5_0);
DataFrameAnalyticsState.STARTING.writeTo(streamOutput);
verify(streamOutput, times(1)).writeEnum(DataFrameAnalyticsState.STARTING);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
package org.elasticsearch.xpack.ml.integration;

import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.MetaData;
Expand Down Expand Up @@ -168,16 +167,9 @@ public void testCloseUnassignedJobAndDatafeed() throws Exception {
StopDatafeedAction.Response stopDatafeedResponse = client().execute(StopDatafeedAction.INSTANCE, stopDatafeedRequest).actionGet();
assertTrue(stopDatafeedResponse.isStopped());

// Can't normal stop an unassigned job
// Since 7.5 we can also stop an unassigned job either normally or by force
CloseJobAction.Request closeJobRequest = new CloseJobAction.Request(jobId);
ElasticsearchStatusException statusException = expectThrows(ElasticsearchStatusException.class,
() -> client().execute(CloseJobAction.INSTANCE, closeJobRequest).actionGet());
assertEquals("Cannot close job [" + jobId +
"] because the job does not have an assigned node. Use force close to close the job",
statusException.getMessage());

// Can only force close an unassigned job
closeJobRequest.setForce(true);
closeJobRequest.setForce(randomBoolean());
CloseJobAction.Response closeJobResponse = client().execute(CloseJobAction.INSTANCE, closeJobRequest).actionGet();
assertTrue(closeJobResponse.isClosed());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
"Test get old cluster job":
- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_jobs:
job_id: old-cluster-job
Expand Down Expand Up @@ -37,6 +40,9 @@

---
"Test get old cluster job's timing stats":
- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_job_stats:
job_id: old-cluster-job-with-ts
Expand All @@ -51,6 +57,9 @@

---
"Test get old cluster categorization job":
- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_jobs:
job_id: old-cluster-categorization-job
Expand Down Expand Up @@ -88,6 +97,9 @@

---
"Create a job in the mixed cluster and write some data":
- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.put_job:
job_id: mixed-cluster-job
Expand Down Expand Up @@ -141,6 +153,9 @@
---
"Test job with pre 6.4 rules":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_jobs:
job_id: job-with-old-rules
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
"Get old outlier_detection job":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics:
id: "old_cluster_outlier_detection_job"
Expand All @@ -20,6 +23,9 @@
---
"Get old outlier_detection job stats":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics_stats:
id: "old_cluster_outlier_detection_job"
Expand All @@ -30,6 +36,9 @@
---
"Start and stop old outlier_detection job":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.start_data_frame_analytics:
id: "old_cluster_outlier_detection_job"
Expand All @@ -50,6 +59,9 @@
---
"Get old regression job":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics:
id: "old_cluster_regression_job"
Expand All @@ -63,6 +75,9 @@
---
"Get old regression job stats":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics_stats:
id: "old_cluster_regression_job"
Expand All @@ -73,6 +88,9 @@
---
"Start and stop old regression job":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.start_data_frame_analytics:
id: "old_cluster_regression_job"
Expand All @@ -93,6 +111,9 @@
---
"Put an outlier_detection job on the mixed cluster":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.put_data_frame_analytics:
id: "mixed_cluster_outlier_detection_job"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ setup:

---
"Test open old jobs":
- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.open_job:
job_id: old-cluster-job
Expand Down Expand Up @@ -111,6 +114,9 @@ setup:

---
"Test get old cluster job's timing stats":
- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_job_stats:
job_id: old-cluster-job-with-ts
Expand All @@ -136,6 +142,9 @@ setup:
---
"Test job with pre 6.4 rules":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_jobs:
job_id: job-with-old-rules
Expand All @@ -146,6 +155,9 @@ setup:
---
"Test get job with function shortcut should expand":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_jobs:
job_id: old-cluster-function-shortcut-expansion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
"Get old cluster outlier_detection job":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics:
id: "old_cluster_outlier_detection_job"
Expand All @@ -20,6 +23,9 @@
---
"Get old cluster outlier_detection job stats":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics_stats:
id: "old_cluster_outlier_detection_job"
Expand All @@ -30,6 +36,9 @@
---
"Get old cluster regression job":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics:
id: "old_cluster_regression_job"
Expand All @@ -43,6 +52,9 @@
---
"Get old cluster regression job stats":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics_stats:
id: "old_cluster_regression_job"
Expand All @@ -53,6 +65,9 @@
---
"Get mixed cluster outlier_detection job":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics:
id: "mixed_cluster_outlier_detection_job"
Expand All @@ -72,6 +87,9 @@
---
"Get mixed cluster outlier_detection job stats":

- skip:
version: "7.5.0 - "
reason: waiting merge of https://github.com/elastic/elasticsearch/pull/47993
- do:
ml.get_data_frame_analytics_stats:
id: "mixed_cluster_outlier_detection_job"
Expand Down