Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore executionHint serialization from version V_8_500_014 #96965

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public MedianAbsoluteDeviationAggregationBuilder(StreamInput in) throws IOExcept
compression = in.readDouble();
if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) {
executionHint = in.readOptionalWriteable(TDigestExecutionHint::readFrom);
} else if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) {
executionHint = TDigestExecutionHint.readFrom(in);
} else {
executionHint = TDigestExecutionHint.HIGH_ACCURACY;
}
Expand Down Expand Up @@ -128,6 +130,8 @@ protected void innerWriteTo(StreamOutput out) throws IOException {
out.writeDouble(compression);
if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) {
out.writeOptionalWriteable(executionHint);
} else if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) {
(executionHint == null ? TDigestExecutionHint.DEFAULT : executionHint).writeTo(out);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public TDigest(double compression, TDigestExecutionHint executionHint) {
TDigest(StreamInput in) throws IOException {
this(
in.readDouble(),
in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)
? in.readOptionalWriteable(TDigestExecutionHint::readFrom)
in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018) ? in.readOptionalWriteable(TDigestExecutionHint::readFrom)
: in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014) ? TDigestExecutionHint.readFrom(in)
: TDigestExecutionHint.HIGH_ACCURACY
);
}
Expand Down Expand Up @@ -250,6 +250,8 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeDouble(compression);
if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) {
out.writeOptionalWriteable(executionHint);
} else if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) {
(executionHint == null ? TDigestExecutionHint.DEFAULT : executionHint).writeTo(out);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public BoxplotAggregationBuilder(StreamInput in) throws IOException {
compression = in.readDouble();
if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) {
executionHint = in.readOptionalWriteable(TDigestExecutionHint::readFrom);
} else if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) {
executionHint = TDigestExecutionHint.readFrom(in);
} else {
executionHint = TDigestExecutionHint.HIGH_ACCURACY;
}
Expand All @@ -99,6 +101,8 @@ protected void innerWriteTo(StreamOutput out) throws IOException {
out.writeDouble(compression);
if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) {
out.writeOptionalWriteable(executionHint);
} else if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) {
(executionHint == null ? TDigestExecutionHint.DEFAULT : executionHint).writeTo(out);
}
}

Expand Down