Skip to content

Commit d117362

Browse files
authored
Remove transport versions V_8_2_0 through V_8_5_0 (#136240)
1 parent f4f2ddd commit d117362

File tree

125 files changed

+344
-1641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+344
-1641
lines changed

modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/histogram/InternalAutoDateHistogram.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,7 @@ public InternalAutoDateHistogram(StreamInput in) throws IOException {
206206
format = in.readNamedWriteable(DocValueFormat.class);
207207
buckets = in.readCollectionAsList(stream -> Bucket.readFrom(stream, format));
208208
this.targetBuckets = in.readVInt();
209-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) {
210-
bucketInnerInterval = in.readVLong();
211-
} else {
212-
bucketInnerInterval = 1; // Calculated on merge.
213-
}
209+
bucketInnerInterval = in.readVLong();
214210
// we changed the order format in 8.13 for partial reduce, therefore we need to order them to perform merge sort
215211
if (in.getTransportVersion().between(TransportVersions.V_8_13_0, TransportVersions.V_8_14_0)) {
216212
// list is mutable by #readCollectionAsList contract
@@ -224,9 +220,7 @@ protected void doWriteTo(StreamOutput out) throws IOException {
224220
out.writeNamedWriteable(format);
225221
out.writeCollection(buckets);
226222
out.writeVInt(targetBuckets);
227-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) {
228-
out.writeVLong(bucketInnerInterval);
229-
}
223+
out.writeVLong(bucketInnerInterval);
230224
}
231225

232226
long getBucketInnerInterval() {

modules/aggregations/src/test/java/org/elasticsearch/aggregations/bucket/histogram/InternalAutoDateHistogramTests.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@
99

1010
package org.elasticsearch.aggregations.bucket.histogram;
1111

12-
import org.elasticsearch.TransportVersions;
1312
import org.elasticsearch.aggregations.bucket.AggregationMultiBucketAggregationTestCase;
1413
import org.elasticsearch.aggregations.bucket.histogram.AutoDateHistogramAggregationBuilder.RoundingInfo;
1514
import org.elasticsearch.aggregations.bucket.histogram.InternalAutoDateHistogram.BucketInfo;
1615
import org.elasticsearch.common.Rounding;
17-
import org.elasticsearch.common.bytes.BytesArray;
18-
import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput;
19-
import org.elasticsearch.common.io.stream.StreamInput;
2016
import org.elasticsearch.common.time.DateFormatter;
2117
import org.elasticsearch.common.util.Maps;
2218
import org.elasticsearch.index.mapper.DateFieldMapper;
@@ -28,15 +24,13 @@
2824
import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
2925
import org.elasticsearch.test.InternalAggregationTestCase;
3026

31-
import java.io.IOException;
3227
import java.time.Instant;
3328
import java.time.OffsetDateTime;
3429
import java.time.ZoneId;
3530
import java.time.ZoneOffset;
3631
import java.time.ZonedDateTime;
3732
import java.util.ArrayList;
3833
import java.util.Arrays;
39-
import java.util.Base64;
4034
import java.util.HashMap;
4135
import java.util.List;
4236
import java.util.Map;
@@ -456,24 +450,4 @@ public void testCreateWithReplacementBuckets() {
456450
assertThat(copy.getFormatter(), equalTo(orig.getFormatter()));
457451
assertThat(copy.getInterval(), equalTo(orig.getInterval()));
458452
}
459-
460-
public void testReadFromPre830() throws IOException {
461-
byte[] bytes = Base64.getDecoder()
462-
.decode(
463-
"BG5hbWUKAAYBCAFa6AcEAAAAAQAAAAUAAAAKAAAAHgFzBnNlY29uZAEHAVrg1AMEAAAAAQAAAAUAAAAKAAA"
464-
+ "AHgFtBm1pbnV0ZQEGAVqA3dsBAwAAAAEAAAADAAAADAFoBGhvdXIBBQFagLiZKQIAAAABAAAABwFk"
465-
+ "A2RheQEEAVqAkPvTCQIAAAABAAAAAwFNBW1vbnRoAQIBWoDYxL11BgAAAAEAAAAFAAAACgAAABQAA"
466-
+ "AAyAAAAZAF5BHllYXIAAARib29sAQAAAAAAAAAKZAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
467-
);
468-
try (StreamInput in = new NamedWriteableAwareStreamInput(new BytesArray(bytes).streamInput(), getNamedWriteableRegistry())) {
469-
in.setTransportVersion(TransportVersions.V_8_2_0);
470-
InternalAutoDateHistogram deserialized = new InternalAutoDateHistogram(in);
471-
assertEquals("name", deserialized.getName());
472-
assertEquals(1, deserialized.getBucketInnerInterval());
473-
assertEquals(1, deserialized.getBuckets().size());
474-
InternalAutoDateHistogram.Bucket bucket = deserialized.getBuckets().iterator().next();
475-
assertEquals(10, bucket.key);
476-
assertEquals(100, bucket.getDocCount());
477-
}
478-
}
479453
}

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,7 @@ static URL getElasticsearchCodeSourceLocation() {
205205

206206
public static Build readBuild(StreamInput in) throws IOException {
207207
final String flavor;
208-
if (in.getTransportVersion().before(TransportVersions.V_8_3_0) || in.getTransportVersion().onOrAfter(TransportVersions.V_8_10_X)) {
209-
flavor = in.readString();
210-
} else {
211-
flavor = "default";
212-
}
208+
flavor = in.readString();
213209
// be lenient when reading on the wire, the enumeration values from other versions might be different than what we know
214210
final Type type = Type.fromDisplayName(in.readString(), false);
215211
String hash = in.readString();
@@ -251,10 +247,7 @@ public static Build readBuild(StreamInput in) throws IOException {
251247
}
252248

253249
public static void writeBuild(Build build, StreamOutput out) throws IOException {
254-
if (out.getTransportVersion().before(TransportVersions.V_8_3_0)
255-
|| out.getTransportVersion().onOrAfter(TransportVersions.V_8_10_X)) {
256-
out.writeString(build.flavor());
257-
}
250+
out.writeString(build.flavor());
258251
out.writeString(build.type().displayName());
259252
out.writeString(build.hash());
260253
out.writeString(build.date());

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ static TransportVersion def(int id) {
6161
public static final TransportVersion V_7_9_0 = def(7_09_00_99);
6262
public static final TransportVersion V_7_10_0 = def(7_10_00_99);
6363
public static final TransportVersion V_8_0_0 = def(8_00_00_99);
64-
public static final TransportVersion V_8_2_0 = def(8_02_00_99);
65-
public static final TransportVersion V_8_3_0 = def(8_03_00_99);
66-
public static final TransportVersion V_8_4_0 = def(8_04_00_99);
67-
public static final TransportVersion V_8_5_0 = def(8_05_00_99);
6864
public static final TransportVersion V_8_6_0 = def(8_06_00_99);
6965
public static final TransportVersion V_8_6_1 = def(8_06_01_99);
7066
public static final TransportVersion V_8_7_0 = def(8_07_00_99);

server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesRequest.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
package org.elasticsearch.action.admin.cluster.desirednodes;
1111

12-
import org.elasticsearch.TransportVersion;
13-
import org.elasticsearch.TransportVersions;
1412
import org.elasticsearch.action.ActionRequestValidationException;
1513
import org.elasticsearch.action.ValidateActions;
1614
import org.elasticsearch.action.support.master.AcknowledgedRequest;
@@ -27,8 +25,6 @@
2725
import java.util.Objects;
2826

2927
public class UpdateDesiredNodesRequest extends AcknowledgedRequest<UpdateDesiredNodesRequest> {
30-
private static final TransportVersion DRY_RUN_VERSION = TransportVersions.V_8_4_0;
31-
3228
private final String historyID;
3329
private final long version;
3430
private final List<DesiredNode> nodes;
@@ -69,11 +65,7 @@ public UpdateDesiredNodesRequest(StreamInput in) throws IOException {
6965
this.historyID = in.readString();
7066
this.version = in.readLong();
7167
this.nodes = in.readCollectionAsList(DesiredNode::readFrom);
72-
if (in.getTransportVersion().onOrAfter(DRY_RUN_VERSION)) {
73-
this.dryRun = in.readBoolean();
74-
} else {
75-
this.dryRun = false;
76-
}
68+
this.dryRun = in.readBoolean();
7769
}
7870

7971
@Override
@@ -82,9 +74,7 @@ public void writeTo(StreamOutput out) throws IOException {
8274
out.writeString(historyID);
8375
out.writeLong(version);
8476
out.writeCollection(nodes);
85-
if (out.getTransportVersion().onOrAfter(DRY_RUN_VERSION)) {
86-
out.writeBoolean(dryRun);
87-
}
77+
out.writeBoolean(dryRun);
8878
}
8979

9080
public static UpdateDesiredNodesRequest fromXContent(

server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesResponse.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
package org.elasticsearch.action.admin.cluster.desirednodes;
1111

12-
import org.elasticsearch.TransportVersion;
13-
import org.elasticsearch.TransportVersions;
1412
import org.elasticsearch.action.ActionResponse;
1513
import org.elasticsearch.common.io.stream.StreamInput;
1614
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -21,7 +19,6 @@
2119
import java.util.Objects;
2220

2321
public class UpdateDesiredNodesResponse extends ActionResponse implements ToXContentObject {
24-
private static final TransportVersion DRY_RUN_SUPPORTING_VERSION = TransportVersions.V_8_4_0;
2522

2623
private final boolean replacedExistingHistoryId;
2724
private final boolean dryRun;
@@ -37,15 +34,13 @@ public UpdateDesiredNodesResponse(boolean replacedExistingHistoryId, boolean dry
3734

3835
public UpdateDesiredNodesResponse(StreamInput in) throws IOException {
3936
this.replacedExistingHistoryId = in.readBoolean();
40-
dryRun = in.getTransportVersion().onOrAfter(DRY_RUN_SUPPORTING_VERSION) ? in.readBoolean() : false;
37+
dryRun = in.readBoolean();
4138
}
4239

4340
@Override
4441
public void writeTo(StreamOutput out) throws IOException {
4542
out.writeBoolean(replacedExistingHistoryId);
46-
if (out.getTransportVersion().onOrAfter(DRY_RUN_SUPPORTING_VERSION)) {
47-
out.writeBoolean(dryRun);
48-
}
43+
out.writeBoolean(dryRun);
4944
}
5045

5146
public boolean hasReplacedExistingHistoryId() {

server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/PluginsAndModules.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
package org.elasticsearch.action.admin.cluster.node.info;
1111

12-
import org.elasticsearch.TransportVersions;
1312
import org.elasticsearch.common.io.stream.StreamInput;
1413
import org.elasticsearch.common.io.stream.StreamOutput;
1514
import org.elasticsearch.node.ReportingService;
@@ -42,11 +41,7 @@ public PluginsAndModules(StreamInput in) throws IOException {
4241

4342
@Override
4443
public void writeTo(StreamOutput out) throws IOException {
45-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) {
46-
out.writeCollection(plugins);
47-
} else {
48-
out.writeCollection(plugins.stream().map(PluginRuntimeInfo::descriptor).toList());
49-
}
44+
out.writeCollection(plugins);
5045
out.writeCollection(modules);
5146
}
5247

server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsAction.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
package org.elasticsearch.action.admin.cluster.settings;
1111

12-
import org.elasticsearch.TransportVersions;
1312
import org.elasticsearch.action.ActionRequestValidationException;
1413
import org.elasticsearch.action.ActionResponse;
1514
import org.elasticsearch.action.ActionType;
@@ -51,7 +50,6 @@ public Request(TimeValue masterNodeTimeout) {
5150
@UpdateForV10(owner = UpdateForV10.Owner.CORE_INFRA)
5251
public Request(StreamInput in) throws IOException {
5352
super(in);
54-
assert in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0);
5553
}
5654

5755
@Override
@@ -101,7 +99,6 @@ public Response(Settings persistentSettings, Settings transientSettings, Setting
10199
@UpdateForV10(owner = UpdateForV10.Owner.CORE_INFRA)
102100
@Override
103101
public void writeTo(StreamOutput out) throws IOException {
104-
assert out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0);
105102
persistentSettings.writeTo(out);
106103
transientSettings.writeTo(out);
107104
settings.writeTo(out);

server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package org.elasticsearch.action.admin.cluster.snapshots.get;
1111

1212
import org.elasticsearch.TransportVersion;
13-
import org.elasticsearch.TransportVersions;
1413
import org.elasticsearch.action.ActionRequestValidationException;
1514
import org.elasticsearch.action.support.master.MasterNodeRequest;
1615
import org.elasticsearch.common.Strings;
@@ -41,7 +40,6 @@ public class GetSnapshotsRequest extends MasterNodeRequest<GetSnapshotsRequest>
4140
public static final String NO_POLICY_PATTERN = "_none";
4241
public static final boolean DEFAULT_VERBOSE_MODE = true;
4342

44-
private static final TransportVersion INDICES_FLAG_VERSION = TransportVersions.V_8_3_0;
4543
private static final TransportVersion STATE_FLAG_VERSION = TransportVersion.fromName("state_param_get_snapshot");
4644

4745
public static final int NO_LIMIT = -1;
@@ -121,9 +119,7 @@ public GetSnapshotsRequest(StreamInput in) throws IOException {
121119
offset = in.readVInt();
122120
policies = in.readStringArray();
123121
fromSortValue = in.readOptionalString();
124-
if (in.getTransportVersion().onOrAfter(INDICES_FLAG_VERSION)) {
125-
includeIndexNames = in.readBoolean();
126-
}
122+
includeIndexNames = in.readBoolean();
127123
if (in.getTransportVersion().supports(STATE_FLAG_VERSION)) {
128124
states = in.readEnumSet(SnapshotState.class);
129125
} else {
@@ -145,9 +141,7 @@ public void writeTo(StreamOutput out) throws IOException {
145141
out.writeVInt(offset);
146142
out.writeStringArray(policies);
147143
out.writeOptionalString(fromSortValue);
148-
if (out.getTransportVersion().onOrAfter(INDICES_FLAG_VERSION)) {
149-
out.writeBoolean(includeIndexNames);
150-
}
144+
out.writeBoolean(includeIndexNames);
151145
if (out.getTransportVersion().supports(STATE_FLAG_VERSION)) {
152146
out.writeEnumSet(states);
153147
} else if (states.equals(EnumSet.allOf(SnapshotState.class)) == false) {

server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
package org.elasticsearch.action.admin.cluster.snapshots.restore;
1111

12-
import org.elasticsearch.TransportVersion;
13-
import org.elasticsearch.TransportVersions;
1412
import org.elasticsearch.action.ActionRequestValidationException;
1513
import org.elasticsearch.action.support.IndicesOptions;
1614
import org.elasticsearch.action.support.master.MasterNodeRequest;
@@ -52,7 +50,6 @@ public class RestoreSnapshotRequest extends MasterNodeRequest<RestoreSnapshotReq
5250
private boolean includeGlobalState = false;
5351
private boolean partial = false;
5452
private boolean includeAliases = true;
55-
public static final TransportVersion VERSION_SUPPORTING_QUIET_PARAMETER = TransportVersions.V_8_4_0;
5653
private boolean quiet = false;
5754
private Settings indexSettings = Settings.EMPTY;
5855
private String[] ignoreIndexSettings = Strings.EMPTY_ARRAY;
@@ -92,11 +89,7 @@ public RestoreSnapshotRequest(StreamInput in) throws IOException {
9289
includeGlobalState = in.readBoolean();
9390
partial = in.readBoolean();
9491
includeAliases = in.readBoolean();
95-
if (in.getTransportVersion().onOrAfter(VERSION_SUPPORTING_QUIET_PARAMETER)) {
96-
quiet = in.readBoolean();
97-
} else {
98-
quiet = true;
99-
}
92+
quiet = in.readBoolean();
10093
indexSettings = readSettingsFromStream(in);
10194
ignoreIndexSettings = in.readStringArray();
10295
snapshotUuid = in.readOptionalString();
@@ -116,9 +109,7 @@ public void writeTo(StreamOutput out) throws IOException {
116109
out.writeBoolean(includeGlobalState);
117110
out.writeBoolean(partial);
118111
out.writeBoolean(includeAliases);
119-
if (out.getTransportVersion().onOrAfter(VERSION_SUPPORTING_QUIET_PARAMETER)) {
120-
out.writeBoolean(quiet);
121-
}
112+
out.writeBoolean(quiet);
122113
indexSettings.writeTo(out);
123114
out.writeStringArray(ignoreIndexSettings);
124115
out.writeOptionalString(snapshotUuid);

0 commit comments

Comments
 (0)