Update the BWC versions (post 1.x backport) (#2390)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
This commit is contained in:
Andriy Redko 2022-03-08 11:30:48 -05:00 committed by GitHub
parent 919d18036e
commit 65debde436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ public abstract class ScoreFunctionBuilder<FB extends ScoreFunctionBuilder<FB>>
*/ */
public ScoreFunctionBuilder(StreamInput in) throws IOException { public ScoreFunctionBuilder(StreamInput in) throws IOException {
weight = checkWeight(in.readOptionalFloat()); weight = checkWeight(in.readOptionalFloat());
if (in.getVersion().onOrAfter(Version.V_2_0_0)) { if (in.getVersion().onOrAfter(Version.V_1_3_0)) {
functionName = in.readOptionalString(); functionName = in.readOptionalString();
} }
} }
@ -68,7 +68,7 @@ public abstract class ScoreFunctionBuilder<FB extends ScoreFunctionBuilder<FB>>
@Override @Override
public final void writeTo(StreamOutput out) throws IOException { public final void writeTo(StreamOutput out) throws IOException {
out.writeOptionalFloat(weight); out.writeOptionalFloat(weight);
if (out.getVersion().onOrAfter(Version.V_2_0_0)) { if (out.getVersion().onOrAfter(Version.V_1_3_0)) {
out.writeOptionalString(functionName); out.writeOptionalString(functionName);
} }
doWriteTo(out); doWriteTo(out);