132
132
import org .opensearch .ml .engine .indices .MLIndicesHandler ;
133
133
import org .opensearch .ml .engine .utils .FileUtils ;
134
134
import org .opensearch .ml .profile .MLModelProfile ;
135
- import org .opensearch .ml .settings .MLFeatureEnabledSetting ;
136
135
import org .opensearch .ml .stats .ActionName ;
137
136
import org .opensearch .ml .stats .MLActionLevelStat ;
138
137
import org .opensearch .ml .stats .MLNodeLevelStat ;
@@ -180,7 +179,6 @@ public class MLModelManager {
180
179
private final MLTaskManager mlTaskManager ;
181
180
private final MLEngine mlEngine ;
182
181
private final DiscoveryNodeHelper nodeHelper ;
183
- private final MLFeatureEnabledSetting mlFeatureEnabledSetting ;
184
182
185
183
private volatile Integer maxModelPerNode ;
186
184
private volatile Integer maxRegisterTasksPerNode ;
@@ -211,8 +209,7 @@ public MLModelManager(
211
209
MLTaskManager mlTaskManager ,
212
210
MLModelCacheHelper modelCacheHelper ,
213
211
MLEngine mlEngine ,
214
- DiscoveryNodeHelper nodeHelper ,
215
- MLFeatureEnabledSetting mlFeatureEnabledSetting
212
+ DiscoveryNodeHelper nodeHelper
216
213
) {
217
214
this .client = client ;
218
215
this .sdkClient = sdkClient ;
@@ -228,7 +225,6 @@ public MLModelManager(
228
225
this .mlTaskManager = mlTaskManager ;
229
226
this .mlEngine = mlEngine ;
230
227
this .nodeHelper = nodeHelper ;
231
- this .mlFeatureEnabledSetting = mlFeatureEnabledSetting ;
232
228
233
229
this .maxModelPerNode = ML_COMMONS_MAX_MODELS_PER_NODE .get (settings );
234
230
clusterService .getClusterSettings ().addSettingsUpdateConsumer (ML_COMMONS_MAX_MODELS_PER_NODE , it -> maxModelPerNode = it );
@@ -1334,9 +1330,6 @@ public synchronized void updateModelCache(String modelId, ActionListener<String>
1334
1330
*/
1335
1331
public synchronized void deployControllerWithDeployedModel (String modelId , ActionListener <String > listener ) {
1336
1332
try (ThreadContext .StoredContext context = client .threadPool ().getThreadContext ().stashContext ()) {
1337
- if (!mlFeatureEnabledSetting .isControllerEnabled ()) {
1338
- throw new IllegalStateException (CONTROLLER_DISABLED_ERR_MSG );
1339
- }
1340
1333
if (!modelCacheHelper .isModelDeployed (modelId )) {
1341
1334
throw new OpenSearchStatusException (
1342
1335
"The model of this model controller has not deployed yet, please deploy the model first." ,
@@ -1506,9 +1499,6 @@ private synchronized void deployControllerWithDeployingModel(
1506
1499
* @param mlModel ml model
1507
1500
*/
1508
1501
public void deployControllerWithDeployingModel (MLModel mlModel , Integer eligibleNodeCount ) {
1509
- if (!mlFeatureEnabledSetting .isControllerEnabled ()) {
1510
- throw new IllegalStateException (CONTROLLER_DISABLED_ERR_MSG );
1511
- }
1512
1502
if (mlModel .getModelState () != MLModelState .DEPLOYING ) {
1513
1503
throw new OpenSearchStatusException (
1514
1504
"This method should only be called when model is in DEPLOYING state, but the model is in state: " + mlModel .getModelState (),
0 commit comments