diff --git a/common/src/main/java/org/opensearch/ml/common/conversation/ConversationalIndexConstants.java b/common/src/main/java/org/opensearch/ml/common/conversation/ConversationalIndexConstants.java index 88f4920761..48505b9dde 100644 --- a/common/src/main/java/org/opensearch/ml/common/conversation/ConversationalIndexConstants.java +++ b/common/src/main/java/org/opensearch/ml/common/conversation/ConversationalIndexConstants.java @@ -17,7 +17,8 @@ */ package org.opensearch.ml.common.conversation; -import org.opensearch.common.settings.Setting; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED; + import org.opensearch.ml.common.MLIndex; /** @@ -66,10 +67,6 @@ public class ConversationalIndexConstants { /** Mappings for the interactions index */ public final static String INTERACTIONS_MAPPINGS = MLIndex.MEMORY_MESSAGE.getMapping(); - /** Feature Flag setting for conversational memory */ - public static final Setting ML_COMMONS_MEMORY_FEATURE_ENABLED = Setting - .boolSetting("plugins.ml_commons.memory_feature_enabled", true, Setting.Property.NodeScope, Setting.Property.Dynamic); - public static final String ML_COMMONS_MEMORY_FEATURE_DISABLED_MESSAGE = "The Conversation Memory feature is not enabled. To enable, please update the setting " + ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(); diff --git a/plugin/src/main/java/org/opensearch/ml/settings/MLCommonsSettings.java b/common/src/main/java/org/opensearch/ml/common/settings/MLCommonsSettings.java similarity index 97% rename from plugin/src/main/java/org/opensearch/ml/settings/MLCommonsSettings.java rename to common/src/main/java/org/opensearch/ml/common/settings/MLCommonsSettings.java index c066095c35..bdb8708091 100644 --- a/plugin/src/main/java/org/opensearch/ml/settings/MLCommonsSettings.java +++ b/common/src/main/java/org/opensearch/ml/common/settings/MLCommonsSettings.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package org.opensearch.ml.settings; +package org.opensearch.ml.common.settings; import static org.opensearch.remote.metadata.common.CommonValue.REMOTE_METADATA_ENDPOINT_KEY; import static org.opensearch.remote.metadata.common.CommonValue.REMOTE_METADATA_REGION_KEY; @@ -17,8 +17,6 @@ import org.opensearch.core.common.unit.ByteSizeUnit; import org.opensearch.core.common.unit.ByteSizeValue; import org.opensearch.ml.common.CommonValue; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; -import org.opensearch.searchpipelines.questionanswering.generative.GenerativeQAProcessorConstants; import com.google.common.collect.ImmutableList; @@ -215,13 +213,15 @@ private MLCommonsSettings() {} Setting.Property.Dynamic ); - public static final Setting ML_COMMONS_MEMORY_FEATURE_ENABLED = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED; + /** Feature Flag setting for conversational memory */ + public static final Setting ML_COMMONS_MEMORY_FEATURE_ENABLED = Setting + .boolSetting("plugins.ml_commons.memory_feature_enabled", true, Setting.Property.NodeScope, Setting.Property.Dynamic); public static final Setting ML_COMMONS_MCP_FEATURE_ENABLED = CommonValue.ML_COMMONS_MCP_FEATURE_ENABLED; // Feature flag for enabling search processors for Retrieval Augmented Generation using OpenSearch and Remote Inference. - public static final Setting ML_COMMONS_RAG_PIPELINE_FEATURE_ENABLED = - GenerativeQAProcessorConstants.RAG_PIPELINE_FEATURE_ENABLED; + public static final Setting ML_COMMONS_RAG_PIPELINE_FEATURE_ENABLED = Setting + .boolSetting("plugins.ml_commons.rag_pipeline_feature_enabled", true, Setting.Property.NodeScope, Setting.Property.Dynamic); // This setting is to enable/disable agent related API register/execute/delete/get/search agent. public static final Setting ML_COMMONS_AGENT_FRAMEWORK_ENABLED = Setting diff --git a/plugin/src/main/java/org/opensearch/ml/settings/MLFeatureEnabledSetting.java b/common/src/main/java/org/opensearch/ml/common/settings/MLFeatureEnabledSetting.java similarity index 84% rename from plugin/src/main/java/org/opensearch/ml/settings/MLFeatureEnabledSetting.java rename to common/src/main/java/org/opensearch/ml/common/settings/MLFeatureEnabledSetting.java index e32e3af89f..d16f15e5be 100644 --- a/plugin/src/main/java/org/opensearch/ml/settings/MLFeatureEnabledSetting.java +++ b/common/src/main/java/org/opensearch/ml/common/settings/MLFeatureEnabledSetting.java @@ -5,16 +5,16 @@ * */ -package org.opensearch.ml.settings; +package org.opensearch.ml.common.settings; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_AGENT_FRAMEWORK_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_PRIVATE_IP_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONTROLLER_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INFERENCE_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INGESTION_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_INFERENCE_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_AGENT_FRAMEWORK_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_PRIVATE_IP_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_CONTROLLER_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INFERENCE_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INGESTION_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_INFERENCE_ENABLED; import java.util.ArrayList; import java.util.List; @@ -22,7 +22,6 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Settings; -import org.opensearch.ml.common.settings.SettingsChangeListener; import com.google.common.annotations.VisibleForTesting; @@ -137,7 +136,7 @@ public void addListener(SettingsChangeListener listener) { } @VisibleForTesting - void notifyMultiTenancyListeners(boolean isEnabled) { + public void notifyMultiTenancyListeners(boolean isEnabled) { for (SettingsChangeListener listener : listeners) { listener.onMultiTenancyEnabledChanged(isEnabled); } diff --git a/common/src/test/java/org/opensearch/ml/common/settings/MLCommonsSettingsTests.java b/common/src/test/java/org/opensearch/ml/common/settings/MLCommonsSettingsTests.java new file mode 100644 index 0000000000..cb0294ad20 --- /dev/null +++ b/common/src/test/java/org/opensearch/ml/common/settings/MLCommonsSettingsTests.java @@ -0,0 +1,73 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.ml.common.settings; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.junit.Test; +import org.opensearch.core.common.unit.ByteSizeUnit; +import org.opensearch.core.common.unit.ByteSizeValue; + +public class MLCommonsSettingsTests { + + @Test + public void testMaxModelsPerNodeDefaultValue() { + assertEquals(10, MLCommonsSettings.ML_COMMONS_MAX_MODELS_PER_NODE.getDefault(null).intValue()); + } + + @Test + public void testOnlyRunOnMLNodeDefaultValue() { + assertTrue(MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE.getDefault(null)); + } + + @Test + public void testInHousePythonModelDisabledByDefault() { + assertFalse(MLCommonsSettings.ML_COMMONS_ENABLE_INHOUSE_PYTHON_MODEL.getDefault(null)); + } + + @Test + public void testDiskFreeSpaceThresholdDefault() { + ByteSizeValue expected = new ByteSizeValue(5L, ByteSizeUnit.GB); + assertEquals(expected, MLCommonsSettings.ML_COMMONS_DISK_FREE_SPACE_THRESHOLD.getDefault(null)); + } + + @Test + public void testTrustedUrlRegexDefault() { + String expectedRegex = "^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"; + assertEquals(expectedRegex, MLCommonsSettings.ML_COMMONS_TRUSTED_URL_REGEX.getDefault(null)); + } + + @Test + public void testRemoteModelEligibleNodeRolesDefault() { + List expected = List.of("data", "ml"); + assertEquals(expected, MLCommonsSettings.ML_COMMONS_REMOTE_MODEL_ELIGIBLE_NODE_ROLES.getDefault(null)); + } + + @Test + public void testLocalModelEligibleNodeRolesDefault() { + List expected = List.of("data", "ml"); + assertEquals(expected, MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ELIGIBLE_NODE_ROLES.getDefault(null)); + } + + @Test + public void testMultiTenancyDisabledByDefault() { + assertFalse(MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED.getDefault(null)); + } + + @Test + public void testRemoteInferenceEnabledByDefault() { + assertTrue(MLCommonsSettings.ML_COMMONS_REMOTE_INFERENCE_ENABLED.getDefault(null)); + } + + @Test + public void testAllowModelUrlDisabledByDefault() { + assertFalse(MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL.getDefault(null)); + } +} diff --git a/common/src/test/java/org/opensearch/ml/common/settings/MLFeatureEnabledSettingTests.java b/common/src/test/java/org/opensearch/ml/common/settings/MLFeatureEnabledSettingTests.java new file mode 100644 index 0000000000..61019078f1 --- /dev/null +++ b/common/src/test/java/org/opensearch/ml/common/settings/MLFeatureEnabledSettingTests.java @@ -0,0 +1,112 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.ml.common.settings; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.Set; + +import org.junit.Before; +import org.junit.Test; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.settings.ClusterSettings; +import org.opensearch.common.settings.Settings; + +public class MLFeatureEnabledSettingTests { + + private ClusterService mockClusterService; + private ClusterSettings mockClusterSettings; + + @Before + public void setUp() { + mockClusterService = mock(ClusterService.class); + // Create a real ClusterSettings instance with an empty set of registered settings + mockClusterSettings = new ClusterSettings( + Settings.EMPTY, + Set + .of( + MLCommonsSettings.ML_COMMONS_REMOTE_INFERENCE_ENABLED, + MLCommonsSettings.ML_COMMONS_AGENT_FRAMEWORK_ENABLED, + MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ENABLED, + MLCommonsSettings.ML_COMMONS_CONNECTOR_PRIVATE_IP_ENABLED, + MLCommonsSettings.ML_COMMONS_CONTROLLER_ENABLED, + MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INGESTION_ENABLED, + MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INFERENCE_ENABLED, + MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED + ) + ); + when(mockClusterService.getClusterSettings()).thenReturn(mockClusterSettings); + } + + @Test + public void testDefaults_allFeaturesEnabled() { + Settings settings = Settings + .builder() + .put("plugins.ml_commons.remote_inference.enabled", true) + .put("plugins.ml_commons.agent_framework_enabled", true) + .put("plugins.ml_commons.local_model.enabled", true) + .put("plugins.ml_commons.connector.private_ip_enabled", true) + .put("plugins.ml_commons.controller_enabled", true) + .put("plugins.ml_commons.offline_batch_ingestion_enabled", true) + .put("plugins.ml_commons.offline_batch_inference_enabled", true) + .put("plugins.ml_commons.multi_tenancy_enabled", true) + .build(); + + MLFeatureEnabledSetting setting = new MLFeatureEnabledSetting(mockClusterService, settings); + + assertTrue(setting.isRemoteInferenceEnabled()); + assertTrue(setting.isAgentFrameworkEnabled()); + assertTrue(setting.isLocalModelEnabled()); + assertTrue(setting.isConnectorPrivateIpEnabled().get()); + assertTrue(setting.isControllerEnabled()); + assertTrue(setting.isOfflineBatchIngestionEnabled()); + assertTrue(setting.isOfflineBatchInferenceEnabled()); + assertTrue(setting.isMultiTenancyEnabled()); + } + + @Test + public void testDefaults_someFeaturesDisabled() { + Settings settings = Settings + .builder() + .put("plugins.ml_commons.remote_inference.enabled", false) + .put("plugins.ml_commons.agent_framework_enabled", false) + .put("plugins.ml_commons.local_model.enabled", false) + .put("plugins.ml_commons.connector.private_ip_enabled", false) + .put("plugins.ml_commons.controller_enabled", false) + .put("plugins.ml_commons.offline_batch_ingestion_enabled", false) + .put("plugins.ml_commons.offline_batch_inference_enabled", false) + .put("plugins.ml_commons.multi_tenancy_enabled", false) + .build(); + + MLFeatureEnabledSetting setting = new MLFeatureEnabledSetting(mockClusterService, settings); + + assertFalse(setting.isRemoteInferenceEnabled()); + assertFalse(setting.isAgentFrameworkEnabled()); + assertFalse(setting.isLocalModelEnabled()); + assertFalse(setting.isConnectorPrivateIpEnabled().get()); + assertFalse(setting.isControllerEnabled()); + assertFalse(setting.isOfflineBatchIngestionEnabled()); + assertFalse(setting.isOfflineBatchInferenceEnabled()); + assertFalse(setting.isMultiTenancyEnabled()); + } + + @Test + public void testMultiTenancyChangeNotifiesListeners() { + Settings settings = Settings.builder().put("plugins.ml_commons.multi_tenancy_enabled", false).build(); + + MLFeatureEnabledSetting setting = new MLFeatureEnabledSetting(mockClusterService, settings); + + SettingsChangeListener mockListener = mock(SettingsChangeListener.class); + setting.addListener(mockListener); + + setting.notifyMultiTenancyListeners(true); + verify(mockListener).onMultiTenancyEnabledChanged(true); + } +} diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/CreateConversationTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/CreateConversationTransportAction.java index c505a1c8a9..1965348fa6 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/CreateConversationTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/CreateConversationTransportAction.java @@ -28,7 +28,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -67,10 +67,10 @@ public CreateConversationTransportAction( super(CreateConversationAction.NAME, transportService, actionFilters, CreateConversationRequest::new); this.cmHandler = cmHandler; this.client = client; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportAction.java index ae39cb06c8..985c3e4c5b 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportAction.java @@ -31,7 +31,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -70,10 +70,10 @@ public CreateInteractionTransportAction( super(CreateInteractionAction.NAME, transportService, actionFilters, CreateInteractionRequest::new); this.client = client; this.cmHandler = cmHandler; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/DeleteConversationTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/DeleteConversationTransportAction.java index 6365fe1c78..76945ffafc 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/DeleteConversationTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/DeleteConversationTransportAction.java @@ -26,7 +26,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -65,10 +65,10 @@ public DeleteConversationTransportAction( super(DeleteConversationAction.NAME, transportService, actionFilters, DeleteConversationRequest::new); this.client = client; this.cmHandler = cmHandler; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetConversationTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetConversationTransportAction.java index b88603e645..6d0d19a615 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetConversationTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetConversationTransportAction.java @@ -27,7 +27,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.ml.common.conversation.ConversationMeta; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -65,10 +65,10 @@ public GetConversationTransportAction( super(GetConversationAction.NAME, transportService, actionFilters, GetConversationRequest::new); this.client = client; this.cmHandler = cmHandler; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetConversationsTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetConversationsTransportAction.java index e3cc0ad9c4..e9d45f216d 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetConversationsTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetConversationsTransportAction.java @@ -29,7 +29,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.ml.common.conversation.ConversationMeta; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -68,10 +68,10 @@ public GetConversationsTransportAction( super(GetConversationsAction.NAME, transportService, actionFilters, GetConversationsRequest::new); this.client = client; this.cmHandler = cmHandler; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetInteractionTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetInteractionTransportAction.java index d39fc23689..4936bf6936 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetInteractionTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetInteractionTransportAction.java @@ -26,8 +26,8 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; import org.opensearch.ml.common.conversation.Interaction; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -63,10 +63,10 @@ public GetInteractionTransportAction( super(GetInteractionAction.NAME, transportService, actionFilters, GetInteractionRequest::new); this.client = client; this.cmHandler = cmHandler; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetInteractionsTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetInteractionsTransportAction.java index 497f44a0d8..a988a34b3a 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetInteractionsTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/GetInteractionsTransportAction.java @@ -28,8 +28,8 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; import org.opensearch.ml.common.conversation.Interaction; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -68,10 +68,10 @@ public GetInteractionsTransportAction( super(GetInteractionsAction.NAME, transportService, actionFilters, GetInteractionsRequest::new); this.client = client; this.cmHandler = cmHandler; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/SearchConversationsTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/SearchConversationsTransportAction.java index 5fd4fc514e..dd677e16ce 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/SearchConversationsTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/SearchConversationsTransportAction.java @@ -27,7 +27,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; @@ -64,10 +64,10 @@ public SearchConversationsTransportAction( super(SearchConversationsAction.NAME, transportService, actionFilters, MLSearchActionRequest::new); this.cmHandler = cmHandler; this.client = client; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/SearchInteractionsTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/SearchInteractionsTransportAction.java index 18358d68b1..60553de8c2 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/SearchInteractionsTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/SearchInteractionsTransportAction.java @@ -27,7 +27,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -63,10 +63,10 @@ public SearchInteractionsTransportAction( super(SearchInteractionsAction.NAME, transportService, actionFilters, SearchInteractionsRequest::new); this.cmHandler = cmHandler; this.client = client; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/UpdateConversationTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/UpdateConversationTransportAction.java index 6f8558b59b..047ade255a 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/UpdateConversationTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/UpdateConversationTransportAction.java @@ -21,6 +21,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -47,10 +48,10 @@ public UpdateConversationTransportAction( super(UpdateConversationAction.NAME, transportService, actionFilters, UpdateConversationRequest::new); this.client = client; this.cmHandler = cmHandler; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/UpdateInteractionTransportAction.java b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/UpdateInteractionTransportAction.java index f515ab5160..bd5f28cbdb 100644 --- a/memory/src/main/java/org/opensearch/ml/memory/action/conversation/UpdateInteractionTransportAction.java +++ b/memory/src/main/java/org/opensearch/ml/memory/action/conversation/UpdateInteractionTransportAction.java @@ -19,7 +19,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.ConversationalMemoryHandler; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; @@ -46,10 +46,10 @@ public UpdateInteractionTransportAction( super(UpdateInteractionAction.NAME, transportService, actionFilters, UpdateInteractionRequest::new); this.client = client; this.cmHandler = cmHandler; - this.featureIsEnabled = ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); + this.featureIsEnabled = MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.get(clusterService.getSettings()); clusterService .getClusterSettings() - .addSettingsUpdateConsumer(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); + .addSettingsUpdateConsumer(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED, it -> featureIsEnabled = it); } @Override diff --git a/memory/src/test/java/org/opensearch/ml/memory/MemoryTestUtil.java b/memory/src/test/java/org/opensearch/ml/memory/MemoryTestUtil.java index 96cdf8df3c..e8e16cc4ae 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/MemoryTestUtil.java +++ b/memory/src/test/java/org/opensearch/ml/memory/MemoryTestUtil.java @@ -25,16 +25,16 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; public class MemoryTestUtil { public static ClusterService clusterServiceWithMemoryFeatureDisabled() { ClusterService mockClusterService = mock(ClusterService.class); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), false).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), false).build(); when(mockClusterService.getSettings()).thenReturn(settings); when(mockClusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); return mockClusterService; } diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateConversationTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateConversationTransportActionTests.java index aef2da6e91..40ecb05f0a 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateConversationTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateConversationTransportActionTests.java @@ -40,7 +40,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.MemoryTestUtil; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.test.OpenSearchTestCase; @@ -97,13 +97,13 @@ public void setup() throws IOException { this.request = new CreateConversationRequest("test"); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); this.action = spy(new CreateConversationTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); } diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportActionTests.java index 180ea7ab84..f001a01c5c 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportActionTests.java @@ -44,7 +44,7 @@ import org.opensearch.core.index.Index; import org.opensearch.core.index.shard.ShardId; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.MemoryTestUtil; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.test.OpenSearchTestCase; @@ -112,13 +112,13 @@ public void setup() throws IOException { shardId = new ShardId(new Index("indexName", "uuid"), 1); updateResponse = new UpdateResponse(shardId, "taskId", 1, 1, 1, DocWriteResponse.Result.UPDATED); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); this.action = spy(new CreateInteractionTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/DeleteConversationTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/DeleteConversationTransportActionTests.java index e87be1f16a..bf93ebda6d 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/DeleteConversationTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/DeleteConversationTransportActionTests.java @@ -41,7 +41,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.MemoryTestUtil; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.test.OpenSearchTestCase; @@ -97,13 +97,13 @@ public void setup() throws IOException { this.request = new DeleteConversationRequest("test"); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); this.action = spy(new DeleteConversationTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); } diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetConversationTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetConversationTransportActionTests.java index 7bd4af1847..8b5227b322 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetConversationTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetConversationTransportActionTests.java @@ -42,7 +42,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.conversation.ConversationMeta; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.MemoryTestUtil; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.test.OpenSearchTestCase; @@ -95,13 +95,13 @@ public void setup() throws IOException { this.request = new GetConversationRequest("test-cid"); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); this.action = spy(new GetConversationTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); } diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetConversationsTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetConversationsTransportActionTests.java index 6557711ee7..719f006702 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetConversationsTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetConversationsTransportActionTests.java @@ -43,7 +43,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.conversation.ConversationMeta; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.MemoryTestUtil; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.test.OpenSearchTestCase; @@ -99,13 +99,13 @@ public void setup() throws IOException { this.request = new GetConversationsRequest(); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); this.action = spy(new GetConversationsTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); } diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetInteractionTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetInteractionTransportActionTests.java index 4ca4df2436..f63a82a8d6 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetInteractionTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetInteractionTransportActionTests.java @@ -42,8 +42,8 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; import org.opensearch.ml.common.conversation.Interaction; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.MemoryTestUtil; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.test.OpenSearchTestCase; @@ -95,13 +95,13 @@ public void setup() throws IOException { this.request = new GetInteractionRequest("iid"); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); this.action = spy(new GetInteractionTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); } diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetInteractionsTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetInteractionsTransportActionTests.java index cf8af5673f..3b7de19f0c 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetInteractionsTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetInteractionsTransportActionTests.java @@ -43,8 +43,8 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; import org.opensearch.ml.common.conversation.Interaction; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.MemoryTestUtil; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.test.OpenSearchTestCase; @@ -100,13 +100,13 @@ public void setup() throws IOException { this.request = new GetInteractionsRequest("test-cid"); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); this.action = spy(new GetInteractionsTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); } diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetTracesTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetTracesTransportActionTests.java index 8bc29b7081..5c277735c2 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetTracesTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/GetTracesTransportActionTests.java @@ -27,8 +27,8 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; import org.opensearch.ml.common.conversation.Interaction; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; @@ -72,7 +72,7 @@ public void setup() throws IOException { this.request = new GetTracesRequest("test-iid"); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/SearchConversationsTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/SearchConversationsTransportActionTests.java index 4d2adc349d..2cf4cf3aeb 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/SearchConversationsTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/SearchConversationsTransportActionTests.java @@ -42,7 +42,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.memory.MemoryTestUtil; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; @@ -90,13 +90,13 @@ public void setup() throws IOException { MockitoAnnotations.openMocks(this); mlSearchActionRequest = new MLSearchActionRequest(request, null); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); this.action = spy(new SearchConversationsTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); } diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/SearchInteractionsTransportActionsTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/SearchInteractionsTransportActionsTests.java index 483985ab78..48ff922eef 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/SearchInteractionsTransportActionsTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/SearchInteractionsTransportActionsTests.java @@ -41,7 +41,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.MemoryTestUtil; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.test.OpenSearchTestCase; @@ -85,13 +85,13 @@ public class SearchInteractionsTransportActionsTests extends OpenSearchTestCase public void setup() throws IOException { MockitoAnnotations.openMocks(this); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); this.threadContext = new ThreadContext(settings); when(this.client.threadPool()).thenReturn(this.threadPool); when(this.threadPool.getThreadContext()).thenReturn(this.threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); when(this.request.getConversationId()).thenReturn("test_cid"); this.action = spy(new SearchInteractionsTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/UpdateConversationTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/UpdateConversationTransportActionTests.java index 98939bd703..8b33899165 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/UpdateConversationTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/UpdateConversationTransportActionTests.java @@ -35,7 +35,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.index.Index; import org.opensearch.core.index.shard.ShardId; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; @@ -84,7 +84,7 @@ public class UpdateConversationTransportActionTests extends OpenSearchTestCase { public void setup() throws IOException { MockitoAnnotations.openMocks(this); this.clusterService = Mockito.mock(ClusterService.class); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); threadContext = new ThreadContext(settings); this.threadContext = new ThreadContext(settings); @@ -92,7 +92,7 @@ public void setup() throws IOException { when(threadPool.getThreadContext()).thenReturn(threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); String conversationId = "test_conversation_id"; Map updateContent = new HashMap<>(); diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/UpdateInteractionTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/UpdateInteractionTransportActionTests.java index 13a5cc075a..881c660d6d 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/UpdateInteractionTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/UpdateInteractionTransportActionTests.java @@ -33,7 +33,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.index.Index; import org.opensearch.core.index.shard.ShardId; -import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.memory.index.OpenSearchConversationalMemoryHandler; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; @@ -81,7 +81,7 @@ public class UpdateInteractionTransportActionTests extends OpenSearchTestCase { public void setup() throws IOException { MockitoAnnotations.openMocks(this); this.clusterService = Mockito.mock(ClusterService.class); - Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); + Settings settings = Settings.builder().put(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), true).build(); threadContext = new ThreadContext(settings); this.threadContext = new ThreadContext(settings); @@ -89,7 +89,7 @@ public void setup() throws IOException { when(threadPool.getThreadContext()).thenReturn(threadContext); when(this.clusterService.getSettings()).thenReturn(settings); when(this.clusterService.getClusterSettings()) - .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + .thenReturn(new ClusterSettings(settings, Set.of(MLCommonsSettings.ML_COMMONS_MEMORY_FEATURE_ENABLED))); String interactionId = "test_interaction_id"; Map updateContent = Map .of(INTERACTIONS_ADDITIONAL_INFO_FIELD, Map.of("feedback", "thumbs up!"), INTERACTIONS_RESPONSE_FIELD, "response"); diff --git a/plugin/src/main/java/org/opensearch/ml/action/agents/DeleteAgentTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/agents/DeleteAgentTransportAction.java index 22d0afd22b..5eb5783ec3 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/agents/DeleteAgentTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/agents/DeleteAgentTransportAction.java @@ -28,9 +28,9 @@ import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.IndexNotFoundException; import org.opensearch.ml.common.agent.MLAgent; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLAgentDeleteAction; import org.opensearch.ml.common.transport.agent.MLAgentDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.DeleteDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/agents/GetAgentTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/agents/GetAgentTransportAction.java index 4f6a15dfe3..759e79f092 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/agents/GetAgentTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/agents/GetAgentTransportAction.java @@ -26,10 +26,10 @@ import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.IndexNotFoundException; import org.opensearch.ml.common.agent.MLAgent; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLAgentGetAction; import org.opensearch.ml.common.transport.agent.MLAgentGetRequest; import org.opensearch.ml.common.transport.agent.MLAgentGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.GetDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/agents/TransportRegisterAgentAction.java b/plugin/src/main/java/org/opensearch/ml/action/agents/TransportRegisterAgentAction.java index 6ae3776937..2a9e3322df 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/agents/TransportRegisterAgentAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/agents/TransportRegisterAgentAction.java @@ -26,12 +26,12 @@ import org.opensearch.ml.common.CommonValue; import org.opensearch.ml.common.MLAgentType; import org.opensearch.ml.common.agent.MLAgent; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLRegisterAgentAction; import org.opensearch.ml.common.transport.agent.MLRegisterAgentRequest; import org.opensearch.ml.common.transport.agent.MLRegisterAgentResponse; import org.opensearch.ml.engine.algorithms.agent.MLPlanExecuteAndReflectAgentRunner; import org.opensearch.ml.engine.indices.MLIndicesHandler; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.PutDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/agents/TransportSearchAgentAction.java b/plugin/src/main/java/org/opensearch/ml/action/agents/TransportSearchAgentAction.java index 2912d92038..c721561639 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/agents/TransportSearchAgentAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/agents/TransportSearchAgentAction.java @@ -18,9 +18,9 @@ import org.opensearch.index.query.QueryBuilders; import org.opensearch.ml.common.CommonValue; import org.opensearch.ml.common.agent.MLAgent; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLSearchAgentAction; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.SearchDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/batch/TransportBatchIngestionAction.java b/plugin/src/main/java/org/opensearch/ml/action/batch/TransportBatchIngestionAction.java index e5e737f585..b7e19ccaaf 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/batch/TransportBatchIngestionAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/batch/TransportBatchIngestionAction.java @@ -9,8 +9,8 @@ import static org.opensearch.ml.common.MLTask.STATE_FIELD; import static org.opensearch.ml.common.MLTaskState.COMPLETED; import static org.opensearch.ml.common.MLTaskState.FAILED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_BATCH_INGESTION_BULK_SIZE; import static org.opensearch.ml.plugin.MachineLearningPlugin.INGEST_THREAD_POOL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_BATCH_INGESTION_BULK_SIZE; import static org.opensearch.ml.task.MLTaskManager.TASK_SEMAPHORE_TIMEOUT; import static org.opensearch.ml.utils.MLExceptionUtils.OFFLINE_BATCH_INGESTION_DISABLED_ERR_MSG; @@ -32,6 +32,7 @@ import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.MLTaskState; import org.opensearch.ml.common.MLTaskType; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.batch.MLBatchIngestionAction; import org.opensearch.ml.common.transport.batch.MLBatchIngestionInput; import org.opensearch.ml.common.transport.batch.MLBatchIngestionRequest; @@ -39,7 +40,6 @@ import org.opensearch.ml.engine.MLEngineClassLoader; import org.opensearch.ml.engine.ingest.Ingestable; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.ml.utils.MLExceptionUtils; import org.opensearch.tasks.Task; diff --git a/plugin/src/main/java/org/opensearch/ml/action/config/GetConfigTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/config/GetConfigTransportAction.java index bf267860d1..e42bb92bd5 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/config/GetConfigTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/config/GetConfigTransportAction.java @@ -23,10 +23,10 @@ import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.IndexNotFoundException; import org.opensearch.ml.common.MLConfig; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.config.MLConfigGetAction; import org.opensearch.ml.common.transport.config.MLConfigGetRequest; import org.opensearch.ml.common.transport.config.MLConfigGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; diff --git a/plugin/src/main/java/org/opensearch/ml/action/connector/DeleteConnectorTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/connector/DeleteConnectorTransportAction.java index ff9f869927..88460f9510 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/connector/DeleteConnectorTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/connector/DeleteConnectorTransportAction.java @@ -29,10 +29,10 @@ import org.opensearch.index.query.QueryBuilders; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.exception.MLValidationException; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorDeleteAction; import org.opensearch.ml.common.transport.connector.MLConnectorDeleteRequest; import org.opensearch.ml.helper.ConnectorAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.DeleteDataObjectRequest; import org.opensearch.remote.metadata.client.DeleteDataObjectResponse; diff --git a/plugin/src/main/java/org/opensearch/ml/action/connector/GetConnectorTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/connector/GetConnectorTransportAction.java index 210dc0194d..f5d893bb7e 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/connector/GetConnectorTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/connector/GetConnectorTransportAction.java @@ -18,11 +18,11 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.connector.Connector; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorGetAction; import org.opensearch.ml.common.transport.connector.MLConnectorGetRequest; import org.opensearch.ml.common.transport.connector.MLConnectorGetResponse; import org.opensearch.ml.helper.ConnectorAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.GetDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/connector/SearchConnectorTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/connector/SearchConnectorTransportAction.java index f814098cbc..261fdd8cb1 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/connector/SearchConnectorTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/connector/SearchConnectorTransportAction.java @@ -26,10 +26,10 @@ import org.opensearch.index.IndexNotFoundException; import org.opensearch.ml.common.CommonValue; import org.opensearch.ml.common.connector.HttpConnector; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorSearchAction; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.helper.ConnectorAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.SdkClient; diff --git a/plugin/src/main/java/org/opensearch/ml/action/connector/TransportCreateConnectorAction.java b/plugin/src/main/java/org/opensearch/ml/action/connector/TransportCreateConnectorAction.java index 1583dbb5b3..8013007dd3 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/connector/TransportCreateConnectorAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/connector/TransportCreateConnectorAction.java @@ -7,7 +7,7 @@ import static org.opensearch.ml.common.CommonValue.ML_COMMONS_MCP_FEATURE_DISABLED_MESSAGE; import static org.opensearch.ml.common.CommonValue.ML_CONNECTOR_INDEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; import java.time.Instant; import java.util.HashSet; @@ -32,6 +32,7 @@ import org.opensearch.ml.common.CommonValue; import org.opensearch.ml.common.connector.Connector; import org.opensearch.ml.common.connector.ConnectorProtocols; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorAction; import org.opensearch.ml.common.transport.connector.MLCreateConnectorInput; import org.opensearch.ml.common.transport.connector.MLCreateConnectorRequest; @@ -41,7 +42,6 @@ import org.opensearch.ml.engine.indices.MLIndicesHandler; import org.opensearch.ml.helper.ConnectorAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.PutDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/connector/UpdateConnectorTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/connector/UpdateConnectorTransportAction.java index adbf5d589b..243515b142 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/connector/UpdateConnectorTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/connector/UpdateConnectorTransportAction.java @@ -7,7 +7,7 @@ import static org.opensearch.ml.common.CommonValue.ML_CONNECTOR_INDEX; import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; import java.time.Instant; import java.util.ArrayList; @@ -33,13 +33,13 @@ import org.opensearch.index.query.BoolQueryBuilder; import org.opensearch.index.query.QueryBuilders; import org.opensearch.ml.common.MLModel; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorInput; import org.opensearch.ml.common.transport.connector.MLUpdateConnectorAction; import org.opensearch.ml.common.transport.connector.MLUpdateConnectorRequest; import org.opensearch.ml.engine.MLEngine; import org.opensearch.ml.helper.ConnectorAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.GetDataObjectRequest; import org.opensearch.remote.metadata.client.SdkClient; diff --git a/plugin/src/main/java/org/opensearch/ml/action/controller/CreateControllerTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/controller/CreateControllerTransportAction.java index 27b0f8438e..92fd0228f1 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/controller/CreateControllerTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/controller/CreateControllerTransportAction.java @@ -41,6 +41,7 @@ import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.controller.MLController; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLCreateControllerAction; import org.opensearch.ml.common.transport.controller.MLCreateControllerRequest; import org.opensearch.ml.common.transport.controller.MLCreateControllerResponse; @@ -51,7 +52,6 @@ import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelCacheHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; diff --git a/plugin/src/main/java/org/opensearch/ml/action/controller/DeleteControllerTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/controller/DeleteControllerTransportAction.java index 2b3b318629..3be5e07a0b 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/controller/DeleteControllerTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/controller/DeleteControllerTransportAction.java @@ -33,6 +33,7 @@ import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.MLModel; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLControllerDeleteAction; import org.opensearch.ml.common.transport.controller.MLControllerDeleteRequest; import org.opensearch.ml.common.transport.controller.MLUndeployControllerAction; @@ -41,7 +42,6 @@ import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelCacheHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; diff --git a/plugin/src/main/java/org/opensearch/ml/action/controller/GetControllerTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/controller/GetControllerTransportAction.java index 6874e5cb22..d70488948f 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/controller/GetControllerTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/controller/GetControllerTransportAction.java @@ -28,12 +28,12 @@ import org.opensearch.index.IndexNotFoundException; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.controller.MLController; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLControllerGetAction; import org.opensearch.ml.common.transport.controller.MLControllerGetRequest; import org.opensearch.ml.common.transport.controller.MLControllerGetResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.search.fetch.subphase.FetchSourceContext; import org.opensearch.tasks.Task; diff --git a/plugin/src/main/java/org/opensearch/ml/action/controller/UpdateControllerTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/controller/UpdateControllerTransportAction.java index 05cc32e3a5..ac44069930 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/controller/UpdateControllerTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/controller/UpdateControllerTransportAction.java @@ -38,6 +38,7 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.controller.MLController; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLDeployControllerAction; import org.opensearch.ml.common.transport.controller.MLDeployControllerNodesRequest; import org.opensearch.ml.common.transport.controller.MLDeployControllerNodesResponse; @@ -46,7 +47,6 @@ import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelCacheHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; diff --git a/plugin/src/main/java/org/opensearch/ml/action/deploy/TransportDeployModelAction.java b/plugin/src/main/java/org/opensearch/ml/action/deploy/TransportDeployModelAction.java index e4e1fb57c4..168f2fb360 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/deploy/TransportDeployModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/deploy/TransportDeployModelAction.java @@ -8,9 +8,9 @@ import static org.opensearch.ml.common.MLTask.ERROR_FIELD; import static org.opensearch.ml.common.MLTask.STATE_FIELD; import static org.opensearch.ml.common.MLTaskState.FAILED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; import static org.opensearch.ml.common.utils.StringUtils.getErrorMessage; import static org.opensearch.ml.plugin.MachineLearningPlugin.DEPLOY_THREAD_POOL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; import static org.opensearch.ml.task.MLTaskManager.TASK_SEMAPHORE_TIMEOUT; import static org.opensearch.ml.utils.MLExceptionUtils.LOCAL_MODEL_DISABLED_ERR_MSG; import static org.opensearch.ml.utils.MLExceptionUtils.REMOTE_INFERENCE_DISABLED_ERR_MSG; @@ -45,6 +45,7 @@ import org.opensearch.ml.common.MLTaskState; import org.opensearch.ml.common.MLTaskType; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.deploy.MLDeployModelAction; import org.opensearch.ml.common.transport.deploy.MLDeployModelInput; import org.opensearch.ml.common.transport.deploy.MLDeployModelNodesRequest; @@ -55,7 +56,6 @@ import org.opensearch.ml.engine.ModelHelper; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.stats.MLStats; import org.opensearch.ml.task.MLTaskDispatcher; import org.opensearch.ml.task.MLTaskManager; diff --git a/plugin/src/main/java/org/opensearch/ml/action/forward/TransportForwardAction.java b/plugin/src/main/java/org/opensearch/ml/action/forward/TransportForwardAction.java index d552555891..bc9c033bbc 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/forward/TransportForwardAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/forward/TransportForwardAction.java @@ -5,8 +5,8 @@ package org.opensearch.ml.action.forward; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_ENABLE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_SUCCESS_RATIO; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_ENABLE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_SUCCESS_RATIO; import static org.opensearch.ml.task.MLTaskManager.TASK_SEMAPHORE_TIMEOUT; import static org.opensearch.ml.utils.MLExceptionUtils.logException; import static org.opensearch.ml.utils.MLExceptionUtils.toJsonString; @@ -38,6 +38,7 @@ import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.MLTaskState; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.forward.MLForwardAction; import org.opensearch.ml.common.transport.forward.MLForwardInput; import org.opensearch.ml.common.transport.forward.MLForwardRequest; @@ -48,7 +49,6 @@ import org.opensearch.ml.common.transport.sync.MLSyncUpInput; import org.opensearch.ml.common.transport.sync.MLSyncUpNodesRequest; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskCache; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.ml.utils.TenantAwareHelper; diff --git a/plugin/src/main/java/org/opensearch/ml/action/model_group/DeleteModelGroupTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/model_group/DeleteModelGroupTransportAction.java index a6a72f597a..7a9b3925b4 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/model_group/DeleteModelGroupTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/model_group/DeleteModelGroupTransportAction.java @@ -28,10 +28,10 @@ import org.opensearch.index.query.BoolQueryBuilder; import org.opensearch.index.query.TermQueryBuilder; import org.opensearch.ml.common.exception.MLValidationException; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupDeleteAction; import org.opensearch.ml.common.transport.model_group.MLModelGroupDeleteRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.DeleteDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/model_group/GetModelGroupTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/model_group/GetModelGroupTransportAction.java index f4408e008d..f1dbe8be48 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/model_group/GetModelGroupTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/model_group/GetModelGroupTransportAction.java @@ -27,11 +27,11 @@ import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.IndexNotFoundException; import org.opensearch.ml.common.MLModelGroup; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetAction; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetRequest; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.GetDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/model_group/SearchModelGroupTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/model_group/SearchModelGroupTransportAction.java index ce4e4919cd..96af8cd317 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/model_group/SearchModelGroupTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/model_group/SearchModelGroupTransportAction.java @@ -17,10 +17,10 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.commons.authuser.User; import org.opensearch.core.action.ActionListener; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupSearchAction; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.SdkClient; diff --git a/plugin/src/main/java/org/opensearch/ml/action/model_group/TransportRegisterModelGroupAction.java b/plugin/src/main/java/org/opensearch/ml/action/model_group/TransportRegisterModelGroupAction.java index 77300e182e..dcd38bebaa 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/model_group/TransportRegisterModelGroupAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/model_group/TransportRegisterModelGroupAction.java @@ -12,6 +12,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.ml.common.MLTaskState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupAction; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupInput; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupRequest; @@ -19,7 +20,6 @@ import org.opensearch.ml.engine.indices.MLIndicesHandler; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelGroupManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.tasks.Task; diff --git a/plugin/src/main/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupAction.java b/plugin/src/main/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupAction.java index 1ab582fc91..d3ab730f0d 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupAction.java @@ -36,13 +36,13 @@ import org.opensearch.ml.common.AccessMode; import org.opensearch.ml.common.MLModelGroup; import org.opensearch.ml.common.exception.MLValidationException; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupAction; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupInput; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupRequest; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelGroupManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.GetDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java index 8404e76d85..c7f9d4ae18 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java @@ -14,8 +14,8 @@ import static org.opensearch.ml.common.MLModel.FUNCTION_NAME_FIELD; import static org.opensearch.ml.common.MLModel.IS_HIDDEN_FIELD; import static org.opensearch.ml.common.MLModel.MODEL_ID_FIELD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_SAFE_DELETE_WITH_USAGE_CHECK; import static org.opensearch.ml.common.utils.StringUtils.getErrorMessage; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_SAFE_DELETE_WITH_USAGE_CHECK; import static org.opensearch.ml.utils.RestActionUtils.getFetchSourceContext; import java.util.ArrayDeque; @@ -69,12 +69,12 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelDeleteAction; import org.opensearch.ml.common.transport.model.MLModelDeleteRequest; import org.opensearch.ml.common.transport.model.MLModelGetRequest; import org.opensearch.ml.engine.utils.AgentModelsSearcher; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.DeleteDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/models/GetModelTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/models/GetModelTransportAction.java index ee126c5bc1..64c9eb6676 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/models/GetModelTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/models/GetModelTransportAction.java @@ -31,11 +31,11 @@ import org.opensearch.index.IndexNotFoundException; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.connector.Connector; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelGetAction; import org.opensearch.ml.common.transport.model.MLModelGetRequest; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.GetDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/models/SearchModelTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/models/SearchModelTransportAction.java index bc313c0205..6a91110670 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/models/SearchModelTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/models/SearchModelTransportAction.java @@ -11,9 +11,9 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.ml.action.handler.MLSearchHandler; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelSearchAction; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.tasks.Task; diff --git a/plugin/src/main/java/org/opensearch/ml/action/models/UpdateModelTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/models/UpdateModelTransportAction.java index 74b3ee57de..d17085f01f 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/models/UpdateModelTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/models/UpdateModelTransportAction.java @@ -9,7 +9,7 @@ import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; import static org.opensearch.ml.common.FunctionName.REMOTE; import static org.opensearch.ml.common.FunctionName.TEXT_EMBEDDING; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; import java.io.IOException; import java.time.Instant; @@ -47,6 +47,7 @@ import org.opensearch.ml.common.connector.Connector; import org.opensearch.ml.common.controller.MLRateLimiter; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLUpdateModelAction; import org.opensearch.ml.common.transport.model.MLUpdateModelInput; import org.opensearch.ml.common.transport.model.MLUpdateModelRequest; @@ -58,7 +59,6 @@ import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelGroupManager; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.SdkClient; diff --git a/plugin/src/main/java/org/opensearch/ml/action/prediction/TransportPredictionTaskAction.java b/plugin/src/main/java/org/opensearch/ml/action/prediction/TransportPredictionTaskAction.java index 423cb1ed71..92b4dbaa4e 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/prediction/TransportPredictionTaskAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/prediction/TransportPredictionTaskAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.action.prediction; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_DEPLOY_ENABLE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_DEPLOY_ENABLE; import static org.opensearch.ml.utils.MLExceptionUtils.LOCAL_MODEL_DISABLED_ERR_MSG; import org.opensearch.OpenSearchStatusException; @@ -27,13 +27,13 @@ import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.exception.MLResourceNotFoundException; import org.opensearch.ml.common.input.MLInput; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.MLTaskResponse; import org.opensearch.ml.common.transport.prediction.MLPredictionTaskAction; import org.opensearch.ml.common.transport.prediction.MLPredictionTaskRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelCacheHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLPredictTaskRunner; import org.opensearch.ml.task.MLTaskRunner; import org.opensearch.ml.utils.MLNodeUtils; diff --git a/plugin/src/main/java/org/opensearch/ml/action/register/TransportRegisterModelAction.java b/plugin/src/main/java/org/opensearch/ml/action/register/TransportRegisterModelAction.java index 68a843bc20..30062befe2 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/register/TransportRegisterModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/register/TransportRegisterModelAction.java @@ -8,10 +8,10 @@ import static org.opensearch.ml.common.MLTask.STATE_FIELD; import static org.opensearch.ml.common.MLTaskState.FAILED; import static org.opensearch.ml.common.connector.ConnectorAction.ActionType.PREDICT; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_URL_REGEX; import static org.opensearch.ml.common.utils.ModelInterfaceUtils.updateRegisterModelInputModelInterfaceFieldsByConnector; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_URL_REGEX; import static org.opensearch.ml.task.MLTaskManager.TASK_SEMAPHORE_TIMEOUT; import static org.opensearch.ml.utils.MLExceptionUtils.LOCAL_MODEL_DISABLED_ERR_MSG; import static org.opensearch.ml.utils.MLExceptionUtils.logException; @@ -39,6 +39,7 @@ import org.opensearch.ml.common.MLTaskState; import org.opensearch.ml.common.MLTaskType; import org.opensearch.ml.common.connector.McpConnector; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorAction; import org.opensearch.ml.common.transport.connector.MLCreateConnectorInput; import org.opensearch.ml.common.transport.connector.MLCreateConnectorRequest; @@ -59,7 +60,6 @@ import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelGroupManager; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.stats.MLStats; import org.opensearch.ml.task.MLTaskDispatcher; import org.opensearch.ml.task.MLTaskManager; diff --git a/plugin/src/main/java/org/opensearch/ml/action/syncup/TransportSyncUpOnNodeAction.java b/plugin/src/main/java/org/opensearch/ml/action/syncup/TransportSyncUpOnNodeAction.java index b6bbd5429d..35ddf8deb0 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/syncup/TransportSyncUpOnNodeAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/syncup/TransportSyncUpOnNodeAction.java @@ -5,8 +5,8 @@ package org.opensearch.ml.action.syncup; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ML_TASK_TIMEOUT_IN_SECONDS; import static org.opensearch.ml.engine.utils.FileUtils.deleteFileQuietly; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ML_TASK_TIMEOUT_IN_SECONDS; import java.io.IOException; import java.nio.file.Path; diff --git a/plugin/src/main/java/org/opensearch/ml/action/tasks/CancelBatchJobTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/tasks/CancelBatchJobTransportAction.java index 58d67edf7b..4c1bf76529 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/tasks/CancelBatchJobTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/tasks/CancelBatchJobTransportAction.java @@ -46,6 +46,7 @@ import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.output.model.ModelTensorOutput; import org.opensearch.ml.common.output.model.ModelTensors; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.MLTaskResponse; import org.opensearch.ml.common.transport.task.MLCancelBatchJobAction; import org.opensearch.ml.common.transport.task.MLCancelBatchJobRequest; @@ -57,7 +58,6 @@ import org.opensearch.ml.helper.ConnectorAccessControlHelper; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.script.ScriptService; diff --git a/plugin/src/main/java/org/opensearch/ml/action/tasks/DeleteTaskTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/tasks/DeleteTaskTransportAction.java index 12b6a23950..ad0b7f9586 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/tasks/DeleteTaskTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/tasks/DeleteTaskTransportAction.java @@ -28,9 +28,9 @@ import org.opensearch.index.IndexNotFoundException; import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.MLTaskState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.task.MLTaskDeleteAction; import org.opensearch.ml.common.transport.task.MLTaskDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.DeleteDataObjectRequest; import org.opensearch.remote.metadata.client.DeleteDataObjectResponse; diff --git a/plugin/src/main/java/org/opensearch/ml/action/tasks/GetTaskTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/tasks/GetTaskTransportAction.java index 6da8b35355..2422a439d2 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/tasks/GetTaskTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/tasks/GetTaskTransportAction.java @@ -21,12 +21,12 @@ import static org.opensearch.ml.common.connector.AbstractConnector.SECRET_KEY_FIELD; import static org.opensearch.ml.common.connector.AbstractConnector.SESSION_TOKEN_FIELD; import static org.opensearch.ml.common.connector.ConnectorAction.ActionType.BATCH_PREDICT_STATUS; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_CANCELLED_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_CANCELLING_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_COMPLETED_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_EXPIRED_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_FAILED_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_FIELD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_CANCELLED_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_CANCELLING_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_COMPLETED_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_EXPIRED_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_FAILED_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_FIELD; import static org.opensearch.ml.utils.MLExceptionUtils.BATCH_INFERENCE_DISABLED_ERR_MSG; import static org.opensearch.ml.utils.MLExceptionUtils.logException; @@ -72,6 +72,7 @@ import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.output.model.ModelTensorOutput; import org.opensearch.ml.common.output.model.ModelTensors; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.MLTaskResponse; import org.opensearch.ml.common.transport.task.MLTaskGetAction; import org.opensearch.ml.common.transport.task.MLTaskGetRequest; @@ -85,7 +86,6 @@ import org.opensearch.ml.helper.ConnectorAccessControlHelper; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; diff --git a/plugin/src/main/java/org/opensearch/ml/action/tasks/SearchTaskTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/tasks/SearchTaskTransportAction.java index 613df7bb06..2ee5fd076d 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/tasks/SearchTaskTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/tasks/SearchTaskTransportAction.java @@ -13,9 +13,9 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.common.transport.task.MLTaskSearchAction; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.SearchDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsAction.java b/plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsAction.java index 7018e28739..7f0a298b81 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsAction.java @@ -40,6 +40,7 @@ import org.opensearch.ml.cluster.DiscoveryNodeHelper; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.deploy.MLDeployModelRequest; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelAction; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelNodesRequest; @@ -50,7 +51,6 @@ import org.opensearch.ml.engine.ModelHelper; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskDispatcher; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.ml.utils.RestActionUtils; diff --git a/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java b/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java index 0bf82e811d..4710ffa18d 100644 --- a/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java +++ b/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java @@ -30,6 +30,7 @@ import org.opensearch.index.query.TermsQueryBuilder; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.common.transport.deploy.MLDeployModelAction; import org.opensearch.ml.common.transport.deploy.MLDeployModelRequest; import org.opensearch.ml.common.transport.deploy.MLDeployModelResponse; @@ -37,7 +38,6 @@ import org.opensearch.ml.common.transport.undeploy.MLUndeployModelNodesRequest; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelNodesResponse; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLCommonsSettings; import org.opensearch.search.SearchHit; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.fetch.subphase.FetchSourceContext; diff --git a/plugin/src/main/java/org/opensearch/ml/breaker/DiskCircuitBreaker.java b/plugin/src/main/java/org/opensearch/ml/breaker/DiskCircuitBreaker.java index 1fb1ef36cf..59b7674d8e 100644 --- a/plugin/src/main/java/org/opensearch/ml/breaker/DiskCircuitBreaker.java +++ b/plugin/src/main/java/org/opensearch/ml/breaker/DiskCircuitBreaker.java @@ -5,7 +5,7 @@ package org.opensearch.ml.breaker; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_DISK_FREE_SPACE_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_DISK_FREE_SPACE_THRESHOLD; import java.io.File; import java.security.AccessController; diff --git a/plugin/src/main/java/org/opensearch/ml/breaker/MemoryCircuitBreaker.java b/plugin/src/main/java/org/opensearch/ml/breaker/MemoryCircuitBreaker.java index 92b86e98ef..db8789bebc 100644 --- a/plugin/src/main/java/org/opensearch/ml/breaker/MemoryCircuitBreaker.java +++ b/plugin/src/main/java/org/opensearch/ml/breaker/MemoryCircuitBreaker.java @@ -5,7 +5,7 @@ package org.opensearch.ml.breaker; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_JVM_HEAP_MEM_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_JVM_HEAP_MEM_THRESHOLD; import java.util.Optional; diff --git a/plugin/src/main/java/org/opensearch/ml/breaker/NativeMemoryCircuitBreaker.java b/plugin/src/main/java/org/opensearch/ml/breaker/NativeMemoryCircuitBreaker.java index 7c0ea6794b..be77072a60 100644 --- a/plugin/src/main/java/org/opensearch/ml/breaker/NativeMemoryCircuitBreaker.java +++ b/plugin/src/main/java/org/opensearch/ml/breaker/NativeMemoryCircuitBreaker.java @@ -5,7 +5,7 @@ package org.opensearch.ml.breaker; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD; import java.util.Optional; diff --git a/plugin/src/main/java/org/opensearch/ml/cluster/DiscoveryNodeHelper.java b/plugin/src/main/java/org/opensearch/ml/cluster/DiscoveryNodeHelper.java index 16556bc12b..ba2252b699 100644 --- a/plugin/src/main/java/org/opensearch/ml/cluster/DiscoveryNodeHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/cluster/DiscoveryNodeHelper.java @@ -5,10 +5,10 @@ package org.opensearch.ml.cluster; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_EXCLUDE_NODE_NAMES; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ELIGIBLE_NODE_ROLES; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_MODEL_ELIGIBLE_NODE_ROLES; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_EXCLUDE_NODE_NAMES; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ELIGIBLE_NODE_ROLES; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_MODEL_ELIGIBLE_NODE_ROLES; import java.util.ArrayList; import java.util.HashSet; diff --git a/plugin/src/main/java/org/opensearch/ml/cluster/MLCommonsClusterEventListener.java b/plugin/src/main/java/org/opensearch/ml/cluster/MLCommonsClusterEventListener.java index 8515c247d2..50f0ec199f 100644 --- a/plugin/src/main/java/org/opensearch/ml/cluster/MLCommonsClusterEventListener.java +++ b/plugin/src/main/java/org/opensearch/ml/cluster/MLCommonsClusterEventListener.java @@ -5,7 +5,7 @@ package org.opensearch.ml.cluster; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MONITORING_REQUEST_COUNT; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MONITORING_REQUEST_COUNT; import java.util.List; import java.util.Set; diff --git a/plugin/src/main/java/org/opensearch/ml/cluster/MLCommonsClusterManagerEventListener.java b/plugin/src/main/java/org/opensearch/ml/cluster/MLCommonsClusterManagerEventListener.java index 22e1d73d50..413793a58a 100644 --- a/plugin/src/main/java/org/opensearch/ml/cluster/MLCommonsClusterManagerEventListener.java +++ b/plugin/src/main/java/org/opensearch/ml/cluster/MLCommonsClusterManagerEventListener.java @@ -5,8 +5,8 @@ package org.opensearch.ml.cluster; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_SYNC_UP_JOB_INTERVAL_IN_SECONDS; import static org.opensearch.ml.plugin.MachineLearningPlugin.GENERAL_THREAD_POOL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_SYNC_UP_JOB_INTERVAL_IN_SECONDS; import java.util.List; @@ -17,9 +17,9 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.core.action.ActionListener; import org.opensearch.ml.autoredeploy.MLModelAutoReDeployer; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.engine.encryptor.Encryptor; import org.opensearch.ml.engine.indices.MLIndicesHandler; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.threadpool.Scheduler; import org.opensearch.threadpool.ThreadPool; diff --git a/plugin/src/main/java/org/opensearch/ml/cluster/MLSyncUpCron.java b/plugin/src/main/java/org/opensearch/ml/cluster/MLSyncUpCron.java index c2fb02bd3c..426287224e 100644 --- a/plugin/src/main/java/org/opensearch/ml/cluster/MLSyncUpCron.java +++ b/plugin/src/main/java/org/opensearch/ml/cluster/MLSyncUpCron.java @@ -38,6 +38,7 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.sync.MLSyncUpAction; import org.opensearch.ml.common.transport.sync.MLSyncUpInput; import org.opensearch.ml.common.transport.sync.MLSyncUpNodeResponse; @@ -47,7 +48,6 @@ import org.opensearch.ml.common.transport.undeploy.MLUndeployModelsRequest; import org.opensearch.ml.engine.encryptor.Encryptor; import org.opensearch.ml.engine.indices.MLIndicesHandler; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.BulkDataObjectRequest; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.SearchDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/helper/ConnectorAccessControlHelper.java b/plugin/src/main/java/org/opensearch/ml/helper/ConnectorAccessControlHelper.java index aa29715fe2..722c94a857 100644 --- a/plugin/src/main/java/org/opensearch/ml/helper/ConnectorAccessControlHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/helper/ConnectorAccessControlHelper.java @@ -10,7 +10,7 @@ import static org.opensearch.common.xcontent.json.JsonXContent.jsonXContent; import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_CONNECTOR_INDEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; import static org.opensearch.ml.utils.RestActionUtils.getFetchSourceContext; import org.apache.lucene.search.join.ScoreMode; @@ -38,7 +38,7 @@ import org.opensearch.ml.common.CommonValue; import org.opensearch.ml.common.connector.AbstractConnector; import org.opensearch.ml.common.connector.Connector; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.MLNodeUtils; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.ml.utils.TenantAwareHelper; diff --git a/plugin/src/main/java/org/opensearch/ml/helper/ModelAccessControlHelper.java b/plugin/src/main/java/org/opensearch/ml/helper/ModelAccessControlHelper.java index b3caf23fc1..ac2cfded6c 100644 --- a/plugin/src/main/java/org/opensearch/ml/helper/ModelAccessControlHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/helper/ModelAccessControlHelper.java @@ -10,7 +10,7 @@ import static org.opensearch.common.xcontent.json.JsonXContent.jsonXContent; import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_MODEL_GROUP_INDEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_ACCESS_CONTROL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_ACCESS_CONTROL_ENABLED; import java.util.Collections; import java.util.HashSet; @@ -47,7 +47,7 @@ import org.opensearch.ml.common.MLModelGroup; import org.opensearch.ml.common.exception.MLResourceNotFoundException; import org.opensearch.ml.common.exception.MLValidationException; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.MLNodeUtils; import org.opensearch.ml.utils.TenantAwareHelper; import org.opensearch.remote.metadata.client.GetDataObjectRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java b/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java index 38c8a35e5d..7ba4a1318f 100644 --- a/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java @@ -5,7 +5,7 @@ package org.opensearch.ml.model; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MONITORING_REQUEST_COUNT; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MONITORING_REQUEST_COUNT; import java.time.Duration; import java.time.Instant; diff --git a/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java b/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java index e681a21fff..7e264d3347 100644 --- a/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java +++ b/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java @@ -35,10 +35,10 @@ import org.opensearch.ml.common.AccessMode; import org.opensearch.ml.common.MLModelGroup; import org.opensearch.ml.common.exception.MLResourceNotFoundException; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupInput; import org.opensearch.ml.engine.indices.MLIndicesHandler; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.RestActionUtils; import org.opensearch.remote.metadata.client.GetDataObjectRequest; import org.opensearch.remote.metadata.client.GetDataObjectResponse; diff --git a/plugin/src/main/java/org/opensearch/ml/model/MLModelManager.java b/plugin/src/main/java/org/opensearch/ml/model/MLModelManager.java index 79f2335279..38b6f564b9 100644 --- a/plugin/src/main/java/org/opensearch/ml/model/MLModelManager.java +++ b/plugin/src/main/java/org/opensearch/ml/model/MLModelManager.java @@ -22,6 +22,11 @@ import static org.opensearch.ml.common.MLTask.STATE_FIELD; import static org.opensearch.ml.common.MLTaskState.COMPLETED; import static org.opensearch.ml.common.MLTaskState.FAILED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INFERENCE_TASKS; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INGESTION_TASKS; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_DEPLOY_MODEL_TASKS_PER_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_MODELS_PER_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_REGISTER_MODEL_TASKS_PER_NODE; import static org.opensearch.ml.common.utils.StringUtils.getErrorMessage; import static org.opensearch.ml.engine.ModelHelper.CHUNK_FILES; import static org.opensearch.ml.engine.ModelHelper.CHUNK_SIZE; @@ -42,11 +47,6 @@ import static org.opensearch.ml.engine.utils.FileUtils.deleteFileQuietly; import static org.opensearch.ml.plugin.MachineLearningPlugin.DEPLOY_THREAD_POOL; import static org.opensearch.ml.plugin.MachineLearningPlugin.REGISTER_THREAD_POOL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INFERENCE_TASKS; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INGESTION_TASKS; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_DEPLOY_MODEL_TASKS_PER_NODE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_MODELS_PER_NODE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_REGISTER_MODEL_TASKS_PER_NODE; import static org.opensearch.ml.stats.ActionName.REGISTER; import static org.opensearch.ml.stats.MLActionLevelStat.ML_ACTION_REQUEST_COUNT; import static org.opensearch.ml.utils.MLExceptionUtils.CONTROLLER_DISABLED_ERR_MSG; @@ -123,6 +123,7 @@ import org.opensearch.ml.common.model.Guardrails; import org.opensearch.ml.common.model.MLGuard; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.deploy.MLDeployModelAction; import org.opensearch.ml.common.transport.deploy.MLDeployModelRequest; import org.opensearch.ml.common.transport.deploy.MLDeployModelResponse; @@ -136,7 +137,6 @@ import org.opensearch.ml.engine.indices.MLIndicesHandler; import org.opensearch.ml.engine.utils.FileUtils; import org.opensearch.ml.profile.MLModelProfile; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.stats.ActionName; import org.opensearch.ml.stats.MLActionLevelStat; import org.opensearch.ml.stats.MLNodeLevelStat; diff --git a/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java b/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java index d9323687c1..1623591a91 100644 --- a/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java +++ b/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java @@ -16,11 +16,11 @@ import static org.opensearch.ml.common.CommonValue.ML_STOP_WORDS_INDEX; import static org.opensearch.ml.common.CommonValue.ML_TASK_INDEX; import static org.opensearch.ml.common.CommonValue.TENANT_ID_FIELD; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.REMOTE_METADATA_ENDPOINT; -import static org.opensearch.ml.settings.MLCommonsSettings.REMOTE_METADATA_REGION; -import static org.opensearch.ml.settings.MLCommonsSettings.REMOTE_METADATA_SERVICE_NAME; -import static org.opensearch.ml.settings.MLCommonsSettings.REMOTE_METADATA_TYPE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.REMOTE_METADATA_ENDPOINT; +import static org.opensearch.ml.common.settings.MLCommonsSettings.REMOTE_METADATA_REGION; +import static org.opensearch.ml.common.settings.MLCommonsSettings.REMOTE_METADATA_SERVICE_NAME; +import static org.opensearch.ml.common.settings.MLCommonsSettings.REMOTE_METADATA_TYPE; import static org.opensearch.remote.metadata.common.CommonValue.REMOTE_METADATA_ENDPOINT_KEY; import static org.opensearch.remote.metadata.common.CommonValue.REMOTE_METADATA_REGION_KEY; import static org.opensearch.remote.metadata.common.CommonValue.REMOTE_METADATA_SERVICE_NAME_KEY; @@ -125,6 +125,8 @@ import org.opensearch.ml.common.input.parameter.sample.SampleAlgoParams; import org.opensearch.ml.common.input.parameter.textembedding.AsymmetricTextEmbeddingParameters; import org.opensearch.ml.common.model.TextEmbeddingModelConfig; +import org.opensearch.ml.common.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.spi.MLCommonsExtension; import org.opensearch.ml.common.spi.memory.Memory; import org.opensearch.ml.common.spi.tools.Tool; @@ -287,8 +289,6 @@ import org.opensearch.ml.rest.RestMemoryUpdateConversationAction; import org.opensearch.ml.rest.RestMemoryUpdateInteractionAction; import org.opensearch.ml.searchext.MLInferenceRequestParametersExtBuilder; -import org.opensearch.ml.settings.MLCommonsSettings; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.stats.MLClusterLevelStat; import org.opensearch.ml.stats.MLNodeLevelStat; import org.opensearch.ml.stats.MLStat; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/AbstractMLSearchAction.java b/plugin/src/main/java/org/opensearch/ml/rest/AbstractMLSearchAction.java index 3958c932c1..3bd5c3eab7 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/AbstractMLSearchAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/AbstractMLSearchAction.java @@ -18,8 +18,8 @@ import org.opensearch.action.search.SearchResponse; import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.ToXContentObject; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestChannel; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateConnectorAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateConnectorAction.java index 39a0d2b494..c41fe3784e 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateConnectorAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateConnectorAction.java @@ -15,10 +15,10 @@ import java.util.Locale; import org.opensearch.core.xcontent.XContentParser; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorAction; import org.opensearch.ml.common.transport.connector.MLCreateConnectorInput; import org.opensearch.ml.common.transport.connector.MLCreateConnectorRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateControllerAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateControllerAction.java index dc115bfe00..9f737f7451 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateControllerAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateControllerAction.java @@ -18,9 +18,9 @@ import org.opensearch.OpenSearchParseException; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.controller.MLController; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLCreateControllerAction; import org.opensearch.ml.common.transport.controller.MLCreateControllerRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteAgentAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteAgentAction.java index 17cd74bf4f..8eb358549b 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteAgentAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteAgentAction.java @@ -14,9 +14,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLAgentDeleteAction; import org.opensearch.ml.common.transport.agent.MLAgentDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteConnectorAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteConnectorAction.java index 10bb3b3018..cd50620e57 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteConnectorAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteConnectorAction.java @@ -13,9 +13,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorDeleteAction; import org.opensearch.ml.common.transport.connector.MLConnectorDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteControllerAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteControllerAction.java index 6458d69774..6e2cd5a00b 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteControllerAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteControllerAction.java @@ -13,9 +13,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLControllerDeleteAction; import org.opensearch.ml.common.transport.controller.MLControllerDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelAction.java index a9ed21517f..d982ec08cf 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelAction.java @@ -13,9 +13,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelDeleteAction; import org.opensearch.ml.common.transport.model.MLModelDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelGroupAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelGroupAction.java index a4fd4cb428..0a2f95f281 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelGroupAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelGroupAction.java @@ -13,9 +13,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupDeleteAction; import org.opensearch.ml.common.transport.model_group.MLModelGroupDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteTaskAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteTaskAction.java index 6227dd4337..a67db3ce8c 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteTaskAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteTaskAction.java @@ -13,9 +13,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.task.MLTaskDeleteAction; import org.opensearch.ml.common.transport.task.MLTaskDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeployModelAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeployModelAction.java index 35097bf9fe..ef0cbc013b 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeployModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeployModelAction.java @@ -15,9 +15,9 @@ import java.util.Locale; import org.opensearch.core.xcontent.XContentParser; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.deploy.MLDeployModelAction; import org.opensearch.ml.common.transport.deploy.MLDeployModelRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLExecuteAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLExecuteAction.java index fe4b776766..2ef12509c9 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLExecuteAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLExecuteAction.java @@ -28,12 +28,12 @@ import org.opensearch.ml.common.input.Input; import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.input.execute.agent.AgentMLInput; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.execute.MLExecuteTaskAction; import org.opensearch.ml.common.transport.execute.MLExecuteTaskRequest; import org.opensearch.ml.common.transport.execute.MLExecuteTaskResponse; import org.opensearch.ml.repackage.com.google.common.annotations.VisibleForTesting; import org.opensearch.ml.repackage.com.google.common.collect.ImmutableList; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.error.ErrorMessage; import org.opensearch.ml.utils.error.ErrorMessageFactory; import org.opensearch.rest.BaseRestHandler; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetAgentAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetAgentAction.java index 962496442b..fa7e8c2b4c 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetAgentAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetAgentAction.java @@ -15,9 +15,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLAgentGetAction; import org.opensearch.ml.common.transport.agent.MLAgentGetRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetConfigAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetConfigAction.java index a73b3dccc9..32c3368355 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetConfigAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetConfigAction.java @@ -15,9 +15,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.config.MLConfigGetAction; import org.opensearch.ml.common.transport.config.MLConfigGetRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetConnectorAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetConnectorAction.java index a77a9e70ac..29b117af6f 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetConnectorAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetConnectorAction.java @@ -17,9 +17,9 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Settings; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorGetAction; import org.opensearch.ml.common.transport.connector.MLConnectorGetRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetControllerAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetControllerAction.java index de17779ac7..1a1be29c21 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetControllerAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetControllerAction.java @@ -15,9 +15,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLControllerGetAction; import org.opensearch.ml.common.transport.controller.MLControllerGetRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelAction.java index 63f4ca7cf4..a886d58072 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelAction.java @@ -15,9 +15,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelGetAction; import org.opensearch.ml.common.transport.model.MLModelGetRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelGroupAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelGroupAction.java index b33b641b52..2c6751e984 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelGroupAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelGroupAction.java @@ -14,9 +14,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetAction; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetTaskAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetTaskAction.java index 7ed9581298..626a30d845 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetTaskAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetTaskAction.java @@ -14,9 +14,9 @@ import java.util.List; import java.util.Locale; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.task.MLTaskGetAction; import org.opensearch.ml.common.transport.task.MLTaskGetRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLPredictionAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLPredictionAction.java index e0e028d9f0..09feffb987 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLPredictionAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLPredictionAction.java @@ -30,10 +30,10 @@ import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.connector.ConnectorAction.ActionType; import org.opensearch.ml.common.input.MLInput; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.prediction.MLPredictionTaskAction; import org.opensearch.ml.common.transport.prediction.MLPredictionTaskRequest; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterAgentAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterAgentAction.java index d9d22516b7..84b1ca7dab 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterAgentAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterAgentAction.java @@ -16,9 +16,9 @@ import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.agent.MLAgent; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLRegisterAgentAction; import org.opensearch.ml.common.transport.agent.MLRegisterAgentRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelAction.java index e2fbc3f88f..acd77b8524 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelAction.java @@ -22,10 +22,10 @@ import org.opensearch.common.settings.Settings; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.FunctionName; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.register.MLRegisterModelAction; import org.opensearch.ml.common.transport.register.MLRegisterModelInput; import org.opensearch.ml.common.transport.register.MLRegisterModelRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelGroupAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelGroupAction.java index eafc1c7fed..8ceeace30a 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelGroupAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelGroupAction.java @@ -15,10 +15,10 @@ import org.opensearch.OpenSearchParseException; import org.opensearch.core.xcontent.XContentParser; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupAction; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupInput; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelMetaAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelMetaAction.java index e336e9f8ec..1a0b6673a9 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelMetaAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelMetaAction.java @@ -6,8 +6,8 @@ package org.opensearch.ml.rest; import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_LOCAL_FILE_UPLOAD; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_LOCAL_FILE_UPLOAD; import java.io.IOException; import java.util.List; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchAgentAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchAgentAction.java index be3df692ce..eae8c13cca 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchAgentAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchAgentAction.java @@ -12,9 +12,9 @@ import java.io.IOException; import org.opensearch.ml.common.agent.MLAgent; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLSearchAgentAction; import org.opensearch.ml.repackage.com.google.common.collect.ImmutableList; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestRequest; import org.opensearch.transport.client.node.NodeClient; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchConnectorAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchConnectorAction.java index c8f9afcb9c..57991bf4b4 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchConnectorAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchConnectorAction.java @@ -9,8 +9,8 @@ import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import org.opensearch.ml.common.connector.Connector; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorSearchAction; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchModelAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchModelAction.java index a61f25e68b..52c672c38e 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchModelAction.java @@ -9,8 +9,8 @@ import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import org.opensearch.ml.common.MLModel; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelSearchAction; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchModelGroupAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchModelGroupAction.java index c4f5b5f48e..9d60040ba8 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchModelGroupAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchModelGroupAction.java @@ -9,8 +9,8 @@ import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import org.opensearch.ml.common.MLModelGroup; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupSearchAction; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchTaskAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchTaskAction.java index 70bf4f7894..c6a0855455 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchTaskAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchTaskAction.java @@ -9,8 +9,8 @@ import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import org.opensearch.ml.common.MLTask; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.task.MLTaskSearchAction; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUndeployModelAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUndeployModelAction.java index a421ed3e31..eb2b633c65 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUndeployModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUndeployModelAction.java @@ -6,8 +6,8 @@ package org.opensearch.ml.rest; import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_ID; import static org.opensearch.ml.utils.RestActionUtils.getAllNodes; import static org.opensearch.ml.utils.TenantAwareHelper.getTenantID; @@ -20,10 +20,10 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Settings; import org.opensearch.core.xcontent.XContentParser; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelInput; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelsAction; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelsRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateConnectorAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateConnectorAction.java index 4b798c1270..7693b02fab 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateConnectorAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateConnectorAction.java @@ -18,9 +18,9 @@ import org.opensearch.OpenSearchParseException; import org.opensearch.core.xcontent.XContentParser; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLUpdateConnectorAction; import org.opensearch.ml.common.transport.connector.MLUpdateConnectorRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateControllerAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateControllerAction.java index 5c8204c107..16f25858c2 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateControllerAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateControllerAction.java @@ -18,9 +18,9 @@ import org.opensearch.OpenSearchParseException; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.controller.MLController; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLUpdateControllerAction; import org.opensearch.ml.common.transport.controller.MLUpdateControllerRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelAction.java index c9b3a1074a..0bc4255299 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelAction.java @@ -19,10 +19,10 @@ import org.opensearch.OpenSearchStatusException; import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.XContentParser; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLUpdateModelAction; import org.opensearch.ml.common.transport.model.MLUpdateModelInput; import org.opensearch.ml.common.transport.model.MLUpdateModelRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelGroupAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelGroupAction.java index 3e4148ce1d..546a51e82b 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelGroupAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelGroupAction.java @@ -16,10 +16,10 @@ import java.util.Locale; import org.opensearch.core.xcontent.XContentParser; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupAction; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupInput; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUploadModelChunkAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUploadModelChunkAction.java index 35a9870444..66b9e0c419 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUploadModelChunkAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUploadModelChunkAction.java @@ -5,8 +5,8 @@ package org.opensearch.ml.rest; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_LOCAL_FILE_UPLOAD; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_LOCAL_FILE_UPLOAD; import java.io.IOException; import java.util.List; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMemorySearchConversationsAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMemorySearchConversationsAction.java index 02c2ba8c70..2696ef5fca 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMemorySearchConversationsAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMemorySearchConversationsAction.java @@ -20,8 +20,8 @@ import org.opensearch.ml.common.conversation.ActionConstants; import org.opensearch.ml.common.conversation.ConversationMeta; import org.opensearch.ml.common.conversation.ConversationalIndexConstants; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.memory.action.conversation.SearchConversationsAction; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/main/java/org/opensearch/ml/task/MLExecuteTaskRunner.java b/plugin/src/main/java/org/opensearch/ml/task/MLExecuteTaskRunner.java index c575c1697d..8689e2081e 100644 --- a/plugin/src/main/java/org/opensearch/ml/task/MLExecuteTaskRunner.java +++ b/plugin/src/main/java/org/opensearch/ml/task/MLExecuteTaskRunner.java @@ -5,8 +5,8 @@ package org.opensearch.ml.task; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ENABLE_INHOUSE_PYTHON_MODEL; import static org.opensearch.ml.plugin.MachineLearningPlugin.EXECUTE_THREAD_POOL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ENABLE_INHOUSE_PYTHON_MODEL; import org.opensearch.action.ActionListenerResponseHandler; import org.opensearch.cluster.service.ClusterService; diff --git a/plugin/src/main/java/org/opensearch/ml/task/MLPredictTaskRunner.java b/plugin/src/main/java/org/opensearch/ml/task/MLPredictTaskRunner.java index 99d903ba2f..db08bab1a1 100644 --- a/plugin/src/main/java/org/opensearch/ml/task/MLPredictTaskRunner.java +++ b/plugin/src/main/java/org/opensearch/ml/task/MLPredictTaskRunner.java @@ -9,12 +9,12 @@ import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; import static org.opensearch.ml.common.CommonValue.TASK_POLLING_JOB_INDEX; import static org.opensearch.ml.common.MLModel.ALGORITHM_FIELD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_DEPLOY_ENABLE; import static org.opensearch.ml.common.utils.StringUtils.getErrorMessage; import static org.opensearch.ml.permission.AccessController.checkUserPermissions; import static org.opensearch.ml.permission.AccessController.getUserContext; import static org.opensearch.ml.plugin.MachineLearningPlugin.PREDICT_THREAD_POOL; import static org.opensearch.ml.plugin.MachineLearningPlugin.REMOTE_PREDICT_THREAD_POOL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_DEPLOY_ENABLE; import static org.opensearch.ml.utils.MLExceptionUtils.logException; import java.time.Instant; diff --git a/plugin/src/main/java/org/opensearch/ml/task/MLTaskDispatcher.java b/plugin/src/main/java/org/opensearch/ml/task/MLTaskDispatcher.java index d522da8585..a16e6e9242 100644 --- a/plugin/src/main/java/org/opensearch/ml/task/MLTaskDispatcher.java +++ b/plugin/src/main/java/org/opensearch/ml/task/MLTaskDispatcher.java @@ -5,8 +5,8 @@ package org.opensearch.ml.task; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_ML_TASK_PER_NODE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TASK_DISPATCH_POLICY; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_ML_TASK_PER_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TASK_DISPATCH_POLICY; import java.util.List; import java.util.Optional; diff --git a/plugin/src/main/java/org/opensearch/ml/utils/TenantAwareHelper.java b/plugin/src/main/java/org/opensearch/ml/utils/TenantAwareHelper.java index 12bdddb62f..9cba766422 100644 --- a/plugin/src/main/java/org/opensearch/ml/utils/TenantAwareHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/utils/TenantAwareHelper.java @@ -18,7 +18,7 @@ import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.TermQueryBuilder; import org.opensearch.ml.common.input.Constants; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestRequest; import org.opensearch.search.builder.SearchSourceBuilder; diff --git a/plugin/src/test/java/org/opensearch/ml/action/MLCommonsIntegTestCase.java b/plugin/src/test/java/org/opensearch/ml/action/MLCommonsIntegTestCase.java index a2892e0ea4..d8a7c25574 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/MLCommonsIntegTestCase.java +++ b/plugin/src/test/java/org/opensearch/ml/action/MLCommonsIntegTestCase.java @@ -6,8 +6,8 @@ package org.opensearch.ml.action; import static org.opensearch.ml.common.input.parameter.regression.LogisticRegressionParams.ObjectiveType.LOGMULTICLASS; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; import static org.opensearch.ml.utils.RestActionUtils.getAllNodes; import static org.opensearch.ml.utils.TestData.TARGET_FIELD; import static org.opensearch.ml.utils.TestData.TIME_FIELD; diff --git a/plugin/src/test/java/org/opensearch/ml/action/agents/DeleteAgentTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/agents/DeleteAgentTransportActionTests.java index dcd2315121..63fd5216e2 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/agents/DeleteAgentTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/agents/DeleteAgentTransportActionTests.java @@ -45,8 +45,8 @@ import org.opensearch.ml.common.agent.MLAgent; import org.opensearch.ml.common.agent.MLMemorySpec; import org.opensearch.ml.common.agent.MLToolSpec; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLAgentDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; diff --git a/plugin/src/test/java/org/opensearch/ml/action/agents/GetAgentTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/agents/GetAgentTransportActionTests.java index a932cebc58..8a5e081855 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/agents/GetAgentTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/agents/GetAgentTransportActionTests.java @@ -45,9 +45,9 @@ import org.opensearch.ml.common.agent.MLAgent; import org.opensearch.ml.common.agent.MLMemorySpec; import org.opensearch.ml.common.agent.MLToolSpec; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLAgentGetRequest; import org.opensearch.ml.common.transport.agent.MLAgentGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; diff --git a/plugin/src/test/java/org/opensearch/ml/action/agents/RegisterAgentTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/agents/RegisterAgentTransportActionTests.java index 91ed36937d..cfbb50f4ae 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/agents/RegisterAgentTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/agents/RegisterAgentTransportActionTests.java @@ -37,10 +37,10 @@ import org.opensearch.ml.common.MLAgentType; import org.opensearch.ml.common.agent.LLMSpec; import org.opensearch.ml.common.agent.MLAgent; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLRegisterAgentRequest; import org.opensearch.ml.common.transport.agent.MLRegisterAgentResponse; import org.opensearch.ml.engine.indices.MLIndicesHandler; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; diff --git a/plugin/src/test/java/org/opensearch/ml/action/agents/TransportSearchAgentActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/agents/TransportSearchAgentActionTests.java index 675e2bf3d9..49e1e0b94a 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/agents/TransportSearchAgentActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/agents/TransportSearchAgentActionTests.java @@ -28,8 +28,8 @@ import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.index.query.QueryBuilders; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.search.SearchHit; diff --git a/plugin/src/test/java/org/opensearch/ml/action/batch/TransportBatchIngestionActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/batch/TransportBatchIngestionActionTests.java index 8abf8b3f0a..5306e66eae 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/batch/TransportBatchIngestionActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/batch/TransportBatchIngestionActionTests.java @@ -20,10 +20,10 @@ import static org.opensearch.ml.common.MLTask.STATE_FIELD; import static org.opensearch.ml.common.MLTaskState.COMPLETED; import static org.opensearch.ml.common.MLTaskState.FAILED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_BATCH_INGESTION_BULK_SIZE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INGESTION_TASKS; import static org.opensearch.ml.engine.ingest.S3DataIngestion.SOURCE; import static org.opensearch.ml.plugin.MachineLearningPlugin.INGEST_THREAD_POOL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_BATCH_INGESTION_BULK_SIZE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INGESTION_TASKS; import static org.opensearch.ml.task.MLTaskManager.TASK_SEMAPHORE_TIMEOUT; import static org.opensearch.ml.utils.TestHelper.clusterSetting; @@ -48,11 +48,11 @@ import org.opensearch.core.index.shard.ShardId; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.MLTask; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.batch.MLBatchIngestionInput; import org.opensearch.ml.common.transport.batch.MLBatchIngestionRequest; import org.opensearch.ml.common.transport.batch.MLBatchIngestionResponse; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; diff --git a/plugin/src/test/java/org/opensearch/ml/action/config/GetConfigTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/config/GetConfigTransportActionTests.java index bbb91664bd..b98c48fdb3 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/config/GetConfigTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/config/GetConfigTransportActionTests.java @@ -40,9 +40,9 @@ import org.opensearch.index.get.GetResult; import org.opensearch.ml.common.Configuration; import org.opensearch.ml.common.MLConfig; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.config.MLConfigGetRequest; import org.opensearch.ml.common.transport.config.MLConfigGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; diff --git a/plugin/src/test/java/org/opensearch/ml/action/connector/DeleteConnectorTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/connector/DeleteConnectorTransportActionTests.java index 196ec5a336..7540b2c3f4 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/connector/DeleteConnectorTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/connector/DeleteConnectorTransportActionTests.java @@ -45,9 +45,9 @@ import org.opensearch.index.get.GetResult; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.connector.HttpConnector; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorDeleteRequest; import org.opensearch.ml.helper.ConnectorAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/action/connector/GetConnectorTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/connector/GetConnectorTransportActionTests.java index 9da7febd84..dea4140c40 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/connector/GetConnectorTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/connector/GetConnectorTransportActionTests.java @@ -36,10 +36,10 @@ import org.opensearch.index.get.GetResult; import org.opensearch.ml.common.connector.Connector; import org.opensearch.ml.common.connector.HttpConnector; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorGetRequest; import org.opensearch.ml.common.transport.connector.MLConnectorGetResponse; import org.opensearch.ml.helper.ConnectorAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.GetDataObjectRequest; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/action/connector/SearchConnectorTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/connector/SearchConnectorTransportActionTests.java index 3b10102a38..ad31244915 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/connector/SearchConnectorTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/connector/SearchConnectorTransportActionTests.java @@ -31,9 +31,9 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.helper.ConnectorAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.search.SearchHit; diff --git a/plugin/src/test/java/org/opensearch/ml/action/connector/TransportCreateConnectorActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/connector/TransportCreateConnectorActionTests.java index 083e7d9557..f4656e9b8a 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/connector/TransportCreateConnectorActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/connector/TransportCreateConnectorActionTests.java @@ -12,9 +12,9 @@ import static org.mockito.Mockito.when; import static org.opensearch.ml.common.CommonValue.ML_COMMONS_MCP_FEATURE_DISABLED_MESSAGE; import static org.opensearch.ml.common.CommonValue.ML_CONNECTOR_INDEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.REKOGNITION_TRUST_ENDPOINT_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.REKOGNITION_TRUST_ENDPOINT_REGEX; import static org.opensearch.ml.task.MLPredictTaskRunnerTests.USER_STRING; import static org.opensearch.ml.utils.TestHelper.clusterSetting; @@ -46,6 +46,7 @@ import org.opensearch.ml.common.CommonValue; import org.opensearch.ml.common.connector.ConnectorAction; import org.opensearch.ml.common.connector.ConnectorProtocols; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorInput; import org.opensearch.ml.common.transport.connector.MLCreateConnectorRequest; import org.opensearch.ml.common.transport.connector.MLCreateConnectorResponse; @@ -53,7 +54,6 @@ import org.opensearch.ml.engine.indices.MLIndicesHandler; import org.opensearch.ml.helper.ConnectorAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.PutDataObjectRequest; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/action/connector/UpdateConnectorTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/connector/UpdateConnectorTransportActionTests.java index ef27f4c38d..2926f831e8 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/connector/UpdateConnectorTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/connector/UpdateConnectorTransportActionTests.java @@ -7,8 +7,8 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.io.IOException; @@ -47,6 +47,7 @@ import org.opensearch.ml.common.connector.Connector; import org.opensearch.ml.common.connector.ConnectorAction; import org.opensearch.ml.common.connector.HttpConnector; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorInput; import org.opensearch.ml.common.transport.connector.MLUpdateConnectorRequest; import org.opensearch.ml.engine.MLEngine; @@ -54,7 +55,6 @@ import org.opensearch.ml.engine.encryptor.EncryptorImpl; import org.opensearch.ml.helper.ConnectorAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/action/controller/CreateControllerTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/controller/CreateControllerTransportActionTests.java index 3d2e210e99..61c0282ac2 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/controller/CreateControllerTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/controller/CreateControllerTransportActionTests.java @@ -48,6 +48,7 @@ import org.opensearch.ml.common.controller.MLController; import org.opensearch.ml.common.controller.MLRateLimiter; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLCreateControllerRequest; import org.opensearch.ml.common.transport.controller.MLCreateControllerResponse; import org.opensearch.ml.common.transport.controller.MLDeployControllerAction; @@ -56,7 +57,6 @@ import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelCacheHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; diff --git a/plugin/src/test/java/org/opensearch/ml/action/controller/DeleteControllerTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/controller/DeleteControllerTransportActionTests.java index 229f0d2a5a..52bbfdad3d 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/controller/DeleteControllerTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/controller/DeleteControllerTransportActionTests.java @@ -47,13 +47,13 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.controller.MLController; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLControllerDeleteRequest; import org.opensearch.ml.common.transport.controller.MLUndeployControllerAction; import org.opensearch.ml.common.transport.controller.MLUndeployControllerNodesResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelCacheHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; diff --git a/plugin/src/test/java/org/opensearch/ml/action/controller/GetControllerTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/controller/GetControllerTransportActionTests.java index 275f5fac06..f414572b02 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/controller/GetControllerTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/controller/GetControllerTransportActionTests.java @@ -41,11 +41,11 @@ import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.controller.MLController; import org.opensearch.ml.common.controller.MLRateLimiter; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLControllerGetRequest; import org.opensearch.ml.common.transport.controller.MLControllerGetResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; diff --git a/plugin/src/test/java/org/opensearch/ml/action/controller/UpdateControllerTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/controller/UpdateControllerTransportActionTests.java index 99e8006d81..2bdef9c022 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/controller/UpdateControllerTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/controller/UpdateControllerTransportActionTests.java @@ -51,13 +51,13 @@ import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.controller.MLController; import org.opensearch.ml.common.controller.MLRateLimiter; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLDeployControllerAction; import org.opensearch.ml.common.transport.controller.MLDeployControllerNodesResponse; import org.opensearch.ml.common.transport.controller.MLUpdateControllerRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelCacheHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; diff --git a/plugin/src/test/java/org/opensearch/ml/action/deploy/TransportDeployModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/deploy/TransportDeployModelActionTests.java index f4bb39a75b..deb8c054af 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/deploy/TransportDeployModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/deploy/TransportDeployModelActionTests.java @@ -21,7 +21,7 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; import static org.opensearch.ml.utils.MLExceptionUtils.LOCAL_MODEL_DISABLED_ERR_MSG; import static org.opensearch.ml.utils.MLExceptionUtils.REMOTE_INFERENCE_DISABLED_ERR_MSG; @@ -60,6 +60,7 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.MLTask; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.deploy.MLDeployModelNodesResponse; import org.opensearch.ml.common.transport.deploy.MLDeployModelRequest; import org.opensearch.ml.common.transport.deploy.MLDeployModelResponse; @@ -69,7 +70,6 @@ import org.opensearch.ml.engine.encryptor.EncryptorImpl; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.stats.MLNodeLevelStat; import org.opensearch.ml.stats.MLStat; import org.opensearch.ml.stats.MLStats; diff --git a/plugin/src/test/java/org/opensearch/ml/action/deploy/TransportDeployModelOnNodeActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/deploy/TransportDeployModelOnNodeActionTests.java index 731b095a98..e1fc275334 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/deploy/TransportDeployModelOnNodeActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/deploy/TransportDeployModelOnNodeActionTests.java @@ -13,7 +13,7 @@ import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.when; import static org.opensearch.cluster.node.DiscoveryNodeRole.CLUSTER_MANAGER_ROLE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_DEPLOY_MODEL_TASKS_PER_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_DEPLOY_MODEL_TASKS_PER_NODE; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.io.IOException; diff --git a/plugin/src/test/java/org/opensearch/ml/action/forward/TransportForwardActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/forward/TransportForwardActionTests.java index f66815177a..84e2b30fef 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/forward/TransportForwardActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/forward/TransportForwardActionTests.java @@ -20,13 +20,13 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opensearch.ml.common.MLTaskState.FAILED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_ENABLE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_LIFETIME_RETRY_TIMES; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_SUCCESS_RATIO; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; import static org.opensearch.ml.common.transport.forward.MLForwardRequestType.DEPLOY_MODEL_DONE; import static org.opensearch.ml.common.transport.forward.MLForwardRequestType.REGISTER_MODEL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_ENABLE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_LIFETIME_RETRY_TIMES; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_REDEPLOY_SUCCESS_RATIO; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; import static org.opensearch.ml.utils.TestHelper.ML_ROLE; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import static org.opensearch.ml.utils.TestHelper.setupTestClusterState; @@ -59,6 +59,7 @@ import org.opensearch.ml.common.MLTaskType; import org.opensearch.ml.common.model.MLModelFormat; import org.opensearch.ml.common.model.TextEmbeddingModelConfig; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.forward.MLForwardInput; import org.opensearch.ml.common.transport.forward.MLForwardRequest; import org.opensearch.ml.common.transport.forward.MLForwardResponse; @@ -66,7 +67,6 @@ import org.opensearch.ml.common.transport.sync.MLSyncUpAction; import org.opensearch.ml.common.transport.sync.MLSyncUpNodesRequest; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskCache; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.remote.metadata.client.SdkClient; diff --git a/plugin/src/test/java/org/opensearch/ml/action/model_group/DeleteModelGroupTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/model_group/DeleteModelGroupTransportActionTests.java index 25e7d198c0..0bf67454b9 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/model_group/DeleteModelGroupTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/model_group/DeleteModelGroupTransportActionTests.java @@ -39,9 +39,9 @@ import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.index.IndexNotFoundException; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupDeleteRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/action/model_group/GetModelGroupTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/model_group/GetModelGroupTransportActionTests.java index 0e9c7cd941..aa2ceb20ce 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/model_group/GetModelGroupTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/model_group/GetModelGroupTransportActionTests.java @@ -37,10 +37,10 @@ import org.opensearch.index.IndexNotFoundException; import org.opensearch.index.get.GetResult; import org.opensearch.ml.common.MLModelGroup; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetRequest; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.test.OpenSearchTestCase; diff --git a/plugin/src/test/java/org/opensearch/ml/action/model_group/SearchModelGroupTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/model_group/SearchModelGroupTransportActionTests.java index 44c1e0f083..f6aac6ec92 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/model_group/SearchModelGroupTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/model_group/SearchModelGroupTransportActionTests.java @@ -32,9 +32,9 @@ import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.index.query.QueryBuilders; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.search.SearchHit; diff --git a/plugin/src/test/java/org/opensearch/ml/action/model_group/TransportRegisterModelGroupActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/model_group/TransportRegisterModelGroupActionTests.java index 4a514fc13a..e57970ba88 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/model_group/TransportRegisterModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/model_group/TransportRegisterModelGroupActionTests.java @@ -29,13 +29,13 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.AccessMode; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupInput; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupRequest; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupResponse; import org.opensearch.ml.engine.indices.MLIndicesHandler; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelGroupManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; diff --git a/plugin/src/test/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupActionTests.java index 41a34ceaeb..c62716d793 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupActionTests.java @@ -44,12 +44,12 @@ import org.opensearch.ml.common.MLModelGroup; import org.opensearch.ml.common.exception.MLException; import org.opensearch.ml.common.exception.MLResourceNotFoundException; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupInput; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupRequest; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelGroupManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/action/models/DeleteModelTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/models/DeleteModelTransportActionTests.java index 7f0bdb23aa..2f91a1837c 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/models/DeleteModelTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/models/DeleteModelTransportActionTests.java @@ -20,7 +20,7 @@ import static org.opensearch.ml.action.models.DeleteModelTransportAction.SEARCH_FAILURE_MSG; import static org.opensearch.ml.action.models.DeleteModelTransportAction.TIMEOUT_MSG; import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; -import static org.opensearch.ml.settings.MLCommonsSettings.*; +import static org.opensearch.ml.common.settings.MLCommonsSettings.*; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.io.IOException; @@ -75,12 +75,12 @@ import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.agent.MLAgent; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelDeleteRequest; import org.opensearch.ml.common.utils.StringUtils; import org.opensearch.ml.engine.utils.AgentModelsSearcher; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.search.SearchHit; diff --git a/plugin/src/test/java/org/opensearch/ml/action/models/GetModelTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/models/GetModelTransportActionTests.java index 6648e2ff49..e534e26505 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/models/GetModelTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/models/GetModelTransportActionTests.java @@ -40,10 +40,10 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelGetRequest; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.test.OpenSearchTestCase; diff --git a/plugin/src/test/java/org/opensearch/ml/action/models/SearchModelITTests.java b/plugin/src/test/java/org/opensearch/ml/action/models/SearchModelITTests.java index acbf91b475..385d0ba39b 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/models/SearchModelITTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/models/SearchModelITTests.java @@ -5,7 +5,7 @@ package org.opensearch.ml.action.models; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL; import org.junit.Before; import org.junit.Rule; diff --git a/plugin/src/test/java/org/opensearch/ml/action/models/SearchModelTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/models/SearchModelTransportActionTests.java index 3a6fe63c9d..d1a0279bb6 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/models/SearchModelTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/models/SearchModelTransportActionTests.java @@ -46,9 +46,9 @@ import org.opensearch.index.query.QueryBuilders; import org.opensearch.ml.action.handler.MLSearchHandler; import org.opensearch.ml.common.exception.MLResourceNotFoundException; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/action/models/UpdateModelTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/models/UpdateModelTransportActionTests.java index 79da4432c8..ab30855a2e 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/models/UpdateModelTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/models/UpdateModelTransportActionTests.java @@ -16,8 +16,8 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opensearch.cluster.node.DiscoveryNodeRole.CLUSTER_MANAGER_ROLE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_ACCESS_CONTROL_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_ACCESS_CONTROL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.io.IOException; @@ -76,6 +76,7 @@ import org.opensearch.ml.common.controller.MLRateLimiter; import org.opensearch.ml.common.exception.MLResourceNotFoundException; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorInput; import org.opensearch.ml.common.transport.model.MLUpdateModelInput; import org.opensearch.ml.common.transport.model.MLUpdateModelRequest; @@ -85,7 +86,6 @@ import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelGroupManager; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.tasks.Task; diff --git a/plugin/src/test/java/org/opensearch/ml/action/prediction/PredictionITTests.java b/plugin/src/test/java/org/opensearch/ml/action/prediction/PredictionITTests.java index 8bf8d10b47..03ec91b013 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/prediction/PredictionITTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/prediction/PredictionITTests.java @@ -5,7 +5,7 @@ package org.opensearch.ml.action.prediction; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_SYNC_UP_JOB_INTERVAL_IN_SECONDS; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_SYNC_UP_JOB_INTERVAL_IN_SECONDS; import static org.opensearch.ml.utils.TestData.IRIS_DATA_SIZE; import static org.opensearch.ml.utils.TestData.TIME_FIELD; diff --git a/plugin/src/test/java/org/opensearch/ml/action/prediction/TransportPredictionTaskActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/prediction/TransportPredictionTaskActionTests.java index 2b253a60b5..9b1036f731 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/prediction/TransportPredictionTaskActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/prediction/TransportPredictionTaskActionTests.java @@ -11,7 +11,7 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_DEPLOY_ENABLE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_DEPLOY_ENABLE; import static org.opensearch.ml.utils.MLExceptionUtils.LOCAL_MODEL_DISABLED_ERR_MSG; import java.util.Arrays; @@ -48,12 +48,12 @@ import org.opensearch.ml.common.exception.MLResourceNotFoundException; import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.input.parameter.clustering.KMeansParams; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.MLTaskResponse; import org.opensearch.ml.common.transport.prediction.MLPredictionTaskRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelCacheHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLPredictTaskRunner; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/action/profile/MLProfileTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/profile/MLProfileTransportActionTests.java index b58b2ae48e..9cf42072d2 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/profile/MLProfileTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/profile/MLProfileTransportActionTests.java @@ -8,7 +8,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.opensearch.cluster.node.DiscoveryNodeRole.CLUSTER_MANAGER_ROLE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; import java.io.IOException; import java.net.InetAddress; diff --git a/plugin/src/test/java/org/opensearch/ml/action/register/TransportRegisterModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/register/TransportRegisterModelActionTests.java index 343464d25b..38c3e719d5 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/register/TransportRegisterModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/register/TransportRegisterModelActionTests.java @@ -14,9 +14,9 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_URL_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_TRUSTED_URL_REGEX; import static org.opensearch.ml.utils.MLExceptionUtils.LOCAL_MODEL_DISABLED_ERR_MSG; import static org.opensearch.ml.utils.TestHelper.clusterSetting; @@ -51,6 +51,7 @@ import org.opensearch.ml.common.connector.Connector; import org.opensearch.ml.common.model.MLModelFormat; import org.opensearch.ml.common.model.TextEmbeddingModelConfig; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorAction; import org.opensearch.ml.common.transport.connector.MLCreateConnectorResponse; import org.opensearch.ml.common.transport.forward.MLForwardResponse; @@ -63,7 +64,6 @@ import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelGroupManager; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.stats.MLNodeLevelStat; import org.opensearch.ml.stats.MLStat; import org.opensearch.ml.stats.MLStats; diff --git a/plugin/src/test/java/org/opensearch/ml/action/syncup/TransportSyncUpOnNodeActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/syncup/TransportSyncUpOnNodeActionTests.java index 166cff09cf..51561d66d2 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/syncup/TransportSyncUpOnNodeActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/syncup/TransportSyncUpOnNodeActionTests.java @@ -16,8 +16,8 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opensearch.cluster.node.DiscoveryNodeRole.CLUSTER_MANAGER_ROLE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ML_TASK_TIMEOUT_IN_SECONDS; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ML_TASK_TIMEOUT_IN_SECONDS; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; import static org.opensearch.ml.utils.TestHelper.ML_ROLE; import static org.opensearch.ml.utils.TestHelper.clusterSetting; diff --git a/plugin/src/test/java/org/opensearch/ml/action/tasks/CancelBatchJobTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/tasks/CancelBatchJobTransportActionTests.java index 1757e577a7..88ae44c70b 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/tasks/CancelBatchJobTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/tasks/CancelBatchJobTransportActionTests.java @@ -55,13 +55,13 @@ import org.opensearch.ml.common.output.model.ModelTensor; import org.opensearch.ml.common.output.model.ModelTensorOutput; import org.opensearch.ml.common.output.model.ModelTensors; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.task.MLCancelBatchJobRequest; import org.opensearch.ml.common.transport.task.MLCancelBatchJobResponse; import org.opensearch.ml.engine.encryptor.EncryptorImpl; import org.opensearch.ml.helper.ConnectorAccessControlHelper; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.script.ScriptService; import org.opensearch.test.OpenSearchTestCase; diff --git a/plugin/src/test/java/org/opensearch/ml/action/tasks/DeleteTaskTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/tasks/DeleteTaskTransportActionTests.java index 8e17644d4e..8adb863444 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/tasks/DeleteTaskTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/tasks/DeleteTaskTransportActionTests.java @@ -41,8 +41,8 @@ import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.MLTaskState; import org.opensearch.ml.common.exception.MLResourceNotFoundException; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.task.MLTaskDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.test.OpenSearchTestCase; diff --git a/plugin/src/test/java/org/opensearch/ml/action/tasks/GetTaskTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/tasks/GetTaskTransportActionTests.java index b8cbc1ae86..ca511306a4 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/tasks/GetTaskTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/tasks/GetTaskTransportActionTests.java @@ -19,12 +19,12 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; import static org.opensearch.ml.common.CommonValue.ML_TASK_INDEX; import static org.opensearch.ml.common.connector.AbstractConnector.*; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_CANCELLED_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_CANCELLING_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_COMPLETED_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_EXPIRED_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_FAILED_REGEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_FIELD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_CANCELLED_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_CANCELLING_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_COMPLETED_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_EXPIRED_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_FAILED_REGEX; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_JOB_STATUS_FIELD; import java.io.IOException; import java.util.Arrays; @@ -70,6 +70,7 @@ import org.opensearch.ml.common.output.model.ModelTensor; import org.opensearch.ml.common.output.model.ModelTensorOutput; import org.opensearch.ml.common.output.model.ModelTensors; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.MLTaskResponse; import org.opensearch.ml.common.transport.task.MLTaskGetRequest; import org.opensearch.ml.common.transport.task.MLTaskGetResponse; @@ -78,7 +79,6 @@ import org.opensearch.ml.helper.ConnectorAccessControlHelper; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/action/tasks/SearchTaskTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/tasks/SearchTaskTransportActionTests.java index eb2d0f147f..1fe66e827f 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/tasks/SearchTaskTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/tasks/SearchTaskTransportActionTests.java @@ -26,9 +26,9 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.action.ActionListener; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.search.SearchHit; diff --git a/plugin/src/test/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsActionTests.java index 14d47ae10c..72af11264d 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsActionTests.java @@ -50,6 +50,7 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelNodeResponse; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelNodesResponse; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelsRequest; @@ -57,7 +58,6 @@ import org.opensearch.ml.engine.ModelHelper; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.task.MLTaskDispatcher; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.remote.metadata.client.SdkClient; diff --git a/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerTests.java b/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerTests.java index 5ee85e16d7..6c7fa1485f 100644 --- a/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerTests.java @@ -9,7 +9,7 @@ import static org.mockito.Mockito.*; import static org.opensearch.cluster.node.DiscoveryNodeRole.CLUSTER_MANAGER_ROLE; -import static org.opensearch.ml.settings.MLCommonsSettings.*; +import static org.opensearch.ml.common.settings.MLCommonsSettings.*; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.io.IOException; diff --git a/plugin/src/test/java/org/opensearch/ml/breaker/DiskCircuitBreakerTests.java b/plugin/src/test/java/org/opensearch/ml/breaker/DiskCircuitBreakerTests.java index 7eab9d63e8..e1ae9a1f15 100644 --- a/plugin/src/test/java/org/opensearch/ml/breaker/DiskCircuitBreakerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/breaker/DiskCircuitBreakerTests.java @@ -6,7 +6,7 @@ package org.opensearch.ml.breaker; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_DISK_FREE_SPACE_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_DISK_FREE_SPACE_THRESHOLD; import java.io.File; import java.util.HashSet; diff --git a/plugin/src/test/java/org/opensearch/ml/breaker/MLCircuitBreakerServiceTests.java b/plugin/src/test/java/org/opensearch/ml/breaker/MLCircuitBreakerServiceTests.java index 76f371004e..9279b66ca9 100644 --- a/plugin/src/test/java/org/opensearch/ml/breaker/MLCircuitBreakerServiceTests.java +++ b/plugin/src/test/java/org/opensearch/ml/breaker/MLCircuitBreakerServiceTests.java @@ -6,9 +6,9 @@ package org.opensearch.ml.breaker; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_DISK_FREE_SPACE_THRESHOLD; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_JVM_HEAP_MEM_THRESHOLD; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_DISK_FREE_SPACE_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_JVM_HEAP_MEM_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD; import java.nio.file.Path; import java.util.Arrays; diff --git a/plugin/src/test/java/org/opensearch/ml/breaker/MemoryCircuitBreakerTests.java b/plugin/src/test/java/org/opensearch/ml/breaker/MemoryCircuitBreakerTests.java index 8c7f6f41d4..a2539bd1a7 100644 --- a/plugin/src/test/java/org/opensearch/ml/breaker/MemoryCircuitBreakerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/breaker/MemoryCircuitBreakerTests.java @@ -6,7 +6,7 @@ package org.opensearch.ml.breaker; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_JVM_HEAP_MEM_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_JVM_HEAP_MEM_THRESHOLD; import org.junit.Assert; import org.junit.Before; diff --git a/plugin/src/test/java/org/opensearch/ml/breaker/NativeMemoryCircuitBreakerTests.java b/plugin/src/test/java/org/opensearch/ml/breaker/NativeMemoryCircuitBreakerTests.java index 14ee4716b7..d750741103 100644 --- a/plugin/src/test/java/org/opensearch/ml/breaker/NativeMemoryCircuitBreakerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/breaker/NativeMemoryCircuitBreakerTests.java @@ -6,7 +6,7 @@ package org.opensearch.ml.breaker; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD; import java.util.Arrays; import java.util.HashSet; diff --git a/plugin/src/test/java/org/opensearch/ml/cluster/DiscoveryNodeHelperTests.java b/plugin/src/test/java/org/opensearch/ml/cluster/DiscoveryNodeHelperTests.java index 7299090ccb..06b0ba1ffc 100644 --- a/plugin/src/test/java/org/opensearch/ml/cluster/DiscoveryNodeHelperTests.java +++ b/plugin/src/test/java/org/opensearch/ml/cluster/DiscoveryNodeHelperTests.java @@ -9,10 +9,10 @@ import static java.util.Collections.emptySet; import static org.mockito.Mockito.when; import static org.opensearch.cluster.node.DiscoveryNodeRole.BUILT_IN_ROLES; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_EXCLUDE_NODE_NAMES; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ELIGIBLE_NODE_ROLES; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_MODEL_ELIGIBLE_NODE_ROLES; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_EXCLUDE_NODE_NAMES; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ELIGIBLE_NODE_ROLES; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_MODEL_ELIGIBLE_NODE_ROLES; import static org.opensearch.ml.utils.TestHelper.ALL_ROLES; import static org.opensearch.ml.utils.TestHelper.ML_ROLE; import static org.opensearch.ml.utils.TestHelper.clusterSetting; diff --git a/plugin/src/test/java/org/opensearch/ml/cluster/MLSyncUpCronTests.java b/plugin/src/test/java/org/opensearch/ml/cluster/MLSyncUpCronTests.java index 00ffffd087..f6c61e7799 100644 --- a/plugin/src/test/java/org/opensearch/ml/cluster/MLSyncUpCronTests.java +++ b/plugin/src/test/java/org/opensearch/ml/cluster/MLSyncUpCronTests.java @@ -67,13 +67,13 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.model.MLModelState; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.sync.MLSyncUpAction; import org.opensearch.ml.common.transport.sync.MLSyncUpNodeResponse; import org.opensearch.ml.common.transport.sync.MLSyncUpNodesResponse; import org.opensearch.ml.engine.encryptor.Encryptor; import org.opensearch.ml.engine.encryptor.EncryptorImpl; import org.opensearch.ml.engine.indices.MLIndicesHandler; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/helper/ConnectorAccessControlHelperTests.java b/plugin/src/test/java/org/opensearch/ml/helper/ConnectorAccessControlHelperTests.java index 49d143fcbf..15ed0c7167 100644 --- a/plugin/src/test/java/org/opensearch/ml/helper/ConnectorAccessControlHelperTests.java +++ b/plugin/src/test/java/org/opensearch/ml/helper/ConnectorAccessControlHelperTests.java @@ -12,7 +12,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; import static org.opensearch.ml.task.MLPredictTaskRunnerTests.USER_STRING; import static org.opensearch.ml.utils.TestHelper.clusterSetting; @@ -50,7 +50,7 @@ import org.opensearch.ml.common.connector.Connector; import org.opensearch.ml.common.connector.ConnectorProtocols; import org.opensearch.ml.common.connector.HttpConnector; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.GetDataObjectRequest; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/helper/ModelAccessControlHelperTests.java b/plugin/src/test/java/org/opensearch/ml/helper/ModelAccessControlHelperTests.java index 2eef7e0867..5083211d91 100644 --- a/plugin/src/test/java/org/opensearch/ml/helper/ModelAccessControlHelperTests.java +++ b/plugin/src/test/java/org/opensearch/ml/helper/ModelAccessControlHelperTests.java @@ -9,7 +9,7 @@ import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_ACCESS_CONTROL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_ACCESS_CONTROL_ENABLED; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.io.IOException; @@ -44,7 +44,7 @@ import org.opensearch.ml.common.CommonValue; import org.opensearch.ml.common.MLModelGroup; import org.opensearch.ml.common.MLModelGroup.MLModelGroupBuilder; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; import org.opensearch.search.builder.SearchSourceBuilder; diff --git a/plugin/src/test/java/org/opensearch/ml/model/MLModelCacheHelperTests.java b/plugin/src/test/java/org/opensearch/ml/model/MLModelCacheHelperTests.java index 6a04915d35..a2496b31c7 100644 --- a/plugin/src/test/java/org/opensearch/ml/model/MLModelCacheHelperTests.java +++ b/plugin/src/test/java/org/opensearch/ml/model/MLModelCacheHelperTests.java @@ -10,7 +10,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MONITORING_REQUEST_COUNT; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MONITORING_REQUEST_COUNT; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.util.ArrayList; diff --git a/plugin/src/test/java/org/opensearch/ml/model/MLModelGroupManagerTests.java b/plugin/src/test/java/org/opensearch/ml/model/MLModelGroupManagerTests.java index 82358d6f50..36ecd569b0 100644 --- a/plugin/src/test/java/org/opensearch/ml/model/MLModelGroupManagerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/model/MLModelGroupManagerTests.java @@ -48,10 +48,10 @@ import org.opensearch.index.get.GetResult; import org.opensearch.ml.common.AccessMode; import org.opensearch.ml.common.MLModelGroup; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupInput; import org.opensearch.ml.engine.indices.MLIndicesHandler; import org.opensearch.ml.helper.ModelAccessControlHelper; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.remote.metadata.client.SdkClient; import org.opensearch.remote.metadata.client.impl.SdkClientFactory; diff --git a/plugin/src/test/java/org/opensearch/ml/model/MLModelManagerTests.java b/plugin/src/test/java/org/opensearch/ml/model/MLModelManagerTests.java index f95986e12d..fd05d6d34f 100644 --- a/plugin/src/test/java/org/opensearch/ml/model/MLModelManagerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/model/MLModelManagerTests.java @@ -22,19 +22,19 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opensearch.ml.common.MLTask.FUNCTION_NAME_FIELD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_BATCH_INGESTION_BULK_SIZE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INFERENCE_TASKS; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INGESTION_TASKS; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_DEPLOY_MODEL_TASKS_PER_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_MODELS_PER_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_REGISTER_MODEL_TASKS_PER_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MONITORING_REQUEST_COUNT; import static org.opensearch.ml.engine.ModelHelper.CHUNK_FILES; import static org.opensearch.ml.engine.ModelHelper.MODEL_FILE_HASH; import static org.opensearch.ml.engine.ModelHelper.MODEL_SIZE_IN_BYTES; import static org.opensearch.ml.model.MLModelManager.TIMEOUT_IN_MILLIS; import static org.opensearch.ml.plugin.MachineLearningPlugin.DEPLOY_THREAD_POOL; import static org.opensearch.ml.plugin.MachineLearningPlugin.REGISTER_THREAD_POOL; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_BATCH_INGESTION_BULK_SIZE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INFERENCE_TASKS; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_BATCH_INGESTION_TASKS; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_DEPLOY_MODEL_TASKS_PER_NODE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_MODELS_PER_NODE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_REGISTER_MODEL_TASKS_PER_NODE; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MONITORING_REQUEST_COUNT; import static org.opensearch.ml.utils.MockHelper.mock_MLIndicesHandler_initModelIndex; import static org.opensearch.ml.utils.MockHelper.mock_MLIndicesHandler_initModelIndex_failure; import static org.opensearch.ml.utils.MockHelper.mock_client_ThreadContext; @@ -113,6 +113,7 @@ import org.opensearch.ml.common.model.MLModelFormat; import org.opensearch.ml.common.model.MLModelState; import org.opensearch.ml.common.model.TextEmbeddingModelConfig; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.deploy.MLDeployModelAction; import org.opensearch.ml.common.transport.register.MLRegisterModelInput; import org.opensearch.ml.common.transport.register.MLRegisterModelResponse; @@ -122,7 +123,6 @@ import org.opensearch.ml.engine.encryptor.Encryptor; import org.opensearch.ml.engine.encryptor.EncryptorImpl; import org.opensearch.ml.engine.indices.MLIndicesHandler; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.stats.ActionName; import org.opensearch.ml.stats.MLActionLevelStat; import org.opensearch.ml.stats.MLNodeLevelStat; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RegisterAgentTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RegisterAgentTransportActionTests.java index 184825afff..478424120b 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RegisterAgentTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RegisterAgentTransportActionTests.java @@ -40,9 +40,9 @@ import org.opensearch.core.xcontent.MediaTypeRegistry; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.MLAgentType; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLRegisterAgentAction; import org.opensearch.ml.common.transport.agent.MLRegisterAgentRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLCreateConnectorActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLCreateConnectorActionTests.java index 4e4a716483..ef1cf09e50 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLCreateConnectorActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLCreateConnectorActionTests.java @@ -31,11 +31,11 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorAction; import org.opensearch.ml.common.transport.connector.MLCreateConnectorInput; import org.opensearch.ml.common.transport.connector.MLCreateConnectorRequest; import org.opensearch.ml.common.transport.connector.MLCreateConnectorResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLCreateControllerActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLCreateControllerActionTests.java index 0e22935be0..b0503e7830 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLCreateControllerActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLCreateControllerActionTests.java @@ -32,9 +32,9 @@ import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.controller.MLController; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLCreateControllerAction; import org.opensearch.ml.common.transport.controller.MLCreateControllerRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteAgentActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteAgentActionTests.java index be070684b6..d609830a46 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteAgentActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteAgentActionTests.java @@ -23,9 +23,9 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLAgentDeleteAction; import org.opensearch.ml.common.transport.agent.MLAgentDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteConnectorActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteConnectorActionTests.java index e60984f6f6..b54c2fd9a7 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteConnectorActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteConnectorActionTests.java @@ -27,9 +27,9 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.input.Constants; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorDeleteAction; import org.opensearch.ml.common.transport.connector.MLConnectorDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteControllerActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteControllerActionTests.java index 69149d2c8e..91ef53db5d 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteControllerActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteControllerActionTests.java @@ -29,9 +29,9 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLControllerDeleteAction; import org.opensearch.ml.common.transport.controller.MLControllerDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionTests.java index 4135a87ecf..a7886ec04e 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionTests.java @@ -26,9 +26,9 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelDeleteAction; import org.opensearch.ml.common.transport.model.MLModelDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelGroupActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelGroupActionTests.java index a2479c74c5..68f3b1c799 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelGroupActionTests.java @@ -13,7 +13,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opensearch.ml.common.input.Constants.TENANT_ID_HEADER; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_GROUP_ID; import java.util.HashMap; @@ -32,9 +32,9 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupDeleteAction; import org.opensearch.ml.common.transport.model_group.MLModelGroupDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteTaskActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteTaskActionTests.java index 9109bda20a..c5e2dce0e8 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteTaskActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteTaskActionTests.java @@ -9,7 +9,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; import static org.mockito.Mockito.times; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_TASK_ID; import java.util.HashMap; @@ -28,9 +28,9 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.task.MLTaskDeleteAction; import org.opensearch.ml.common.transport.task.MLTaskDeleteRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java index 3ea2e89eb4..8f79c1354c 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java @@ -8,7 +8,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import java.util.*; @@ -25,10 +25,10 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.deploy.MLDeployModelAction; import org.opensearch.ml.common.transport.deploy.MLDeployModelRequest; import org.opensearch.ml.common.transport.model.MLModelGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLExecuteActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLExecuteActionTests.java index 9c9be607f4..a59f6d1009 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLExecuteActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLExecuteActionTests.java @@ -42,10 +42,10 @@ import org.opensearch.ml.common.output.execute.anomalylocalization.AnomalyLocalizationOutput.Bucket; import org.opensearch.ml.common.output.execute.anomalylocalization.AnomalyLocalizationOutput.Result; import org.opensearch.ml.common.output.execute.samplecalculator.LocalSampleCalculatorOutput; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.execute.MLExecuteTaskAction; import org.opensearch.ml.common.transport.execute.MLExecuteTaskRequest; import org.opensearch.ml.common.transport.execute.MLExecuteTaskResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetAgentActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetAgentActionTests.java index 275743dbe3..29a61b11b4 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetAgentActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetAgentActionTests.java @@ -22,9 +22,9 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLAgentGetAction; import org.opensearch.ml.common.transport.agent.MLAgentGetRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetConfigActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetConfigActionTests.java index 64e4844e74..3f31bfed99 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetConfigActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetConfigActionTests.java @@ -12,7 +12,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_CONFIG_ID; import java.util.HashMap; @@ -32,10 +32,10 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.config.MLConfigGetAction; import org.opensearch.ml.common.transport.config.MLConfigGetRequest; import org.opensearch.ml.common.transport.config.MLConfigGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetConnectorActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetConnectorActionTests.java index af334491ae..6e7f7daedf 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetConnectorActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetConnectorActionTests.java @@ -12,7 +12,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_CONNECTOR_ID; import java.util.HashMap; @@ -32,10 +32,10 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorGetAction; import org.opensearch.ml.common.transport.connector.MLConnectorGetRequest; import org.opensearch.ml.common.transport.connector.MLConnectorGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetControllerActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetControllerActionTests.java index a30b75816c..5d4352cab7 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetControllerActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetControllerActionTests.java @@ -29,10 +29,10 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLControllerGetAction; import org.opensearch.ml.common.transport.controller.MLControllerGetRequest; import org.opensearch.ml.common.transport.controller.MLControllerGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionTests.java index f83b1c15cc..43988d8544 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionTests.java @@ -10,7 +10,7 @@ import static org.mockito.Mockito.*; import static org.mockito.Mockito.times; import static org.opensearch.ml.common.input.Constants.TENANT_ID_HEADER; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_ID; import java.util.HashMap; @@ -30,10 +30,10 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelGetAction; import org.opensearch.ml.common.transport.model.MLModelGetRequest; import org.opensearch.ml.common.transport.model.MLModelGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelGroupActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelGroupActionTests.java index 84212c2951..33b85bb8bd 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelGroupActionTests.java @@ -13,7 +13,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opensearch.ml.common.input.Constants.TENANT_ID_HEADER; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_GROUP_ID; import java.util.HashMap; @@ -33,10 +33,10 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetAction; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetRequest; import org.opensearch.ml.common.transport.model_group.MLModelGroupGetResponse; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetTaskActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetTaskActionTests.java index 9de0fd415b..279e1042b1 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetTaskActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetTaskActionTests.java @@ -9,7 +9,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; import static org.mockito.Mockito.times; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_TASK_ID; import java.util.HashMap; @@ -27,8 +27,8 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.task.*; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLPredictionActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLPredictionActionTests.java index 9028ce174e..8232ec905e 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLPredictionActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLPredictionActionTests.java @@ -35,13 +35,13 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.input.MLInput; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.MLTaskResponse; import org.opensearch.ml.common.transport.model.MLModelGetAction; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.prediction.MLPredictionTaskAction; import org.opensearch.ml.common.transport.prediction.MLPredictionTaskRequest; import org.opensearch.ml.model.MLModelManager; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterAgentActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterAgentActionTests.java index ec1c456867..295c0ccf0a 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterAgentActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterAgentActionTests.java @@ -12,7 +12,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import java.util.List; import java.util.Map; @@ -31,9 +31,9 @@ import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.agent.MLAgent; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLRegisterAgentAction; import org.opensearch.ml.common.transport.agent.MLRegisterAgentRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java index 7f2a83409d..5c2b13ff69 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java @@ -12,7 +12,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL; import static org.opensearch.ml.utils.MLExceptionUtils.LOCAL_MODEL_DISABLED_ERR_MSG; import static org.opensearch.ml.utils.MLExceptionUtils.REMOTE_INFERENCE_DISABLED_ERR_MSG; import static org.opensearch.ml.utils.TestHelper.clusterSetting; @@ -37,11 +37,11 @@ import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.model.TextEmbeddingModelConfig; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.register.MLRegisterModelAction; import org.opensearch.ml.common.transport.register.MLRegisterModelInput; import org.opensearch.ml.common.transport.register.MLRegisterModelRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelGroupActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelGroupActionTests.java index 5e745a166d..c0298c467b 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelGroupActionTests.java @@ -12,7 +12,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import java.util.List; import java.util.Map; @@ -34,10 +34,10 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupAction; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupInput; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java index 51a1f600eb..792ec87b4f 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java @@ -8,7 +8,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_LOCAL_FILE_UPLOAD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_LOCAL_FILE_UPLOAD; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.io.IOException; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchAgentActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchAgentActionTests.java index 6e7eea392c..e12aa68335 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchAgentActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchAgentActionTests.java @@ -34,9 +34,9 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.agent.MLSearchAgentAction; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchConnectorActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchConnectorActionTests.java index 92a1204c8c..0e1262c24a 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchConnectorActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchConnectorActionTests.java @@ -37,9 +37,9 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.index.IndexNotFoundException; import org.opensearch.ml.action.connector.SearchConnectorTransportAction; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLConnectorSearchAction; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java index b2fb4e907c..dc2a8e69b0 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java @@ -34,9 +34,9 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelSearchAction; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelGroupActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelGroupActionTests.java index 6de0f33f4f..051b7777fd 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelGroupActionTests.java @@ -33,9 +33,9 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLModelGroupSearchAction; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchTaskActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchTaskActionTests.java index 3c917a9568..2ff1e56bea 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchTaskActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchTaskActionTests.java @@ -11,7 +11,7 @@ import org.junit.Before; import org.mockito.Mock; import org.opensearch.core.common.Strings; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.test.OpenSearchTestCase; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java index 5d7ecf9375..efafab161e 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java @@ -12,7 +12,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_CUSTOM_DEPLOYMENT_PLAN; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import static org.opensearch.ml.utils.TestHelper.setupTestClusterState; @@ -33,10 +33,10 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelsAction; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelsRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateConnectorActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateConnectorActionTests.java index 1aa0656b69..a6121bdd56 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateConnectorActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateConnectorActionTests.java @@ -30,9 +30,9 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLUpdateConnectorAction; import org.opensearch.ml.common.transport.connector.MLUpdateConnectorRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateControllerActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateControllerActionTests.java index a82cb0bca0..2ee84fc4c3 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateControllerActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateControllerActionTests.java @@ -32,9 +32,9 @@ import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.controller.MLController; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.controller.MLUpdateControllerAction; import org.opensearch.ml.common.transport.controller.MLUpdateControllerRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelActionTests.java index b127d7d552..34f06ea681 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelActionTests.java @@ -34,11 +34,11 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.connector.MLCreateConnectorInput; import org.opensearch.ml.common.transport.model.MLUpdateModelAction; import org.opensearch.ml.common.transport.model.MLUpdateModelInput; import org.opensearch.ml.common.transport.model.MLUpdateModelRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelGroupActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelGroupActionTests.java index 31b25bccc5..8dec7e27b2 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelGroupActionTests.java @@ -12,7 +12,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import java.io.IOException; import java.util.HashMap; @@ -35,10 +35,10 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupAction; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupInput; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupRequest; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java index 429802d068..e031756ff4 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java @@ -8,7 +8,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_LOCAL_FILE_UPLOAD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ALLOW_LOCAL_FILE_UPLOAD; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.util.HashMap; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryCreateConversationActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryCreateConversationActionIT.java index d691d24ef5..7268259820 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryCreateConversationActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryCreateConversationActionIT.java @@ -29,7 +29,7 @@ import org.opensearch.client.Response; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.conversation.ActionConstants; -import org.opensearch.ml.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.utils.TestHelper; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryCreateInteractionActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryCreateInteractionActionIT.java index f59f3bf8ec..89c00e8af7 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryCreateInteractionActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryCreateInteractionActionIT.java @@ -29,7 +29,7 @@ import org.opensearch.client.Response; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.conversation.ActionConstants; -import org.opensearch.ml.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.utils.TestHelper; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryDeleteConversationActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryDeleteConversationActionIT.java index 9c6f7c83b5..a21a5270f1 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryDeleteConversationActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryDeleteConversationActionIT.java @@ -34,7 +34,7 @@ import org.opensearch.client.ResponseException; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.conversation.ActionConstants; -import org.opensearch.ml.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.utils.TestHelper; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetConversationActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetConversationActionIT.java index 28df548c6e..2a7efc0d5c 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetConversationActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetConversationActionIT.java @@ -27,7 +27,7 @@ import org.opensearch.client.Response; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.conversation.ActionConstants; -import org.opensearch.ml.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.utils.TestHelper; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetConversationsActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetConversationsActionIT.java index 7ffb1c3c15..7765051d9a 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetConversationsActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetConversationsActionIT.java @@ -33,7 +33,7 @@ import org.opensearch.client.Response; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.conversation.ActionConstants; -import org.opensearch.ml.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.utils.TestHelper; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetInteractionActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetInteractionActionIT.java index e711948b6c..15aff78c7c 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetInteractionActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetInteractionActionIT.java @@ -28,7 +28,7 @@ import org.opensearch.client.Response; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.conversation.ActionConstants; -import org.opensearch.ml.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.utils.TestHelper; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetInteractionsActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetInteractionsActionIT.java index e06b45ae98..c8844e3c2f 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetInteractionsActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemoryGetInteractionsActionIT.java @@ -33,7 +33,7 @@ import org.opensearch.client.Response; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.conversation.ActionConstants; -import org.opensearch.ml.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.utils.TestHelper; import com.google.common.collect.ImmutableList; @@ -86,7 +86,7 @@ public void testGetInteractions_NoInteractions() throws IOException { Map map = gson.fromJson(entityString, Map.class); assert (map.containsKey(RESPONSE_INTERACTION_LIST_FIELD)); assert (!map.containsKey("next_token")); - assert (((ArrayList) map.get(RESPONSE_INTERACTION_LIST_FIELD)).size() == 0); + assert (((ArrayList) map.get(RESPONSE_INTERACTION_LIST_FIELD)).isEmpty()); } public void testGetInteractions_LastPage() throws IOException { diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchConversationsActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchConversationsActionIT.java index 2c2ca0cc94..2cae4c2fc7 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchConversationsActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchConversationsActionIT.java @@ -30,7 +30,7 @@ import org.opensearch.client.Response; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.conversation.ActionConstants; -import org.opensearch.ml.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.utils.TestHelper; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchConversationsActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchConversationsActionTests.java index a6fc86a6c7..1d03047ee9 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchConversationsActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchConversationsActionTests.java @@ -31,9 +31,9 @@ import org.mockito.MockitoAnnotations; import org.opensearch.index.query.MatchAllQueryBuilder; import org.opensearch.ml.common.conversation.ActionConstants; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.transport.search.MLSearchActionRequest; import org.opensearch.ml.memory.action.conversation.SearchConversationsAction; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; import org.opensearch.ml.utils.TestHelper; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestHandler.Route; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchInteractionsActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchInteractionsActionIT.java index f2f80b3e60..ce39dc545b 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchInteractionsActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMemorySearchInteractionsActionIT.java @@ -30,7 +30,7 @@ import org.opensearch.client.Response; import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.conversation.ActionConstants; -import org.opensearch.ml.settings.MLCommonsSettings; +import org.opensearch.ml.common.settings.MLCommonsSettings; import org.opensearch.ml.utils.TestHelper; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/test/java/org/opensearch/ml/settings/MLFeatureEnabledSettingTests.java b/plugin/src/test/java/org/opensearch/ml/settings/MLFeatureEnabledSettingTests.java index 5608b7ef81..2c2dddd499 100644 --- a/plugin/src/test/java/org/opensearch/ml/settings/MLFeatureEnabledSettingTests.java +++ b/plugin/src/test/java/org/opensearch/ml/settings/MLFeatureEnabledSettingTests.java @@ -9,14 +9,14 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_AGENT_FRAMEWORK_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_PRIVATE_IP_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONTROLLER_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INFERENCE_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INGESTION_ENABLED; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_REMOTE_INFERENCE_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_AGENT_FRAMEWORK_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_PRIVATE_IP_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_CONTROLLER_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_LOCAL_MODEL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INFERENCE_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_OFFLINE_BATCH_INGESTION_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_REMOTE_INFERENCE_ENABLED; import java.util.Set; @@ -27,6 +27,7 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.ml.common.settings.SettingsChangeListener; public class MLFeatureEnabledSettingTests { diff --git a/plugin/src/test/java/org/opensearch/ml/task/MLExecuteTaskRunnerTests.java b/plugin/src/test/java/org/opensearch/ml/task/MLExecuteTaskRunnerTests.java index 84c096410e..5883313cfc 100644 --- a/plugin/src/test/java/org/opensearch/ml/task/MLExecuteTaskRunnerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/task/MLExecuteTaskRunnerTests.java @@ -12,8 +12,8 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.ml.settings.MLCommonsSettings.*; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MAX_DEPLOY_MODEL_TASKS_PER_NODE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.*; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MAX_DEPLOY_MODEL_TASKS_PER_NODE; import static org.opensearch.ml.utils.TestHelper.clusterSetting; import java.nio.file.Path; diff --git a/plugin/src/test/java/org/opensearch/ml/task/MLPredictTaskRunnerTests.java b/plugin/src/test/java/org/opensearch/ml/task/MLPredictTaskRunnerTests.java index 8d7ce3cd6b..8a3c456994 100644 --- a/plugin/src/test/java/org/opensearch/ml/task/MLPredictTaskRunnerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/task/MLPredictTaskRunnerTests.java @@ -9,7 +9,7 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.*; import static org.mockito.Mockito.spy; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_DEPLOY_ENABLE; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MODEL_AUTO_DEPLOY_ENABLE; import java.io.IOException; import java.nio.file.Path; diff --git a/plugin/src/test/java/org/opensearch/ml/task/MLTaskDispatcherTests.java b/plugin/src/test/java/org/opensearch/ml/task/MLTaskDispatcherTests.java index 71f460cef2..3a7861e849 100644 --- a/plugin/src/test/java/org/opensearch/ml/task/MLTaskDispatcherTests.java +++ b/plugin/src/test/java/org/opensearch/ml/task/MLTaskDispatcherTests.java @@ -11,8 +11,8 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opensearch.ml.breaker.MemoryCircuitBreaker.DEFAULT_JVM_HEAP_USAGE_THRESHOLD; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_ROLE_NAME; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ONLY_RUN_ON_ML_NODE; import static org.opensearch.ml.utils.TestHelper.ML_ROLE; import java.util.ArrayList; diff --git a/plugin/src/test/java/org/opensearch/ml/utils/RestActionUtilsTests.java b/plugin/src/test/java/org/opensearch/ml/utils/RestActionUtilsTests.java index be656d3d5d..ce44a22cd0 100644 --- a/plugin/src/test/java/org/opensearch/ml/utils/RestActionUtilsTests.java +++ b/plugin/src/test/java/org/opensearch/ml/utils/RestActionUtilsTests.java @@ -9,7 +9,7 @@ import static org.mockito.Mockito.when; import static org.opensearch.cluster.node.DiscoveryNodeRole.CLUSTER_MANAGER_ROLE; import static org.opensearch.ml.common.CommonValue.ML_CONNECTOR_INDEX; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; import static org.opensearch.ml.utils.RestActionUtils.OPENSEARCH_DASHBOARDS_USER_AGENT; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_ALGORITHM; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_ASYNC; diff --git a/plugin/src/test/java/org/opensearch/ml/utils/TenantAwareHelperTests.java b/plugin/src/test/java/org/opensearch/ml/utils/TenantAwareHelperTests.java index c5adfce824..28921310d8 100644 --- a/plugin/src/test/java/org/opensearch/ml/utils/TenantAwareHelperTests.java +++ b/plugin/src/test/java/org/opensearch/ml/utils/TenantAwareHelperTests.java @@ -10,7 +10,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opensearch.ml.common.CommonValue.TENANT_ID_FIELD; -import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_MULTI_TENANCY_ENABLED; import static org.opensearch.ml.utils.TestHelper.xContentRegistry; import java.util.Collections; @@ -32,7 +32,7 @@ import org.opensearch.index.query.QueryBuilders; import org.opensearch.index.query.TermQueryBuilder; import org.opensearch.ml.common.input.Constants; -import org.opensearch.ml.settings.MLFeatureEnabledSetting; +import org.opensearch.ml.common.settings.MLFeatureEnabledSetting; import org.opensearch.rest.RestRequest; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.test.rest.FakeRestRequest; diff --git a/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/GenerativeQAProcessorConstants.java b/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/GenerativeQAProcessorConstants.java index 7b3cf07db8..ae89199b73 100644 --- a/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/GenerativeQAProcessorConstants.java +++ b/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/GenerativeQAProcessorConstants.java @@ -17,7 +17,7 @@ */ package org.opensearch.searchpipelines.questionanswering.generative; -import org.opensearch.common.settings.Setting; +import static org.opensearch.ml.common.settings.MLCommonsSettings.ML_COMMONS_RAG_PIPELINE_FEATURE_ENABLED; public class GenerativeQAProcessorConstants { @@ -39,10 +39,7 @@ public class GenerativeQAProcessorConstants { public static final String CONFIG_NAME_SYSTEM_PROMPT = "system_prompt"; public static final String CONFIG_NAME_USER_INSTRUCTIONS = "user_instructions"; - public static final Setting RAG_PIPELINE_FEATURE_ENABLED = Setting - .boolSetting("plugins.ml_commons.rag_pipeline_feature_enabled", true, Setting.Property.NodeScope, Setting.Property.Dynamic); - - public static final String FEATURE_NOT_ENABLED_ERROR_MSG = RAG_PIPELINE_FEATURE_ENABLED.getKey() + " is not enabled."; + public static final String FEATURE_NOT_ENABLED_ERROR_MSG = ML_COMMONS_RAG_PIPELINE_FEATURE_ENABLED.getKey() + " is not enabled."; public static final String RAG_NULL_GEN_QA_PARAMS_ERROR_MSG = "generative_qa_parameters not found." + " Please provide ext.generative_qa_parameters to proceed."