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