Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML-DataFrame] Adjust data frame stats BWC following backport #44760

Merged
merged 4 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -73,7 +73,7 @@ public DataFrameTransformCheckpointStats(final long checkpoint, final IndexerSta
}

public DataFrameTransformCheckpointStats(StreamInput in) throws IOException {
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO change to V_7_4_0 after backport
if (in.getVersion().onOrAfter(Version.V_7_4_0)) {
this.checkpoint = in.readVLong();
if (in.readBoolean()) {
this.indexerState = in.readEnum(IndexerState.class);
Expand Down Expand Up @@ -151,7 +151,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws

@Override
public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO change to V_7_4_0 after backport
if (out.getVersion().onOrAfter(Version.V_7_4_0)) {
out.writeVLong(checkpoint);
if (indexerState != null) {
out.writeBoolean(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public DataFrameTransformStats(String id, DataFrameTransformTaskState taskState,
}

public DataFrameTransformStats(StreamInput in) throws IOException {
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO change to V_7_4_0 after backport
if (in.getVersion().onOrAfter(Version.V_7_4_0)) {
this.id = in.readString();
this.taskState = in.readEnum(DataFrameTransformTaskState.class);
this.reason = in.readOptionalString();
Expand Down Expand Up @@ -145,7 +145,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws

@Override
public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO change to V_7_4_0 after backport
if (out.getVersion().onOrAfter(Version.V_7_4_0)) {
out.writeString(id);
out.writeEnum(taskState);
out.writeOptionalString(reason);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public DataFrameTransformStoredDoc(StreamInput in) throws IOException {
this.id = in.readString();
this.transformState = new DataFrameTransformState(in);
this.transformStats = new DataFrameIndexerTransformStats(in);
if (in.getVersion().before(Version.V_8_0_0)) { // TODO change to V_7_4_0 after backport
if (in.getVersion().before(Version.V_7_4_0)) {
new DataFrameTransformCheckpointingInfo(in);
}
}
Expand All @@ -91,7 +91,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeString(id);
transformState.writeTo(out);
transformStats.writeTo(out);
if (out.getVersion().before(Version.V_8_0_0)) { // TODO change to V_7_4_0 after backport
if (out.getVersion().before(Version.V_7_4_0)) {
DataFrameTransformCheckpointingInfo.EMPTY.writeTo(out);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---
"Test put batch data frame transforms on mixed cluster":
- skip:
version: "7.4.0 - "
reason: waiting backport of https://github.com/elastic/elasticsearch/pull/44350
- do:
cluster.health:
index: "dataframe-transform-airline-data"
Expand Down Expand Up @@ -32,10 +29,7 @@
transform_id: "mixed-simple-transform"
- match: { count: 1 }
- match: { transforms.0.id: "mixed-simple-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "/started|stopped/" }
- match: { transforms.0.task_state: "/started|stopped/" }

- do:
data_frame.stop_data_frame_transform:
Expand All @@ -48,10 +42,7 @@
transform_id: "mixed-simple-transform"
- match: { count: 1 }
- match: { transforms.0.id: "mixed-simple-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "stopped" }
- match: { transforms.0.task_state: "stopped" }

- do:
data_frame.put_data_frame_transform:
Expand Down Expand Up @@ -98,10 +89,7 @@
transform_id: "mixed-complex-transform"
- match: { count: 1 }
- match: { transforms.0.id: "mixed-complex-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "/started|stopped/" }
- match: { transforms.0.task_state: "/started|stopped/" }

- do:
data_frame.stop_data_frame_transform:
Expand All @@ -114,16 +102,10 @@
transform_id: "mixed-complex-transform"
- match: { count: 1 }
- match: { transforms.0.id: "mixed-complex-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "stopped" }
- match: { transforms.0.task_state: "stopped" }

---
"Test put continuous data frame transform on mixed cluster":
- skip:
version: "7.4.0 - "
reason: waiting backport of https://github.com/elastic/elasticsearch/pull/44350
- do:
cluster.health:
index: "dataframe-transform-airline-data-cont"
Expand Down Expand Up @@ -169,10 +151,7 @@
transform_id: "mixed-simple-continuous-transform"
- match: { count: 1 }
- match: { transforms.0.id: "mixed-simple-continuous-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "started" }
- match: { transforms.0.task_state: "started" }

- do:
data_frame.stop_data_frame_transform:
Expand All @@ -185,16 +164,10 @@
transform_id: "mixed-simple-continuous-transform"
- match: { count: 1 }
- match: { transforms.0.id: "mixed-simple-continuous-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "stopped" }
- match: { transforms.0.task_state: "stopped" }

---
"Test GET, start, and stop old cluster batch transforms":
- skip:
version: "7.4.0 - "
reason: waiting backport of https://github.com/elastic/elasticsearch/pull/44350
- do:
cluster.health:
index: "dataframe-transform-airline-data"
Expand All @@ -220,10 +193,7 @@
transform_id: "old-simple-transform"
- match: { count: 1 }
- match: { transforms.0.id: "old-simple-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "/started|stopped/" }
- match: { transforms.0.task_state: "/started|stopped/" }

- do:
data_frame.stop_data_frame_transform:
Expand All @@ -235,10 +205,7 @@
transform_id: "old-simple-transform"
- match: { count: 1 }
- match: { transforms.0.id: "old-simple-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "stopped" }
- match: { transforms.0.task_state: "stopped" }

- do:
data_frame.get_data_frame_transform:
Expand All @@ -262,10 +229,7 @@
transform_id: "old-complex-transform"
- match: { count: 1 }
- match: { transforms.0.id: "old-complex-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "/started|stopped/" }
- match: { transforms.0.task_state: "/started|stopped/" }

- do:
data_frame.stop_data_frame_transform:
Expand All @@ -277,16 +241,10 @@
transform_id: "old-complex-transform"
- match: { count: 1 }
- match: { transforms.0.id: "old-complex-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.state.task_state: "stopped" }
- match: { transforms.0.state.task_state: "stopped" }

---
"Test GET, stop, start, old continuous transforms":
- skip:
version: "7.4.0 - "
reason: waiting backport of https://github.com/elastic/elasticsearch/pull/44350
- do:
cluster.health:
index: "dataframe-transform-airline-data-cont"
Expand All @@ -312,10 +270,7 @@
transform_id: "old-simple-continuous-transform"
- match: { count: 1 }
- match: { transforms.0.id: "old-simple-continuous-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "started" }
- match: { transforms.0.task_state: "started" }

- do:
data_frame.stop_data_frame_transform:
Expand All @@ -328,7 +283,4 @@
transform_id: "old-simple-continuous-transform"
- match: { count: 1 }
- match: { transforms.0.id: "old-simple-continuous-transform" }
# Since we are breaking the stats format between 7.3 and 7.4 (allowed because we're beta) we
# cannot assert on task_state in the mixed cluster as it could be at the top level or under state
# TODO: uncomment this assertion in master
#- match: { transforms.0.task_state: "stopped" }
- match: { transforms.0.task_state: "stopped" }
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---
"Test put batch data frame transforms on old cluster":
- skip:
version: "7.4.0 - "
reason: waiting backport of https://github.com/elastic/elasticsearch/pull/44350
- do:
indices.create:
index: dataframe-transform-airline-data
Expand Down Expand Up @@ -139,9 +136,6 @@

---
"Test put continuous data frame transform on old cluster":
- skip:
version: "7.4.0 - "
reason: waiting backport of https://github.com/elastic/elasticsearch/pull/44350
- do:
indices.create:
index: dataframe-transform-airline-data-cont
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ setup:
timeout: 70s
---
"Get start, stop, and delete old and mixed cluster batch data frame transforms":
- skip:
version: "7.4.0 - "
reason: waiting backport of https://github.com/elastic/elasticsearch/pull/44350
# Simple and complex OLD transforms
- do:
data_frame.get_data_frame_transform:
Expand Down Expand Up @@ -165,9 +162,6 @@ setup:

---
"Test GET, stop, delete, old and mixed continuous transforms":
- skip:
version: "7.4.0 - "
reason: waiting backport of https://github.com/elastic/elasticsearch/pull/44350
- do:
data_frame.get_data_frame_transform:
transform_id: "old-simple-continuous-transform"
Expand Down