Skip to content

Commit 196ba2d

Browse files
jdconradmridula-s109
authored andcommitted
Migrate transport version 9157_000 (elastic#134678)
1 parent 802bd70 commit 196ba2d

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ static TransportVersion def(int id) {
321321
public static final TransportVersion ML_INFERENCE_ELASTIC_DENSE_TEXT_EMBEDDINGS_ADDED = def(9_109_00_0);
322322
public static final TransportVersion ML_INFERENCE_COHERE_API_VERSION = def(9_110_0_00);
323323
public static final TransportVersion ESQL_PROFILE_INCLUDE_PLAN = def(9_111_0_00);
324-
public static final TransportVersion ML_INFERENCE_ENDPOINT_CACHE = def(9_157_0_00);
325324
public static final TransportVersion INDEX_SOURCE = def(9_158_0_00);
326325
public static final TransportVersion MAX_HEAP_SIZE_PER_NODE_IN_CLUSTER_INFO = def(9_159_0_00);
327326
public static final TransportVersion TIMESERIES_DEFAULT_LIMIT = def(9_160_0_00);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9157000
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
inference_api_eis_diagnostics,9156000
1+
ml_inference_endpoint_cache,9157000

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/action/GetInferenceDiagnosticsAction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
import java.util.List;
3030
import java.util.Objects;
3131

32-
import static org.elasticsearch.TransportVersions.ML_INFERENCE_ENDPOINT_CACHE;
33-
3432
public class GetInferenceDiagnosticsAction extends ActionType<GetInferenceDiagnosticsAction.Response> {
3533

3634
public static final GetInferenceDiagnosticsAction INSTANCE = new GetInferenceDiagnosticsAction();
3735
public static final String NAME = "cluster:monitor/xpack/inference/diagnostics/get";
36+
37+
private static final TransportVersion ML_INFERENCE_ENDPOINT_CACHE = TransportVersion.fromName("ml_inference_endpoint_cache");
3838
private static final TransportVersion INFERENCE_API_EIS_DIAGNOSTICS = TransportVersion.fromName("inference_api_eis_diagnostics");
3939

4040
public GetInferenceDiagnosticsAction() {
@@ -151,7 +151,7 @@ public NodeResponse(StreamInput in) throws IOException {
151151
} else {
152152
eisMtlsConnectionPoolStats = ConnectionPoolStats.EMPTY;
153153
}
154-
inferenceEndpointRegistryStats = in.getTransportVersion().onOrAfter(ML_INFERENCE_ENDPOINT_CACHE)
154+
inferenceEndpointRegistryStats = in.getTransportVersion().supports(ML_INFERENCE_ENDPOINT_CACHE)
155155
? in.readOptionalWriteable(Stats::new)
156156
: null;
157157
}
@@ -164,7 +164,7 @@ public void writeTo(StreamOutput out) throws IOException {
164164
if (out.getTransportVersion().supports(INFERENCE_API_EIS_DIAGNOSTICS)) {
165165
eisMtlsConnectionPoolStats.writeTo(out);
166166
}
167-
if (out.getTransportVersion().onOrAfter(ML_INFERENCE_ENDPOINT_CACHE)) {
167+
if (out.getTransportVersion().supports(ML_INFERENCE_ENDPOINT_CACHE)) {
168168
out.writeOptionalWriteable(inferenceEndpointRegistryStats);
169169
}
170170
}

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/inference/action/GetInferenceDiagnosticsActionNodeResponseTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import org.apache.http.pool.PoolStats;
1111
import org.elasticsearch.TransportVersion;
12-
import org.elasticsearch.TransportVersions;
1312
import org.elasticsearch.cluster.node.DiscoveryNode;
1413
import org.elasticsearch.cluster.node.DiscoveryNodeUtils;
1514
import org.elasticsearch.common.Strings;
@@ -22,6 +21,7 @@
2221
public class GetInferenceDiagnosticsActionNodeResponseTests extends AbstractBWCWireSerializationTestCase<
2322
GetInferenceDiagnosticsAction.NodeResponse> {
2423

24+
private static final TransportVersion ML_INFERENCE_ENDPOINT_CACHE = TransportVersion.fromName("ml_inference_endpoint_cache");
2525
private static final TransportVersion INFERENCE_API_EIS_DIAGNOSTICS = TransportVersion.fromName("inference_api_eis_diagnostics");
2626

2727
public static GetInferenceDiagnosticsAction.NodeResponse createRandom() {
@@ -108,7 +108,7 @@ public static GetInferenceDiagnosticsAction.NodeResponse mutateNodeResponseForVe
108108
GetInferenceDiagnosticsAction.NodeResponse instance,
109109
TransportVersion version
110110
) {
111-
if (version.onOrAfter(TransportVersions.ML_INFERENCE_ENDPOINT_CACHE)) {
111+
if (version.supports(ML_INFERENCE_ENDPOINT_CACHE)) {
112112
return instance;
113113
}
114114

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/registry/ClearInferenceEndpointCacheAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
import java.util.Iterator;
5151
import java.util.Objects;
5252

53-
import static org.elasticsearch.TransportVersions.ML_INFERENCE_ENDPOINT_CACHE;
54-
5553
/**
5654
* Clears the cache in {@link InferenceEndpointRegistry}.
5755
* This uses the cluster state to broadcast the message to all nodes to clear their cache, which has guaranteed delivery.
@@ -66,6 +64,8 @@ public class ClearInferenceEndpointCacheAction extends AcknowledgedTransportMast
6664
public static final ActionType<AcknowledgedResponse> INSTANCE = new ActionType<>(NAME);
6765
private static final String TASK_QUEUE_NAME = "inference-endpoint-cache-management";
6866

67+
private static final TransportVersion ML_INFERENCE_ENDPOINT_CACHE = TransportVersion.fromName("ml_inference_endpoint_cache");
68+
6969
private final ProjectResolver projectResolver;
7070
private final InferenceEndpointRegistry inferenceEndpointRegistry;
7171
private final MasterServiceTaskQueue<RefreshCacheMetadataVersionTask> taskQueue;

0 commit comments

Comments
 (0)