Skip to content

Commit 76448ec

Browse files
authored
[ML] adjusting bwc for datafeed _preview (#70928)
1 parent 5c579ed commit 76448ec

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
package org.elasticsearch.xpack.core.ml.action;
88

9-
import org.elasticsearch.Version;
109
import org.elasticsearch.action.ActionRequest;
1110
import org.elasticsearch.action.ActionRequestValidationException;
1211
import org.elasticsearch.action.ActionResponse;
@@ -65,13 +64,8 @@ public static Request fromXContent(XContentParser parser) {
6564
public Request(StreamInput in) throws IOException {
6665
super(in);
6766
datafeedId = in.readString();
68-
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
69-
datafeedConfig = in.readOptionalWriteable(DatafeedConfig::new);
70-
jobConfig = in.readOptionalWriteable(Job.Builder::new);
71-
} else {
72-
datafeedConfig = null;
73-
jobConfig = null;
74-
}
67+
datafeedConfig = in.readOptionalWriteable(DatafeedConfig::new);
68+
jobConfig = in.readOptionalWriteable(Job.Builder::new);
7569
}
7670

7771
public Request(String datafeedId) {
@@ -107,10 +101,8 @@ public ActionRequestValidationException validate() {
107101
public void writeTo(StreamOutput out) throws IOException {
108102
super.writeTo(out);
109103
out.writeString(datafeedId);
110-
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
111-
out.writeOptionalWriteable(datafeedConfig);
112-
out.writeOptionalWriteable(jobConfig);
113-
}
104+
out.writeOptionalWriteable(datafeedConfig);
105+
out.writeOptionalWriteable(jobConfig);
114106
}
115107

116108
@Override

0 commit comments

Comments
 (0)