mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-24 17:09:48 +00:00
7.x/ml fix instance serialization bwc (#46404)
* [ML] Fixing instance serialization version for bwc * fixing CppLogMessage
This commit is contained in:
parent
d912a49c6f
commit
457ff3e2fb
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user