File tree 1 file changed +4
-12
lines changed
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 6
6
*/
7
7
package org .elasticsearch .xpack .core .ml .action ;
8
8
9
- import org .elasticsearch .Version ;
10
9
import org .elasticsearch .action .ActionRequest ;
11
10
import org .elasticsearch .action .ActionRequestValidationException ;
12
11
import org .elasticsearch .action .ActionResponse ;
@@ -65,13 +64,8 @@ public static Request fromXContent(XContentParser parser) {
65
64
public Request (StreamInput in ) throws IOException {
66
65
super (in );
67
66
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 );
75
69
}
76
70
77
71
public Request (String datafeedId ) {
@@ -107,10 +101,8 @@ public ActionRequestValidationException validate() {
107
101
public void writeTo (StreamOutput out ) throws IOException {
108
102
super .writeTo (out );
109
103
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 );
114
106
}
115
107
116
108
@ Override
You can’t perform that action at this time.
0 commit comments