|
7 | 7 |
|
8 | 8 | package org.elasticsearch.xpack.esql.session; |
9 | 9 |
|
10 | | -import org.elasticsearch.TransportVersion; |
11 | 10 | import org.elasticsearch.TransportVersions; |
12 | 11 | import org.elasticsearch.common.bytes.BytesArray; |
13 | 12 | import org.elasticsearch.common.compress.CompressorFactory; |
@@ -111,7 +110,7 @@ public Configuration(BlockStreamInput in) throws IOException { |
111 | 110 | } else { |
112 | 111 | this.queryStartTimeNanos = -1; |
113 | 112 | } |
114 | | - if (supportPartialResults(in.getTransportVersion())) { |
| 113 | + if (in.getTransportVersion().onOrAfter(TransportVersions.ESQL_SUPPORT_PARTIAL_RESULTS)) { |
115 | 114 | this.allowPartialResults = in.readBoolean(); |
116 | 115 | } else { |
117 | 116 | this.allowPartialResults = false; |
@@ -140,7 +139,7 @@ public void writeTo(StreamOutput out) throws IOException { |
140 | 139 | if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_16_0)) { |
141 | 140 | out.writeLong(queryStartTimeNanos); |
142 | 141 | } |
143 | | - if (supportPartialResults(out.getTransportVersion())) { |
| 142 | + if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_SUPPORT_PARTIAL_RESULTS)) { |
144 | 143 | out.writeBoolean(allowPartialResults); |
145 | 144 | } else if (allowPartialResults) { |
146 | 145 | throw new IllegalArgumentException("allow_partial_result is not supported in this version"); |
@@ -310,7 +309,4 @@ public String toString() { |
310 | 309 | + '}'; |
311 | 310 | } |
312 | 311 |
|
313 | | - public static boolean supportPartialResults(TransportVersion transportVersion) { |
314 | | - return transportVersion.onOrAfter(TransportVersions.ESQL_SUPPORT_PARTIAL_RESULTS); |
315 | | - } |
316 | 312 | } |
0 commit comments