Skip to content

Commit be049bb

Browse files
authored
Remove most references to 7.9 and 7.10 transport versions (#118784)
1 parent 46a8e69 commit be049bb

File tree

30 files changed

+55
-147
lines changed

30 files changed

+55
-147
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,7 +1824,7 @@ private enum ElasticsearchExceptionHandle {
18241824
org.elasticsearch.indices.recovery.PeerRecoveryNotFound.class,
18251825
org.elasticsearch.indices.recovery.PeerRecoveryNotFound::new,
18261826
158,
1827-
TransportVersions.V_7_9_0
1827+
UNKNOWN_VERSION_ADDED
18281828
),
18291829
NODE_HEALTH_CHECK_FAILURE_EXCEPTION(
18301830
org.elasticsearch.cluster.coordination.NodeHealthCheckFailureException.class,
@@ -1836,7 +1836,7 @@ private enum ElasticsearchExceptionHandle {
18361836
org.elasticsearch.transport.NoSeedNodeLeftException.class,
18371837
org.elasticsearch.transport.NoSeedNodeLeftException::new,
18381838
160,
1839-
TransportVersions.V_7_10_0
1839+
UNKNOWN_VERSION_ADDED
18401840
),
18411841
AUTHENTICATION_PROCESSING_ERROR(
18421842
org.elasticsearch.ElasticsearchAuthenticationProcessingError.class,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ static TransportVersion def(int id) {
6262
public static final TransportVersion V_7_8_1 = def(7_08_01_99);
6363
public static final TransportVersion V_7_9_0 = def(7_09_00_99);
6464
public static final TransportVersion V_7_10_0 = def(7_10_00_99);
65-
public static final TransportVersion V_7_10_1 = def(7_10_01_99);
6665
public static final TransportVersion V_7_11_0 = def(7_11_00_99);
6766
public static final TransportVersion V_7_12_0 = def(7_12_00_99);
6867
public static final TransportVersion V_7_13_0 = def(7_13_00_99);

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ public NodeInfo(StreamInput in) throws IOException {
111111
addInfoIfNonNull(HttpInfo.class, in.readOptionalWriteable(HttpInfo::new));
112112
addInfoIfNonNull(PluginsAndModules.class, in.readOptionalWriteable(PluginsAndModules::new));
113113
addInfoIfNonNull(IngestInfo.class, in.readOptionalWriteable(IngestInfo::new));
114-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
115-
addInfoIfNonNull(AggregationInfo.class, in.readOptionalWriteable(AggregationInfo::new));
116-
}
114+
addInfoIfNonNull(AggregationInfo.class, in.readOptionalWriteable(AggregationInfo::new));
117115
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) {
118116
addInfoIfNonNull(RemoteClusterServerInfo.class, in.readOptionalWriteable(RemoteClusterServerInfo::new));
119117
}
@@ -285,9 +283,7 @@ public void writeTo(StreamOutput out) throws IOException {
285283
out.writeOptionalWriteable(getInfo(HttpInfo.class));
286284
out.writeOptionalWriteable(getInfo(PluginsAndModules.class));
287285
out.writeOptionalWriteable(getInfo(IngestInfo.class));
288-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
289-
out.writeOptionalWriteable(getInfo(AggregationInfo.class));
290-
}
286+
out.writeOptionalWriteable(getInfo(AggregationInfo.class));
291287
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) {
292288
out.writeOptionalWriteable(getInfo(RemoteClusterServerInfo.class));
293289
}

server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.elasticsearch.common.unit.ByteSizeValue;
2323
import org.elasticsearch.common.xcontent.ChunkedToXContent;
2424
import org.elasticsearch.index.shard.ShardId;
25-
import org.elasticsearch.index.store.StoreStats;
2625
import org.elasticsearch.xcontent.ToXContent;
2726
import org.elasticsearch.xcontent.XContentBuilder;
2827

@@ -101,9 +100,7 @@ public ClusterInfo(StreamInput in) throws IOException {
101100
this.dataPath = in.getTransportVersion().onOrAfter(DATA_PATH_NEW_KEY_VERSION)
102101
? in.readImmutableMap(NodeAndShard::new, StreamInput::readString)
103102
: in.readImmutableMap(nested -> NodeAndShard.from(new ShardRouting(nested)), StreamInput::readString);
104-
this.reservedSpace = in.getTransportVersion().onOrAfter(StoreStats.RESERVED_BYTES_VERSION)
105-
? in.readImmutableMap(NodeAndPath::new, ReservedSpace::new)
106-
: Map.of();
103+
this.reservedSpace = in.readImmutableMap(NodeAndPath::new, ReservedSpace::new);
107104
}
108105

109106
@Override
@@ -119,9 +116,7 @@ public void writeTo(StreamOutput out) throws IOException {
119116
} else {
120117
out.writeMap(this.dataPath, (o, k) -> createFakeShardRoutingFromNodeAndShard(k).writeTo(o), StreamOutput::writeString);
121118
}
122-
if (out.getTransportVersion().onOrAfter(StoreStats.RESERVED_BYTES_VERSION)) {
123-
out.writeMap(this.reservedSpace);
124-
}
119+
out.writeMap(this.reservedSpace);
125120
}
126121

127122
/**

server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,6 @@ public Iterator<Setting<?>> settings() {
563563

564564
public static final String INDEX_STATE_FILE_PREFIX = "state-";
565565

566-
static final TransportVersion SYSTEM_INDEX_FLAG_ADDED = TransportVersions.V_7_10_0;
567-
568566
static final TransportVersion STATS_AND_FORECAST_ADDED = TransportVersions.V_8_6_0;
569567

570568
private final int routingNumShards;
@@ -1644,11 +1642,7 @@ private static class IndexMetadataDiff implements Diff<IndexMetadata> {
16441642
} else {
16451643
mappingsUpdatedVersion = IndexVersions.ZERO;
16461644
}
1647-
if (in.getTransportVersion().onOrAfter(SYSTEM_INDEX_FLAG_ADDED)) {
1648-
isSystem = in.readBoolean();
1649-
} else {
1650-
isSystem = false;
1651-
}
1645+
isSystem = in.readBoolean();
16521646
timestampRange = IndexLongFieldRange.readFrom(in);
16531647
if (in.getTransportVersion().onOrAfter(STATS_AND_FORECAST_ADDED)) {
16541648
stats = in.readOptionalWriteable(IndexMetadataStats::new);
@@ -1694,9 +1688,7 @@ public void writeTo(StreamOutput out) throws IOException {
16941688
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
16951689
IndexVersion.writeVersion(mappingsUpdatedVersion, out);
16961690
}
1697-
if (out.getTransportVersion().onOrAfter(SYSTEM_INDEX_FLAG_ADDED)) {
1698-
out.writeBoolean(isSystem);
1699-
}
1691+
out.writeBoolean(isSystem);
17001692
timestampRange.writeTo(out);
17011693
if (out.getTransportVersion().onOrAfter(STATS_AND_FORECAST_ADDED)) {
17021694
out.writeOptionalWriteable(stats);
@@ -1798,9 +1790,7 @@ public static IndexMetadata readFrom(StreamInput in, @Nullable Function<String,
17981790
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
17991791
builder.mappingsUpdatedVersion(IndexVersion.readVersion(in));
18001792
}
1801-
if (in.getTransportVersion().onOrAfter(SYSTEM_INDEX_FLAG_ADDED)) {
1802-
builder.system(in.readBoolean());
1803-
}
1793+
builder.system(in.readBoolean());
18041794
builder.timestampRange(IndexLongFieldRange.readFrom(in));
18051795

18061796
if (in.getTransportVersion().onOrAfter(STATS_AND_FORECAST_ADDED)) {
@@ -1850,9 +1840,7 @@ public void writeTo(StreamOutput out, boolean mappingsAsHash) throws IOException
18501840
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
18511841
IndexVersion.writeVersion(mappingsUpdatedVersion, out);
18521842
}
1853-
if (out.getTransportVersion().onOrAfter(SYSTEM_INDEX_FLAG_ADDED)) {
1854-
out.writeBoolean(isSystem);
1855-
}
1843+
out.writeBoolean(isSystem);
18561844
timestampRange.writeTo(out);
18571845
if (out.getTransportVersion().onOrAfter(STATS_AND_FORECAST_ADDED)) {
18581846
out.writeOptionalWriteable(stats);

server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99
package org.elasticsearch.index.query;
1010

11-
import org.elasticsearch.TransportVersions;
1211
import org.elasticsearch.common.ParsingException;
1312
import org.elasticsearch.common.Strings;
1413
import org.elasticsearch.common.io.stream.StreamInput;
@@ -189,11 +188,7 @@ public InnerHitBuilder(StreamInput in) throws IOException {
189188
highlightBuilder = in.readOptionalWriteable(HighlightBuilder::new);
190189
this.innerCollapseBuilder = in.readOptionalWriteable(CollapseBuilder::new);
191190

192-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
193-
if (in.readBoolean()) {
194-
fetchFields = in.readCollectionAsList(FieldAndFormat::new);
195-
}
196-
}
191+
fetchFields = in.readOptionalCollectionAsList(FieldAndFormat::new);
197192
}
198193

199194
@Override
@@ -228,13 +223,7 @@ public void writeTo(StreamOutput out) throws IOException {
228223
}
229224
out.writeOptionalWriteable(highlightBuilder);
230225
out.writeOptionalWriteable(innerCollapseBuilder);
231-
232-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
233-
out.writeBoolean(fetchFields != null);
234-
if (fetchFields != null) {
235-
out.writeCollection(fetchFields);
236-
}
237-
}
226+
out.writeOptionalCollection(fetchFields);
238227
}
239228

240229
public String getName() {

server/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ public MatchPhrasePrefixQueryBuilder(StreamInput in) throws IOException {
6666
slop = in.readVInt();
6767
maxExpansions = in.readVInt();
6868
analyzer = in.readOptionalString();
69-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
70-
this.zeroTermsQuery = ZeroTermsQueryOption.readFromStream(in);
71-
}
69+
zeroTermsQuery = ZeroTermsQueryOption.readFromStream(in);
7270
}
7371

7472
@Override
@@ -78,9 +76,7 @@ protected void doWriteTo(StreamOutput out) throws IOException {
7876
out.writeVInt(slop);
7977
out.writeVInt(maxExpansions);
8078
out.writeOptionalString(analyzer);
81-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
82-
zeroTermsQuery.writeTo(out);
83-
}
79+
zeroTermsQuery.writeTo(out);
8480
}
8581

8682
/** Returns the field name used in this query. */

server/src/main/java/org/elasticsearch/index/query/PrefixQueryBuilder.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,15 @@ public PrefixQueryBuilder(StreamInput in) throws IOException {
7676
fieldName = in.readString();
7777
value = in.readString();
7878
rewrite = in.readOptionalString();
79-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
80-
caseInsensitive = in.readBoolean();
81-
}
79+
caseInsensitive = in.readBoolean();
8280
}
8381

