Browse Source

[ML] Fixing instance serialization version for bwc (#46403)

Benjamin Trent 6 years ago
parent
commit
ee5683feca

+ 2 - 2
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/calendars/ScheduledEvent.java

@@ -85,7 +85,7 @@ public class ScheduledEvent implements ToXContentObject, Writeable {
 
     public ScheduledEvent(StreamInput in) throws IOException {
         description = in.readString();
-        if (in.getVersion().onOrAfter(Version.CURRENT)) {
+        if (in.getVersion().onOrAfter(Version.V_7_4_0)) {
             startTime = in.readInstant();
             endTime = in.readInstant();
         } else {
@@ -146,7 +146,7 @@ public class ScheduledEvent implements ToXContentObject, Writeable {
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         out.writeString(description);
-        if (out.getVersion().onOrAfter(Version.CURRENT)) {
+        if (out.getVersion().onOrAfter(Version.V_7_4_0)) {
             out.writeInstant(startTime);
             out.writeInstant(endTime);
         } else {

+ 2 - 2
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ForecastRequestStats.java

@@ -130,7 +130,7 @@ public class ForecastRequestStats implements ToXContentObject, Writeable {
             messages = null;
         }
 
-        if (in.getVersion().onOrAfter(Version.CURRENT)) {
+        if (in.getVersion().onOrAfter(Version.V_7_4_0)) {
             timestamp = in.readInstant();
             startTime = in.readInstant();
             endTime = in.readInstant();
@@ -161,7 +161,7 @@ public class ForecastRequestStats implements ToXContentObject, Writeable {
         } else {
             out.writeBoolean(false);
         }
-        if (out.getVersion().onOrAfter(Version.CURRENT)) {
+        if (out.getVersion().onOrAfter(Version.V_7_4_0)) {
             out.writeInstant(timestamp);
             out.writeInstant(startTime);
             out.writeInstant(endTime);

+ 2 - 2
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessage.java

@@ -75,7 +75,7 @@ public class CppLogMessage implements ToXContentObject, Writeable {
 
     public CppLogMessage(StreamInput in) throws IOException {
         logger = in.readString();
-        if (in.getVersion().onOrAfter(Version.CURRENT)) {
+        if (in.getVersion().onOrAfter(Version.V_7_4_0)) {
             timestamp = in.readInstant();
         } else {
             timestamp = Instant.ofEpochMilli(in.readVLong());
@@ -93,7 +93,7 @@ public class CppLogMessage implements ToXContentObject, Writeable {
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         out.writeString(logger);
-        if (out.getVersion().onOrAfter(Version.CURRENT)) {
+        if (out.getVersion().onOrAfter(Version.V_7_4_0)) {
             out.writeInstant(timestamp);
         } else {
             out.writeVLong(timestamp.toEpochMilli());