Skip to content

Commit 6453a66

Browse files
authored
Remove references to 7.6 and 7.7 transport versions from ML model code (#118446)
1 parent bb8503a commit 6453a66

File tree

7 files changed

+6
-25
lines changed

7 files changed

+6
-25
lines changed

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ static TransportVersion def(int id) {
5555
public static final TransportVersion V_7_3_0 = def(7_03_00_99);
5656
public static final TransportVersion V_7_4_0 = def(7_04_00_99);
5757
public static final TransportVersion V_7_6_0 = def(7_06_00_99);
58-
public static final TransportVersion V_7_7_0 = def(7_07_00_99);
5958
public static final TransportVersion V_7_8_0 = def(7_08_00_99);
6059
public static final TransportVersion V_7_8_1 = def(7_08_01_99);
6160
public static final TransportVersion V_7_9_0 = def(7_09_00_99);

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class ClassificationConfig implements LenientlyParsedInferenceConfig, Str
2828
public static final ParseField NUM_TOP_FEATURE_IMPORTANCE_VALUES = new ParseField("num_top_feature_importance_values");
2929
public static final ParseField PREDICTION_FIELD_TYPE = new ParseField("prediction_field_type");
3030
private static final MlConfigVersion MIN_SUPPORTED_VERSION = MlConfigVersion.V_7_6_0;
31-
private static final TransportVersion MIN_SUPPORTED_TRANSPORT_VERSION = TransportVersions.V_7_6_0;
3231

3332
public static ClassificationConfig EMPTY_PARAMS = new ClassificationConfig(
3433
0,
@@ -227,7 +226,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() {
227226

228227
@Override
229228
public TransportVersion getMinimalSupportedTransportVersion() {
230-
return requestingImportance() ? TransportVersions.V_7_7_0 : MIN_SUPPORTED_TRANSPORT_VERSION;
229+
return TransportVersions.ZERO;
231230
}
232231

233232
public static Builder builder() {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class RegressionConfig implements LenientlyParsedInferenceConfig, Strictl
2323

2424
public static final ParseField NAME = new ParseField("regression");
2525
private static final MlConfigVersion MIN_SUPPORTED_VERSION = MlConfigVersion.V_7_6_0;
26-
private static final TransportVersion MIN_SUPPORTED_TRANSPORT_VERSION = TransportVersions.V_7_6_0;
2726
public static final ParseField NUM_TOP_FEATURE_IMPORTANCE_VALUES = new ParseField("num_top_feature_importance_values");
2827

2928
public static RegressionConfig EMPTY_PARAMS = new RegressionConfig(DEFAULT_RESULTS_FIELD, null);
@@ -160,7 +159,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() {
160159

161160
@Override
162161
public TransportVersion getMinimalSupportedTransportVersion() {
163-
return requestingImportance() ? TransportVersions.V_7_7_0 : MIN_SUPPORTED_TRANSPORT_VERSION;
162+
return TransportVersions.ZERO;
164163
}
165164

166165
public static Builder builder() {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TrainedModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public interface TrainedModel extends NamedXContentObject, NamedWriteable, Accou
3434
long estimatedNumOperations();
3535

3636
default TransportVersion getMinimalCompatibilityVersion() {
37-
return TransportVersions.V_7_6_0;
37+
return TransportVersions.ZERO;
3838
}
3939
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Ensemble.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public TransportVersion getMinimalCompatibilityVersion() {
286286
return models.stream()
287287
.map(TrainedModel::getMinimalCompatibilityVersion)
288288
.max(TransportVersion::compareTo)
289-
.orElse(TransportVersions.V_7_6_0);
289+
.orElse(TransportVersions.ZERO);
290290
}
291291

292292
public static class Builder {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/Tree.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import org.apache.lucene.util.Accountable;
1010
import org.apache.lucene.util.Accountables;
1111
import org.apache.lucene.util.RamUsageEstimator;
12-
import org.elasticsearch.TransportVersion;
13-
import org.elasticsearch.TransportVersions;
1412
import org.elasticsearch.common.Strings;
1513
import org.elasticsearch.common.io.stream.StreamInput;
1614
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -287,14 +285,6 @@ public Collection<Accountable> getChildResources() {
287285
return Collections.unmodifiableCollection(accountables);
288286
}
289287

290-
@Override
291-
public TransportVersion getMinimalCompatibilityVersion() {
292-
if (nodes.stream().filter(TreeNode::isLeaf).anyMatch(t -> t.getLeafValue().length > 1)) {
293-
return TransportVersions.V_7_7_0;
294-
}
295-
return TransportVersions.V_7_6_0;
296-
}
297-
298288
public static final class Builder {
299289
private List<String> featureNames;
300290
private ArrayList<TreeNode.Builder> nodes;

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformState.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ public TransformState(StreamInput in) throws IOException {
136136
reason = in.readOptionalString();
137137
progress = in.readOptionalWriteable(TransformProgress::new);
138138
node = in.readOptionalWriteable(NodeAttributes::new);
139-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) {
140-
shouldStopAtNextCheckpoint = in.readBoolean();
141-
} else {
142-
shouldStopAtNextCheckpoint = false;
143-
}
139+
shouldStopAtNextCheckpoint = in.readBoolean();
144140
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) {
145141
authState = in.readOptionalWriteable(AuthorizationState::new);
146142
} else {
@@ -237,9 +233,7 @@ public void writeTo(StreamOutput out) throws IOException {
237233
out.writeOptionalString(reason);
238234
out.writeOptionalWriteable(progress);
239235
out.writeOptionalWriteable(node);
240-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) {
241-
out.writeBoolean(shouldStopAtNextCheckpoint);
242-
}
236+
out.writeBoolean(shouldStopAtNextCheckpoint);
243237
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) {
244238
out.writeOptionalWriteable(authState);
245239
}

0 commit comments

Comments
 (0)