Skip to content

Commit edbbcfb

Browse files
committed
Remove Inference Service feature flag conditionals
1 parent b4ba95e commit edbbcfb

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
import org.elasticsearch.xpack.inference.services.cohere.CohereService;
9494
import org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceService;
9595
import org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceServiceComponents;
96-
import org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceServiceFeature;
9796
import org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceServiceSettings;
9897
import org.elasticsearch.xpack.inference.services.elasticsearch.ElasticsearchInternalService;
9998
import org.elasticsearch.xpack.inference.services.googleaistudio.GoogleAiStudioService;
@@ -209,14 +208,12 @@ public Collection<?> createComponents(PluginServices services) {
209208
var inferenceServices = new ArrayList<>(inferenceServiceExtensions);
210209
inferenceServices.add(this::getInferenceServiceFactories);
211210

212-
if (ElasticInferenceServiceFeature.ELASTIC_INFERENCE_SERVICE_FEATURE_FLAG.isEnabled()) {
213-
ElasticInferenceServiceSettings eisSettings = new ElasticInferenceServiceSettings(settings);
214-
eisComponents.set(new ElasticInferenceServiceComponents(eisSettings.getEisGatewayUrl()));
211+
ElasticInferenceServiceSettings eisSettings = new ElasticInferenceServiceSettings(settings);
212+
eisComponents.set(new ElasticInferenceServiceComponents(eisSettings.getElasticInferenceServiceUrl()));
215213

216-
inferenceServices.add(
217-
() -> List.of(context -> new ElasticInferenceService(httpFactory.get(), serviceComponents.get(), eisComponents.get()))
218-
);
219-
}
214+
inferenceServices.add(
215+
() -> List.of(context -> new ElasticInferenceService(httpFactory.get(), serviceComponents.get(), eisComponents.get()))
216+
);
220217

221218
var factoryContext = new InferenceServiceExtension.InferenceServiceFactoryContext(
222219
services.client(),

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/ElasticInferenceServiceFeature.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
import org.elasticsearch.common.util.FeatureFlag;
1111

1212
/**
13-
* Elastic Inference Service (EIS) feature flag. When the feature is complete, this flag will be removed.
14-
* Enable feature via JVM option: `-Des.eis_feature_flag_enabled=true`.
13+
* Elastic Inference Service feature flag. Not being used anymore, but we'll keep it until the controller is no longer
14+
* passing -Des.elastic_inference_service_feature_flag_enabled=true at startup.
1515
*/
1616
public class ElasticInferenceServiceFeature {
1717

18-
public static final FeatureFlag ELASTIC_INFERENCE_SERVICE_FEATURE_FLAG = new FeatureFlag("eis");
18+
@Deprecated
19+
public static final FeatureFlag ELASTIC_INFERENCE_SERVICE_FEATURE_FLAG = new FeatureFlag("elastic_inference_service");
1920

2021
}

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/ElasticInferenceServiceSettings.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@
1414

1515
public class ElasticInferenceServiceSettings {
1616

17-
static final Setting<String> EIS_GATEWAY_URL = Setting.simpleString("xpack.inference.eis.gateway.url", Setting.Property.NodeScope);
17+
static final Setting<String> ELASTIC_INFERENCE_SERVICE_URL = Setting.simpleString(
18+
"xpack.inference.elastic.url",
19+
Setting.Property.NodeScope
20+
);
1821

19-
// Adjust this variable to be volatile, if the setting can be updated at some point in time
20-
private final String eisGatewayUrl;
22+
private final String elasticInferenceServiceUrl;
2123

2224
public ElasticInferenceServiceSettings(Settings settings) {
23-
eisGatewayUrl = EIS_GATEWAY_URL.get(settings);
25+
elasticInferenceServiceUrl = ELASTIC_INFERENCE_SERVICE_URL.get(settings);
2426
}
2527

2628
public static List<Setting<?>> getSettingsDefinitions() {
27-
return List.of(EIS_GATEWAY_URL);
29+
return List.of(ELASTIC_INFERENCE_SERVICE_URL);
2830
}
2931

30-
public String getEisGatewayUrl() {
31-
return eisGatewayUrl;
32+
public String getElasticInferenceServiceUrl() {
33+
return elasticInferenceServiceUrl;
3234
}
35+
3336
}

0 commit comments

Comments
 (0)