From e5b26d318acbffe54de617100a35ab86cf60c14d Mon Sep 17 00:00:00 2001 From: Benjamin Trent <4357155+benwtrent@users.noreply.github.com> Date: Fri, 3 Sep 2021 09:35:14 -0400 Subject: [PATCH] [ML] adjusting bwc serialization for #77256 --- .../xpack/core/ml/action/PutTrainedModelAction.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java index cbf5814a99863..56ee1413b8a82 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java @@ -6,7 +6,6 @@ */ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -65,11 +64,7 @@ public Request(TrainedModelConfig config, boolean deferDefinitionDecompression) public Request(StreamInput in) throws IOException { super(in); this.config = new TrainedModelConfig(in); - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { - this.deferDefinitionDecompression = in.readBoolean(); - } else { - this.deferDefinitionDecompression = false; - } + this.deferDefinitionDecompression = in.readBoolean(); } public TrainedModelConfig getTrainedModelConfig() { @@ -100,9 +95,7 @@ public boolean isDeferDefinitionDecompression() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); config.writeTo(out); - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { - out.writeBoolean(deferDefinitionDecompression); - } + out.writeBoolean(deferDefinitionDecompression); } @Override