Skip to content

Commit a4d8a87

Browse files
Removing unified feature flag (#121043)
1 parent dc92c83 commit a4d8a87

File tree

5 files changed

+8
-44
lines changed

5 files changed

+8
-44
lines changed

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/FeatureFlag.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
public enum FeatureFlag {
1919
TIME_SERIES_MODE("es.index_mode_feature_flag_registered=true", Version.fromString("8.0.0"), null),
2020
FAILURE_STORE_ENABLED("es.failure_store_feature_flag_enabled=true", Version.fromString("8.12.0"), null),
21-
SUB_OBJECTS_AUTO_ENABLED("es.sub_objects_auto_feature_flag_enabled=true", Version.fromString("8.16.0"), null),
22-
INFERENCE_UNIFIED_API_ENABLED("es.inference_unified_feature_flag_enabled=true", Version.fromString("8.18.0"), null);
21+
SUB_OBJECTS_AUTO_ENABLED("es.sub_objects_auto_feature_flag_enabled=true", Version.fromString("8.16.0"), null);
2322

2423
public final String systemProperty;
2524
public final Version from;

x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/BaseMockEISAuthServerTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.elasticsearch.common.util.concurrent.ThreadContext;
1515
import org.elasticsearch.core.TimeValue;
1616
import org.elasticsearch.test.cluster.ElasticsearchCluster;
17-
import org.elasticsearch.test.cluster.FeatureFlag;
1817
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
1918
import org.elasticsearch.test.rest.ESRestTestCase;
2019
import org.junit.ClassRule;
@@ -45,7 +44,6 @@ public class BaseMockEISAuthServerTest extends ESRestTestCase {
4544
// This plugin is located in the inference/qa/test-service-plugin package, look for TestInferenceServicePlugin
4645
.plugin("inference-service-test")
4746
.user("x_pack_rest_user", "x-pack-test-password")
48-
.feature(FeatureFlag.INFERENCE_UNIFIED_API_ENABLED)
4947
.build();
5048

5149
// The reason we're doing this is to make sure the mock server is initialized first so we can get the address before communicating

x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceBaseRestTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.elasticsearch.core.Nullable;
2020
import org.elasticsearch.inference.TaskType;
2121
import org.elasticsearch.test.cluster.ElasticsearchCluster;
22-
import org.elasticsearch.test.cluster.FeatureFlag;
2322
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
2423
import org.elasticsearch.test.rest.ESRestTestCase;
2524
import org.elasticsearch.xcontent.XContentBuilder;
@@ -50,8 +49,8 @@ public class InferenceBaseRestTest extends ESRestTestCase {
5049
.setting("xpack.security.enabled", "true")
5150
.plugin("inference-service-test")
5251
.user("x_pack_rest_user", "x-pack-test-password")
53-
.feature(FeatureFlag.INFERENCE_UNIFIED_API_ENABLED)
5452
.build();
53+
5554
@ClassRule
5655
public static MlModelServer mlModelServer = new MlModelServer();
5756

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

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
import java.util.Map;
132132
import java.util.function.Predicate;
133133
import java.util.function.Supplier;
134-
import java.util.stream.Stream;
135134

136135
import static java.util.Collections.singletonList;
137136
import static org.elasticsearch.xpack.inference.services.elastic.ElasticInferenceService.ELASTIC_INFERENCE_SERVICE_IDENTIFIER;
@@ -193,24 +192,17 @@ public InferencePlugin(Settings settings) {
193192

194193
@Override
195194
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
196-
var availableActions = List.of(
195+
return List.of(
197196
new ActionHandler<>(InferenceAction.INSTANCE, TransportInferenceAction.class),
198-
199197
new ActionHandler<>(GetInferenceModelAction.INSTANCE, TransportGetInferenceModelAction.class),
200198
new ActionHandler<>(PutInferenceModelAction.INSTANCE, TransportPutInferenceModelAction.class),
201199
new ActionHandler<>(UpdateInferenceModelAction.INSTANCE, TransportUpdateInferenceModelAction.class),
202200
new ActionHandler<>(DeleteInferenceEndpointAction.INSTANCE, TransportDeleteInferenceEndpointAction.class),
203201
new ActionHandler<>(XPackUsageFeatureAction.INFERENCE, TransportInferenceUsageAction.class),
204202
new ActionHandler<>(GetInferenceDiagnosticsAction.INSTANCE, TransportGetInferenceDiagnosticsAction.class),
205-
new ActionHandler<>(GetInferenceServicesAction.INSTANCE, TransportGetInferenceServicesAction.class)
203+
new ActionHandler<>(GetInferenceServicesAction.INSTANCE, TransportGetInferenceServicesAction.class),
204+
new ActionHandler<>(UnifiedCompletionAction.INSTANCE, TransportUnifiedCompletionInferenceAction.class)
206205
);
207-
208-
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> conditionalActions =
209-
UnifiedCompletionFeature.UNIFIED_COMPLETION_FEATURE_FLAG.isEnabled()
210-
? List.of(new ActionHandler<>(UnifiedCompletionAction.INSTANCE, TransportUnifiedCompletionInferenceAction.class))
211-
: List.of();
212-
213-
return Stream.concat(availableActions.stream(), conditionalActions.stream()).toList();
214206
}
215207

216208
@Override
@@ -225,21 +217,17 @@ public List<RestHandler> getRestHandlers(
225217
Supplier<DiscoveryNodes> nodesInCluster,
226218
Predicate<NodeFeature> clusterSupportsFeature
227219
) {
228-
var availableRestActions = List.of(
220+
return List.of(
229221
new RestInferenceAction(),
230222
new RestStreamInferenceAction(threadPoolSetOnce),
231223
new RestGetInferenceModelAction(),
232224
new RestPutInferenceModelAction(),
233225
new RestUpdateInferenceModelAction(),
234226
new RestDeleteInferenceEndpointAction(),
235227
new RestGetInferenceDiagnosticsAction(),
236-
new RestGetInferenceServicesAction()
228+
new RestGetInferenceServicesAction(),
229+
new RestUnifiedCompletionInferenceAction(threadPoolSetOnce)
237230
);
238-
List<RestHandler> conditionalRestActions = UnifiedCompletionFeature.UNIFIED_COMPLETION_FEATURE_FLAG.isEnabled()
239-
? List.of(new RestUnifiedCompletionInferenceAction(threadPoolSetOnce))
240-
: List.of();
241-
242-
return Stream.concat(availableRestActions.stream(), conditionalRestActions.stream()).toList();
243231
}
244232

245233
@Override

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

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

0 commit comments

Comments
 (0)