Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ static TransportVersion def(int id) {
public static final TransportVersion ML_INFERENCE_ELASTIC_DENSE_TEXT_EMBEDDINGS_ADDED = def(9_109_00_0);
public static final TransportVersion ML_INFERENCE_COHERE_API_VERSION = def(9_110_0_00);
public static final TransportVersion ESQL_PROFILE_INCLUDE_PLAN = def(9_111_0_00);
public static final TransportVersion ML_INFERENCE_ENDPOINT_CACHE = def(9_157_0_00);
public static final TransportVersion INDEX_SOURCE = def(9_158_0_00);
public static final TransportVersion MAX_HEAP_SIZE_PER_NODE_IN_CLUSTER_INFO = def(9_159_0_00);
public static final TransportVersion TIMESERIES_DEFAULT_LIMIT = def(9_160_0_00);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9157000
2 changes: 1 addition & 1 deletion server/src/main/resources/transport/upper_bounds/9.2.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
inference_api_eis_diagnostics,9156000
ml_inference_endpoint_cache,9157000
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
import java.util.List;
import java.util.Objects;

import static org.elasticsearch.TransportVersions.ML_INFERENCE_ENDPOINT_CACHE;

public class GetInferenceDiagnosticsAction extends ActionType<GetInferenceDiagnosticsAction.Response> {

public static final GetInferenceDiagnosticsAction INSTANCE = new GetInferenceDiagnosticsAction();
public static final String NAME = "cluster:monitor/xpack/inference/diagnostics/get";

private static final TransportVersion ML_INFERENCE_ENDPOINT_CACHE = TransportVersion.fromName("ml_inference_endpoint_cache");
private static final TransportVersion INFERENCE_API_EIS_DIAGNOSTICS = TransportVersion.fromName("inference_api_eis_diagnostics");

public GetInferenceDiagnosticsAction() {
Expand Down Expand Up @@ -151,7 +151,7 @@ public NodeResponse(StreamInput in) throws IOException {
} else {
eisMtlsConnectionPoolStats = ConnectionPoolStats.EMPTY;
}
inferenceEndpointRegistryStats = in.getTransportVersion().onOrAfter(ML_INFERENCE_ENDPOINT_CACHE)
inferenceEndpointRegistryStats = in.getTransportVersion().supports(ML_INFERENCE_ENDPOINT_CACHE)
? in.readOptionalWriteable(Stats::new)
: null;
}
Expand All @@ -164,7 +164,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getTransportVersion().supports(INFERENCE_API_EIS_DIAGNOSTICS)) {
eisMtlsConnectionPoolStats.writeTo(out);
}
if (out.getTransportVersion().onOrAfter(ML_INFERENCE_ENDPOINT_CACHE)) {
if (out.getTransportVersion().supports(ML_INFERENCE_ENDPOINT_CACHE)) {
out.writeOptionalWriteable(inferenceEndpointRegistryStats);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import org.apache.http.pool.PoolStats;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodeUtils;
import org.elasticsearch.common.Strings;
Expand All @@ -22,6 +21,7 @@
public class GetInferenceDiagnosticsActionNodeResponseTests extends AbstractBWCWireSerializationTestCase<
GetInferenceDiagnosticsAction.NodeResponse> {

private static final TransportVersion ML_INFERENCE_ENDPOINT_CACHE = TransportVersion.fromName("ml_inference_endpoint_cache");
private static final TransportVersion INFERENCE_API_EIS_DIAGNOSTICS = TransportVersion.fromName("inference_api_eis_diagnostics");

public static GetInferenceDiagnosticsAction.NodeResponse createRandom() {
Expand Down Expand Up @@ -108,7 +108,7 @@ public static GetInferenceDiagnosticsAction.NodeResponse mutateNodeResponseForVe
GetInferenceDiagnosticsAction.NodeResponse instance,
TransportVersion version
) {
if (version.onOrAfter(TransportVersions.ML_INFERENCE_ENDPOINT_CACHE)) {
if (version.supports(ML_INFERENCE_ENDPOINT_CACHE)) {
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
import java.util.Iterator;
import java.util.Objects;

import static org.elasticsearch.TransportVersions.ML_INFERENCE_ENDPOINT_CACHE;

/**
* Clears the cache in {@link InferenceEndpointRegistry}.
* This uses the cluster state to broadcast the message to all nodes to clear their cache, which has guaranteed delivery.
Expand All @@ -66,6 +64,8 @@ public class ClearInferenceEndpointCacheAction extends AcknowledgedTransportMast
public static final ActionType<AcknowledgedResponse> INSTANCE = new ActionType<>(NAME);
private static final String TASK_QUEUE_NAME = "inference-endpoint-cache-management";

private static final TransportVersion ML_INFERENCE_ENDPOINT_CACHE = TransportVersion.fromName("ml_inference_endpoint_cache");

private final ProjectResolver projectResolver;
private final InferenceEndpointRegistry inferenceEndpointRegistry;
private final MasterServiceTaskQueue<RefreshCacheMetadataVersionTask> taskQueue;
Expand Down