|
20 | 20 | package org.elasticsearch.action.admin.cluster.node.info; |
21 | 21 |
|
22 | 22 | import com.google.common.collect.ImmutableMap; |
| 23 | +import org.elasticsearch.Version; |
23 | 24 | import org.elasticsearch.action.support.nodes.NodeOperationResponse; |
24 | 25 | import org.elasticsearch.cluster.node.DiscoveryNode; |
25 | 26 | import org.elasticsearch.common.Nullable; |
@@ -49,7 +50,7 @@ public class NodeInfo extends NodeOperationResponse { |
49 | 50 | @Nullable |
50 | 51 | private String hostname; |
51 | 52 |
|
52 | | - private String version; |
| 53 | + private Version version; |
53 | 54 |
|
54 | 55 | @Nullable |
55 | 56 | private Settings settings; |
@@ -78,7 +79,7 @@ public class NodeInfo extends NodeOperationResponse { |
78 | 79 | NodeInfo() { |
79 | 80 | } |
80 | 81 |
|
81 | | - public NodeInfo(@Nullable String hostname, String version, DiscoveryNode node, @Nullable ImmutableMap<String, String> serviceAttributes, @Nullable Settings settings, |
| 82 | + public NodeInfo(@Nullable String hostname, Version version, DiscoveryNode node, @Nullable ImmutableMap<String, String> serviceAttributes, @Nullable Settings settings, |
82 | 83 | @Nullable OsInfo os, @Nullable ProcessInfo process, @Nullable JvmInfo jvm, @Nullable ThreadPoolInfo threadPool, @Nullable NetworkInfo network, |
83 | 84 | @Nullable TransportInfo transport, @Nullable HttpInfo http) { |
84 | 85 | super(node); |
@@ -114,14 +115,14 @@ public String getHostname() { |
114 | 115 | /** |
115 | 116 | * The current ES version |
116 | 117 | */ |
117 | | - public String version() { |
| 118 | + public Version version() { |
118 | 119 | return version; |
119 | 120 | } |
120 | 121 |
|
121 | 122 | /** |
122 | 123 | * The current ES version |
123 | 124 | */ |
124 | | - public String getVersion() { |
| 125 | + public Version getVersion() { |
125 | 126 | return version(); |
126 | 127 | } |
127 | 128 |
|
@@ -263,7 +264,7 @@ public void readFrom(StreamInput in) throws IOException { |
263 | 264 | if (in.readBoolean()) { |
264 | 265 | hostname = in.readUTF(); |
265 | 266 | } |
266 | | - version = in.readOptionalString(); |
| 267 | + version = Version.readVersion(in); |
267 | 268 | if (in.readBoolean()) { |
268 | 269 | ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); |
269 | 270 | int size = in.readVInt(); |
@@ -307,7 +308,7 @@ public void writeTo(StreamOutput out) throws IOException { |
307 | 308 | out.writeBoolean(true); |
308 | 309 | out.writeUTF(hostname); |
309 | 310 | } |
310 | | - out.writeOptionalString(version); |
| 311 | + out.writeVInt(version.id); |
311 | 312 | if (serviceAttributes() == null) { |
312 | 313 | out.writeBoolean(false); |
313 | 314 | } else { |
|
0 commit comments