Skip to content

Commit 3c695ac

Browse files
committed
Fix transport version issues after they were consolidated in main
1 parent 6a06b84 commit 3c695ac

File tree

5 files changed

+8
-21
lines changed

5 files changed

+8
-21
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ static TransportVersion def(int id) {
336336
public static final TransportVersion ML_INFERENCE_LLAMA_ADDED = def(9_125_0_00);
337337
public static final TransportVersion SHARD_WRITE_LOAD_IN_CLUSTER_INFO = def(9_126_0_00);
338338
public static final TransportVersion ESQL_SAMPLE_OPERATOR_STATUS = def(9_127_0_00);
339-
public static final TransportVersion RERANK_RESCORE_CHUNKS = def(9_130_0_00);
340339
public static final TransportVersion PROJECT_RESERVED_STATE_MOVE_TO_REGISTRY = def(9_147_0_00);
341340
public static final TransportVersion STREAMS_ENDPOINT_PARAM_RESTRICTIONS = def(9_148_0_00);
342341
public static final TransportVersion RESOLVE_INDEX_MODE_FILTER = def(9_149_0_00);

server/src/main/java/org/elasticsearch/search/rank/feature/RankFeatureDoc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public RankFeatureDoc(int doc, float score, int shardIndex) {
3939

4040
public RankFeatureDoc(StreamInput in) throws IOException {
4141
super(in);
42-
if (in.getTransportVersion().onOrAfter(TransportVersions.RERANK_RESCORE_CHUNKS)) {
42+
if (in.getTransportVersion().supports(RERANK_SNIPPETS)) {
4343
featureData = in.readOptionalStringCollectionAsList();
4444
} else {
4545
String featureDataString = in.readOptionalString();
@@ -58,7 +58,7 @@ public void featureData(List<String> featureData) {
5858

5959
@Override
6060
protected void doWriteTo(StreamOutput out) throws IOException {
61-
if (out.getTransportVersion().onOrAfter(TransportVersions.RERANK_RESCORE_CHUNKS)) {
61+
if (out.getTransportVersion().supports(RERANK_SNIPPETS)) {
6262
out.writeOptionalStringCollection(featureData);
6363
} else {
6464
out.writeOptionalString(featureData.get(0));

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/RecursiveChunkingSettings.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,9 @@ public RecursiveChunkingSettings(StreamInput in) throws IOException {
5656
public void validate() {
5757
ValidationException validationException = new ValidationException();
5858

59-
if (maxChunkSize < MAX_CHUNK_SIZE_LOWER_LIMIT || maxChunkSize > MAX_CHUNK_SIZE_UPPER_LIMIT) {
59+
if (maxChunkSize < MAX_CHUNK_SIZE_LOWER_LIMIT) {
6060
validationException.addValidationError(
61-
ChunkingSettingsOptions.MAX_CHUNK_SIZE
62-
+ "["
63-
+ maxChunkSize
64-
+ "] must be between "
65-
+ MAX_CHUNK_SIZE_LOWER_LIMIT
66-
+ " and "
67-
+ MAX_CHUNK_SIZE_UPPER_LIMIT
61+
ChunkingSettingsOptions.MAX_CHUNK_SIZE + "[" + maxChunkSize + "] must be above " + MAX_CHUNK_SIZE_LOWER_LIMIT
6862
);
6963

7064
if (separators != null && separators.isEmpty()) {

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/WordBoundaryChunkingSettings.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,9 @@ public WordBoundaryChunkingSettings(StreamInput in) throws IOException {
5252
public void validate() {
5353
ValidationException validationException = new ValidationException();
5454

55-
if (maxChunkSize < MAX_CHUNK_SIZE_LOWER_LIMIT || maxChunkSize > MAX_CHUNK_SIZE_UPPER_LIMIT) {
55+
if (maxChunkSize < MAX_CHUNK_SIZE_LOWER_LIMIT) {
5656
validationException.addValidationError(
57-
ChunkingSettingsOptions.MAX_CHUNK_SIZE
58-
+ "["
59-
+ maxChunkSize
60-
+ "] must be between "
61-
+ MAX_CHUNK_SIZE_LOWER_LIMIT
62-
+ " and "
63-
+ MAX_CHUNK_SIZE_UPPER_LIMIT
57+
ChunkingSettingsOptions.MAX_CHUNK_SIZE + "[" + maxChunkSize + "] must be above " + MAX_CHUNK_SIZE_LOWER_LIMIT
6458
);
6559
}
6660

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public TextSimilarityRankBuilder(StreamInput in) throws IOException {
9090
} else {
9191
this.failuresAllowed = false;
9292
}
93-
if (in.getTransportVersion().onOrAfter(TransportVersions.RERANK_RESCORE_CHUNKS)) {
93+
if (in.getTransportVersion().supports(RERANK_SNIPPETS)) {
9494
this.chunkScorerConfig = in.readOptionalWriteable(ChunkScorerConfig::new);
9595
} else {
9696
this.chunkScorerConfig = null;
@@ -118,7 +118,7 @@ public void doWriteTo(StreamOutput out) throws IOException {
118118
|| out.getTransportVersion().onOrAfter(TransportVersions.RERANKER_FAILURES_ALLOWED)) {
119119
out.writeBoolean(failuresAllowed);
120120
}
121-
if (out.getTransportVersion().onOrAfter(TransportVersions.RERANK_RESCORE_CHUNKS)) {
121+
if (out.getTransportVersion().supports(RERANK_SNIPPETS)) {
122122
out.writeOptionalWriteable(chunkScorerConfig);
123123
}
124124
}

0 commit comments

Comments
 (0)