Skip to content

Commit

Permalink
Collapse transport versions 8,500,021-8,500,039 to 8,500,040 (elastic…
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoop authored Oct 5, 2023
1 parent dc312ed commit 24ed4ca
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 42 deletions.
4 changes: 2 additions & 2 deletions server/src/main/java/org/elasticsearch/Build.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static URL getElasticsearchCodeSourceLocation() {
public static Build readBuild(StreamInput in) throws IOException {
final String flavor;
if (in.getTransportVersion().before(TransportVersions.V_8_3_0)
|| in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_039)) {
|| in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
flavor = in.readString();
} else {
flavor = "default";
Expand Down Expand Up @@ -221,7 +221,7 @@ public static Build readBuild(StreamInput in) throws IOException {

public static void writeBuild(Build build, StreamOutput out) throws IOException {
if (out.getTransportVersion().before(TransportVersions.V_8_3_0)
|| out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_039)) {
|| out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
out.writeString(build.flavor());
}
out.writeString(build.type().displayName());
Expand Down
19 changes: 0 additions & 19 deletions server/src/main/java/org/elasticsearch/TransportVersions.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,6 @@ static TransportVersion def(int id) {
* Detached transport versions added below here.
*/
public static final TransportVersion V_8_500_020 = def(8_500_020);
public static final TransportVersion V_8_500_021 = def(8_500_021);
public static final TransportVersion V_8_500_022 = def(8_500_022);
public static final TransportVersion V_8_500_023 = def(8_500_023);
public static final TransportVersion V_8_500_024 = def(8_500_024);
public static final TransportVersion V_8_500_025 = def(8_500_025);
public static final TransportVersion V_8_500_026 = def(8_500_026);
public static final TransportVersion V_8_500_027 = def(8_500_027);
public static final TransportVersion V_8_500_028 = def(8_500_028);
public static final TransportVersion V_8_500_029 = def(8_500_029);
public static final TransportVersion V_8_500_030 = def(8_500_030);
public static final TransportVersion V_8_500_031 = def(8_500_031);
public static final TransportVersion V_8_500_032 = def(8_500_032);
public static final TransportVersion V_8_500_033 = def(8_500_033);
public static final TransportVersion V_8_500_034 = def(8_500_034);
public static final TransportVersion V_8_500_035 = def(8_500_035);
public static final TransportVersion V_8_500_036 = def(8_500_036);
public static final TransportVersion V_8_500_037 = def(8_500_037);
public static final TransportVersion V_8_500_038 = def(8_500_038);
public static final TransportVersion V_8_500_039 = def(8_500_039);
public static final TransportVersion V_8_500_040 = def(8_500_040);
public static final TransportVersion V_8_500_041 = def(8_500_041);
public static final TransportVersion V_8_500_042 = def(8_500_042);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.elasticsearch.action.admin.indices.analyze;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.support.broadcast.BroadcastRequest;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand All @@ -17,16 +18,14 @@
import java.util.Arrays;
import java.util.Objects;

import static org.elasticsearch.TransportVersions.V_8_500_034;

/**
* Request for reloading index search analyzers
*/
public class ReloadAnalyzersRequest extends BroadcastRequest<ReloadAnalyzersRequest> {
private final String resource;
private final boolean preview;

private static final TransportVersion PREVIEW_OPTION_TRANSPORT_VERSION = V_8_500_034;
private static final TransportVersion PREVIEW_OPTION_TRANSPORT_VERSION = TransportVersions.V_8_500_040;

/**
* Constructs a request for reloading index search analyzers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_020)) {
out.writeOptionalWriteable(dataRetention);
}
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_026)) {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
out.writeOptionalWriteable(downsampling);
}
if (out.getTransportVersion().onOrAfter(ADDED_ENABLED_FLAG_VERSION)) {
Expand All @@ -188,7 +188,7 @@ public DataStreamLifecycle(StreamInput in) throws IOException {
} else {
dataRetention = null;
}
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_026)) {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
downsampling = in.readOptionalWriteable(Downsampling::read);
} else {
downsampling = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public DiscoveryNode(StreamInput in) throws IOException {
}
}
this.roles = Collections.unmodifiableSortedSet(roles);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_024)) {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
versionInfo = new VersionInformation(Version.readVersion(in), IndexVersion.readVersion(in), IndexVersion.readVersion(in));
} else {
versionInfo = inferVersionInformation(Version.readVersion(in));
Expand Down Expand Up @@ -372,7 +372,7 @@ public void writeTo(StreamOutput out) throws IOException {
o.writeString(role.roleNameAbbreviation());
o.writeBoolean(role.canContainData());
});
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_024)) {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
Version.writeVersion(versionInfo.nodeVersion(), out);
IndexVersion.writeVersion(versionInfo.minIndexVersion(), out);
IndexVersion.writeVersion(versionInfo.maxIndexVersion(), out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public MatchNoneQueryBuilder(String rewriteReason) {
*/
public MatchNoneQueryBuilder(StreamInput in) throws IOException {
super(in);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_029)) {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
rewriteReason = in.readOptionalString();
}
}

@Override
protected void doWriteTo(StreamOutput out) throws IOException {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_029)) {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
out.writeOptionalString(rewriteReason);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class SimpleQueryStringBuilder extends AbstractQueryBuilder<SimpleQuerySt
/** Name for (de-)serialization. */
public static final String NAME = "simple_query_string";

public static final TransportVersion TYPE_FIELD_ADDED_VERSION = TransportVersions.V_8_500_023;
public static final TransportVersion TYPE_FIELD_ADDED_VERSION = TransportVersions.V_8_500_040;

private static final ParseField MINIMUM_SHOULD_MATCH_FIELD = new ParseField("minimum_should_match");
private static final ParseField ANALYZE_WILDCARD_FIELD = new ParseField("analyze_wildcard");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Request() {}

public Request(StreamInput in) throws IOException {
super(in);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_030) && in.readBoolean()) {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040) && in.readBoolean()) {
this.indexStartTimeMillis = in.readVLong();
this.indexEndTimeMillis = in.readVLong();
} else {
Expand Down Expand Up @@ -132,7 +132,7 @@ public Task createTask(long id, String type, String action, TaskId parentTaskId,
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_030)) {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
out.writeBoolean(true);
out.writeVLong(indexStartTimeMillis);
out.writeVLong(indexEndTimeMillis);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public DownsampleShardStatus(StreamInput in) throws IOException {
numSent = in.readLong();
numIndexed = in.readLong();
numFailed = in.readLong();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_030) && in.readBoolean()) {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040) && in.readBoolean()) {
totalShardDocCount = in.readVLong();
lastSourceTimestamp = in.readVLong();
lastTargetTimestamp = in.readVLong();
Expand Down Expand Up @@ -254,7 +254,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeLong(numSent);
out.writeLong(numIndexed);
out.writeLong(numFailed);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_030)) {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
out.writeBoolean(true);
out.writeVLong(totalShardDocCount);
out.writeVLong(lastSourceTimestamp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public AsyncStatusResponse(StreamInput in) throws IOException {
} else {
this.clusters = null;
}
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_035)) {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
this.completionTimeMillis = in.readOptionalVLong();
} else {
this.completionTimeMillis = null;
Expand All @@ -164,7 +164,7 @@ public void writeTo(StreamOutput out) throws IOException {
// optional since only CCS uses is; it is null for local-only searches
out.writeOptionalWriteable(clusters);
}
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_035)) {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
out.writeOptionalVLong(completionTimeMillis);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public class AuthenticateResponse extends ActionResponse implements ToXContent {

public static final TransportVersion VERSION_OPERATOR_FIELD = TransportVersions.V_8_500_028;
public static final TransportVersion VERSION_OPERATOR_FIELD = TransportVersions.V_8_500_040;

private final Authentication authentication;
private final boolean operator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class RuleQueryBuilder extends AbstractQueryBuilder<RuleQueryBuilder> {

@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersions.V_8_500_033;
return TransportVersions.V_8_500_040;
}

public RuleQueryBuilder(QueryBuilder organicQuery, Map<String, Object> matchCriteria, String rulesetId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private Event(StreamInput in) throws IOException {
} else {
fetchFields = null;
}
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_038)) {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
missing = in.readBoolean();
} else {
missing = index.isEmpty();
Expand All @@ -304,7 +304,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeMap(fetchFields, StreamOutput::writeWriteable);
}
}
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_038)) {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) {
// for BWC, 8.9.1+ does not have "missing" attribute, but it considers events with an empty index "" as missing events
// see https://github.com/elastic/elasticsearch/pull/98130
out.writeBoolean(missing);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private List<Event> mutateEvents(List<Event> original, TransportVersion version)
e.id(),
e.source(),
version.onOrAfter(TransportVersions.V_7_13_0) ? e.fetchFields() : null,
version.onOrAfter(TransportVersions.V_8_500_038) ? e.missing() : e.index().isEmpty()
version.onOrAfter(TransportVersions.V_8_500_040) ? e.missing() : e.index().isEmpty()
)
);
}
Expand Down

0 comments on commit 24ed4ca

Please sign in to comment.