mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-29 11:28:30 +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
x-pack/plugin
core/src/main/java/org/elasticsearch/xpack/core/ml
ml/src/main/java/org/elasticsearch/xpack/ml/process/logging
@ -85,7 +85,7 @@ public class ScheduledEvent implements ToXContentObject, Writeable {
|
|||||||
|
|
||||||
public ScheduledEvent(StreamInput in) throws IOException {
|
public ScheduledEvent(StreamInput in) throws IOException {
|
||||||
description = in.readString();
|
description = in.readString();
|
||||||
if (in.getVersion().onOrAfter(Version.CURRENT)) {
|
if (in.getVersion().onOrAfter(Version.V_7_4_0)) {
|
||||||
startTime = in.readInstant();
|
startTime = in.readInstant();
|
||||||
endTime = in.readInstant();
|
endTime = in.readInstant();
|
||||||
} else {
|
} else {
|
||||||
@ -146,7 +146,7 @@ public class ScheduledEvent implements ToXContentObject, Writeable {
|
|||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeString(description);
|
out.writeString(description);
|
||||||
if (out.getVersion().onOrAfter(Version.CURRENT)) {
|
if (out.getVersion().onOrAfter(Version.V_7_4_0)) {
|
||||||
out.writeInstant(startTime);
|
out.writeInstant(startTime);
|
||||||
out.writeInstant(endTime);
|
out.writeInstant(endTime);
|
||||||
} else {
|
} else {
|
||||||
|
@ -130,7 +130,7 @@ public class ForecastRequestStats implements ToXContentObject, Writeable {
|
|||||||
messages = null;
|
messages = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in.getVersion().onOrAfter(Version.CURRENT)) {
|
if (in.getVersion().onOrAfter(Version.V_7_4_0)) {
|
||||||
timestamp = in.readInstant();
|
timestamp = in.readInstant();
|
||||||
startTime = in.readInstant();
|
startTime = in.readInstant();
|
||||||
endTime = in.readInstant();
|
endTime = in.readInstant();
|
||||||
@ -161,7 +161,7 @@ public class ForecastRequestStats implements ToXContentObject, Writeable {
|
|||||||
} else {
|
} else {
|
||||||
out.writeBoolean(false);
|
out.writeBoolean(false);
|
||||||
}
|
}
|
||||||
if (out.getVersion().onOrAfter(Version.CURRENT)) {
|
if (out.getVersion().onOrAfter(Version.V_7_4_0)) {
|
||||||
out.writeInstant(timestamp);
|
out.writeInstant(timestamp);
|
||||||
out.writeInstant(startTime);
|
out.writeInstant(startTime);
|
||||||
out.writeInstant(endTime);
|
out.writeInstant(endTime);
|
||||||
|
@ -75,7 +75,7 @@ public class CppLogMessage implements ToXContentObject, Writeable {
|
|||||||
|
|
||||||
public CppLogMessage(StreamInput in) throws IOException {
|
public CppLogMessage(StreamInput in) throws IOException {
|
||||||
logger = in.readString();
|
logger = in.readString();
|
||||||
if (in.getVersion().onOrAfter(Version.CURRENT)) {
|
if (in.getVersion().onOrAfter(Version.V_7_4_0)) {
|
||||||
timestamp = in.readInstant();
|
timestamp = in.readInstant();
|
||||||
} else {
|
} else {
|
||||||
timestamp = Instant.ofEpochMilli(in.readVLong());
|
timestamp = Instant.ofEpochMilli(in.readVLong());
|
||||||
@ -93,7 +93,7 @@ public class CppLogMessage implements ToXContentObject, Writeable {
|
|||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeString(logger);
|
out.writeString(logger);
|
||||||
if (out.getVersion().onOrAfter(Version.CURRENT)) {
|
if (out.getVersion().onOrAfter(Version.V_7_4_0)) {
|
||||||
out.writeInstant(timestamp);
|
out.writeInstant(timestamp);
|
||||||
} else {
|
} else {
|
||||||
out.writeVLong(timestamp.toEpochMilli());
|
out.writeVLong(timestamp.toEpochMilli());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user