Skip to content

Commit 94612b5

Browse files
Refactoring
1 parent ad99b0d commit 94612b5

17 files changed

+1145
-853
lines changed

server/src/main/java/org/elasticsearch/inference/InferenceServiceRegistry.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ public void init(Client client) {
4242
}
4343

4444
public void onNodeStarted() {
45-
services.values().forEach(InferenceService::onNodeStarted);
45+
for (var service : services.values()) {
46+
try {
47+
service.onNodeStarted();
48+
} catch (Exception e) {
49+
// ignore
50+
}
51+
}
4652
}
4753

4854
public Map<String, InferenceService> getServices() {

x-pack/plugin/inference/src/internalClusterTest/java/org/elasticsearch/xpack/inference/integration/InferenceRevokeDefaultEndpointsIT.java

Lines changed: 0 additions & 288 deletions
This file was deleted.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
import org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceService;
119119
import org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceServiceComponents;
120120
import org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceServiceSettings;
121-
import org.elasticsearch.xpack.inference.services.elastic.authorization.ElasticInferenceServiceAuthorizationHandler;
121+
import org.elasticsearch.xpack.inference.services.elastic.authorization.ElasticInferenceServiceAuthorizationRequestHandler;
122122
import org.elasticsearch.xpack.inference.services.elasticsearch.ElasticsearchInternalService;
123123
import org.elasticsearch.xpack.inference.services.googleaistudio.GoogleAiStudioService;
124124
import org.elasticsearch.xpack.inference.services.googlevertexai.GoogleVertexAiService;
@@ -277,10 +277,10 @@ public Collection<?> createComponents(PluginServices services) {
277277
ElasticInferenceServiceSettings inferenceServiceSettings = new ElasticInferenceServiceSettings(settings);
278278
String elasticInferenceUrl = inferenceServiceSettings.getElasticInferenceServiceUrl();
279279

280-
var elasticInferenceServiceComponentsInstance = ElasticInferenceServiceComponents.withDefaultRevokeDelay(elasticInferenceUrl);
280+
var elasticInferenceServiceComponentsInstance = ElasticInferenceServiceComponents.withDefaults(elasticInferenceUrl);
281281
elasticInferenceServiceComponents.set(elasticInferenceServiceComponentsInstance);
282282

283-
var authorizationHandler = new ElasticInferenceServiceAuthorizationHandler(
283+
var authorizationHandler = new ElasticInferenceServiceAuthorizationRequestHandler(
284284
elasticInferenceServiceComponentsInstance.elasticInferenceServiceUrl(),
285285
services.threadPool()
286286
);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
package org.elasticsearch.xpack.inference.services.elastic;
9+
10+
import org.elasticsearch.inference.MinimalServiceSettings;
11+
import org.elasticsearch.inference.Model;
12+
13+
public record DefaultModelConfig(Model model, MinimalServiceSettings settings) {
14+
15+
}

0 commit comments

Comments
 (0)