8482
@Override
8583
protected void doWriteTo(StreamOutput out) throws IOException {
8684
out.writeString(fieldName);
8785
out.writeString(value);
8886
out.writeOptionalString(rewrite);
89-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
90-
out.writeBoolean(caseInsensitive);
91-
}
87+
out.writeBoolean(caseInsensitive);
9288
}
9389

9490
@Override

server/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ public RegexpQueryBuilder(StreamInput in) throws IOException {
8888
syntaxFlagsValue = in.readVInt();
8989
maxDeterminizedStates = in.readVInt();
9090
rewrite = in.readOptionalString();
91-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
92-
caseInsensitive = in.readBoolean();
93-
}
91+
caseInsensitive = in.readBoolean();
9492
}
9593

9694
@Override
@@ -100,9 +98,7 @@ protected void doWriteTo(StreamOutput out) throws IOException {
10098
out.writeVInt(syntaxFlagsValue);
10199
out.writeVInt(maxDeterminizedStates);
102100
out.writeOptionalString(rewrite);
103-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
104-
out.writeBoolean(caseInsensitive);
105-
}
101+
out.writeBoolean(caseInsensitive);
106102
}
107103

108104
/** Returns the field name used in this query. */

server/src/main/java/org/elasticsearch/index/query/TermQueryBuilder.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,13 @@ public boolean caseInsensitive() {
8989
*/
9090
public TermQueryBuilder(StreamInput in) throws IOException {
9191
super(in);
92-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
93-
caseInsensitive = in.readBoolean();
94-
}
92+
caseInsensitive = in.readBoolean();
9593
}
9694

9795
@Override
9896
protected void doWriteTo(StreamOutput out) throws IOException {
9997
super.doWriteTo(out);
100-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) {
101-
out.writeBoolean(caseInsensitive);
102-
}
98+
out.writeBoolean(caseInsensitive);
10399
}
104100

105101
public static TermQueryBuilder fromXContent(XContentParser parser) throws IOException {

0 commit comments

Comments
 (0)