Skip to content

Commit

Permalink
Use TransportVersion V9
Browse files Browse the repository at this point in the history
  • Loading branch information
arteam committed Feb 3, 2025
1 parent 4fba814 commit a1b5f5e
Showing 1 changed file with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.Version;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.common.io.stream.StreamInput;
Expand Down Expand Up @@ -162,14 +161,8 @@ public static DesiredNode readFrom(StreamInput in) throws IOException {
}
final var memory = ByteSizeValue.readFrom(in);
final var storage = ByteSizeValue.readFrom(in);
// if (in.getTransportVersion().before(TransportVersion.V_9_00_0)) {
if (true) {
final String version;
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_13_0)) {
version = in.readOptionalString();
} else {
version = Version.readVersion(in).toString();
}
if (in.getTransportVersion().before(TransportVersions.ELASTICSEARCH_9_0)) {
in.readOptionalString();
}
return new DesiredNode(settings, processors, processorsRange, memory, storage);
}
Expand All @@ -187,13 +180,8 @@ public void writeTo(StreamOutput out) throws IOException {
}
memory.writeTo(out);
storage.writeTo(out);
// if (out.getTransportVersion().before(TransportVersion.V_9_00_0)) {
if (true) {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_13_0)) {
out.writeOptionalString(null);
} else {
Version.writeVersion(Version.CURRENT, out);
}
if (out.getTransportVersion().before(TransportVersions.ELASTICSEARCH_9_0)) {
out.writeOptionalString(null);
}
}

Expand Down

0 comments on commit a1b5f5e

Please sign in to comment.