From 221b08d7281f87072973e47e3abbf6f4b8c4cf3a Mon Sep 17 00:00:00 2001 From: Martin Gaievski Date: Fri, 14 Jul 2023 00:10:56 +0200 Subject: [PATCH] Fix core package name to address compilation errors (#1122) Signed-off-by: Martin Gaievski (cherry picked from commit 6bfc1d3a64e225ede879bd9c47527c474b25a8d3) --- build.gradle | 2 +- .../client/MachineLearningNodeClientTest.java | 12 ++++--- .../org/opensearch/ml/common/MLModel.java | 6 ++-- .../opensearch/ml/common/MLModelGroup.java | 17 +++++---- .../java/org/opensearch/ml/common/MLTask.java | 8 ++--- .../ml/common/connector/AwsConnector.java | 2 +- .../ml/common/connector/Connector.java | 33 +++++++++-------- .../ml/common/connector/ConnectorAction.java | 8 ++--- .../ml/common/connector/HttpConnector.java | 33 +++++++++-------- .../common/dataframe/AbstractDataFrame.java | 2 +- .../ml/common/dataframe/BooleanValue.java | 2 +- .../ml/common/dataframe/ColumnMeta.java | 8 ++--- .../ml/common/dataframe/ColumnValue.java | 2 +- .../common/dataframe/ColumnValueReader.java | 5 ++- .../ml/common/dataframe/DataFrame.java | 2 +- .../ml/common/dataframe/DataFrameBuilder.java | 2 +- .../ml/common/dataframe/DefaultDataFrame.java | 6 ++-- .../ml/common/dataframe/DoubleValue.java | 2 +- .../ml/common/dataframe/FloatValue.java | 2 +- .../ml/common/dataframe/IntValue.java | 2 +- .../ml/common/dataframe/LongValue.java | 2 +- .../ml/common/dataframe/NullValue.java | 2 +- .../opensearch/ml/common/dataframe/Row.java | 8 ++--- .../ml/common/dataframe/ShortValue.java | 2 +- .../ml/common/dataframe/StringValue.java | 2 +- .../common/dataset/DataFrameInputDataset.java | 4 +-- .../ml/common/dataset/MLInputDataset.java | 6 ++-- .../dataset/SearchQueryInputDataset.java | 4 +-- .../common/dataset/TextDocsInputDataSet.java | 4 +-- .../remote/RemoteInferenceInputDataSet.java | 9 +++-- .../org/opensearch/ml/common/input/Input.java | 2 +- .../opensearch/ml/common/input/MLInput.java | 6 ++-- .../AnomalyLocalizationInput.java | 6 ++-- .../MetricsCorrelationInput.java | 6 ++-- .../LocalSampleCalculatorInput.java | 6 ++-- .../ml/common/input/nlp/TextDocsMLInput.java | 6 ++-- .../common/input/parameter/MLAlgoParams.java | 2 +- .../ad/AnomalyDetectionLibSVMParams.java | 6 ++-- .../parameter/clustering/KMeansParams.java | 6 ++-- .../clustering/RCFSummarizeParams.java | 6 ++-- .../input/parameter/rcf/BatchRCFParams.java | 6 ++-- .../input/parameter/rcf/FitRCFParams.java | 6 ++-- .../regression/LinearRegressionParams.java | 6 ++-- .../regression/LogisticRegressionParams.java | 6 ++-- .../parameter/sample/SampleAlgoParams.java | 6 ++-- .../input/remote/RemoteInferenceMLInput.java | 18 ++++------ .../ml/common/model/MLModelConfig.java | 6 ++-- .../model/MetricsCorrelationModelConfig.java | 2 +- .../model/TextEmbeddingModelConfig.java | 6 ++-- .../opensearch/ml/common/output/MLOutput.java | 4 +-- .../ml/common/output/MLPredictionOutput.java | 4 +-- .../ml/common/output/MLTrainingOutput.java | 4 +-- .../opensearch/ml/common/output/Output.java | 2 +- .../AnomalyLocalizationOutput.java | 6 ++-- .../metrics_correlation/MCorrModelTensor.java | 6 ++-- .../MCorrModelTensors.java | 8 ++--- .../MetricsCorrelationOutput.java | 4 +-- .../LocalSampleCalculatorOutput.java | 4 +-- .../output/model/ModelResultFilter.java | 8 ++--- .../ml/common/output/model/ModelTensor.java | 23 ++++++------ .../output/model/ModelTensorOutput.java | 4 +-- .../ml/common/output/model/ModelTensors.java | 8 ++--- .../output/sample/SampleAlgoOutput.java | 5 +-- .../ml/common/transport/MLTaskRequest.java | 4 +-- .../ml/common/transport/MLTaskResponse.java | 8 ++--- .../connector/MLConnectorDeleteRequest.java | 8 ++--- .../connector/MLConnectorGetRequest.java | 8 ++--- .../connector/MLConnectorGetResponse.java | 8 ++--- .../connector/MLCreateConnectorInput.java | 8 ++--- .../connector/MLCreateConnectorRequest.java | 10 +++--- .../connector/MLCreateConnectorResponse.java | 4 +-- .../transport/deploy/MLDeployModelInput.java | 9 +++-- .../deploy/MLDeployModelNodeRequest.java | 4 +-- .../deploy/MLDeployModelNodeResponse.java | 4 +-- .../deploy/MLDeployModelNodesRequest.java | 4 +-- .../deploy/MLDeployModelNodesResponse.java | 4 +-- .../deploy/MLDeployModelRequest.java | 10 +++--- .../deploy/MLDeployModelResponse.java | 4 +-- .../execute/MLExecuteTaskRequest.java | 8 ++--- .../execute/MLExecuteTaskResponse.java | 8 ++--- .../transport/forward/MLForwardInput.java | 6 ++-- .../transport/forward/MLForwardRequest.java | 8 ++--- .../transport/forward/MLForwardResponse.java | 8 ++--- .../transport/model/MLModelDeleteRequest.java | 8 ++--- .../transport/model/MLModelGetRequest.java | 8 ++--- .../transport/model/MLModelGetResponse.java | 8 ++--- .../MLModelGroupDeleteRequest.java | 8 ++--- .../MLRegisterModelGroupInput.java | 8 ++--- .../MLRegisterModelGroupRequest.java | 8 ++--- .../MLRegisterModelGroupResponse.java | 4 +-- .../model_group/MLUpdateModelGroupInput.java | 8 ++--- .../MLUpdateModelGroupRequest.java | 8 ++--- .../MLUpdateModelGroupResponse.java | 4 +-- .../prediction/MLPredictionTaskRequest.java | 24 ++++++------- .../register/MLRegisterModelInput.java | 10 +++--- .../register/MLRegisterModelRequest.java | 8 ++--- .../register/MLRegisterModelResponse.java | 4 +-- .../common/transport/sync/MLSyncUpInput.java | 6 ++-- .../transport/sync/MLSyncUpNodeRequest.java | 4 +-- .../transport/sync/MLSyncUpNodeResponse.java | 4 +-- .../transport/sync/MLSyncUpNodesRequest.java | 4 +-- .../transport/sync/MLSyncUpNodesResponse.java | 4 +-- .../transport/sync/MLSyncUpResponse.java | 4 +-- .../transport/task/MLTaskDeleteRequest.java | 8 ++--- .../transport/task/MLTaskGetRequest.java | 8 ++--- .../transport/task/MLTaskGetResponse.java | 8 ++--- .../training/MLTrainingTaskRequest.java | 8 ++--- .../undeploy/MLUndeployModelInput.java | 8 ++--- .../undeploy/MLUndeployModelNodeRequest.java | 7 ++-- .../undeploy/MLUndeployModelNodeResponse.java | 4 +-- .../undeploy/MLUndeployModelNodesRequest.java | 4 +-- .../MLUndeployModelNodesResponse.java | 4 +-- .../undeploy/MLUndeployModelsRequest.java | 27 +++++++------- .../undeploy/MLUndeployModelsResponse.java | 4 +-- .../MLRegisterModelMetaInput.java | 8 ++--- .../MLRegisterModelMetaRequest.java | 8 ++--- .../MLRegisterModelMetaResponse.java | 4 +-- .../upload_chunk/MLUploadModelChunkInput.java | 8 ++--- .../MLUploadModelChunkRequest.java | 9 ++--- .../MLUploadModelChunkResponse.java | 4 +-- .../ml/common/MLCommonsClassLoaderTests.java | 2 +- .../opensearch/ml/common/MLModelTests.java | 2 +- .../ml/common/RemoteModelTests.java | 11 +++--- .../org/opensearch/ml/common/TestHelper.java | 2 +- .../dataframe/DefaultDataFrameTest.java | 2 +- .../dataset/SearchQueryInputDatasetTest.java | 2 +- .../RemoteInferenceInputDataSetTest.java | 13 ++++--- .../ml/common/input/MLInputTest.java | 2 +- .../AnomalyLocalizationInputTests.java | 6 ++-- .../MetricsCorrelationInputTest.java | 2 +- .../LocalSampleCalculatorInputTest.java | 2 +- .../ad/AnomalyDetectionLibSVMParamsTest.java | 2 +- .../clustering/KMeansParamsTest.java | 2 +- .../clustering/RCFSummarizeParamsTest.java | 2 +- .../parameter/rcf/BatchRCFParamsTest.java | 2 +- .../input/parameter/rcf/FitRCFParamsTest.java | 2 +- .../LinearRegressionParamsTest.java | 2 +- .../LogisticRegressionParamsTest.java | 2 +- .../model/TextEmbeddingModelConfigTests.java | 2 +- .../common/output/MLPredictionOutputTest.java | 2 +- .../MCorrModelTensorTest.java | 2 +- .../MCorrModelTensorsTest.java | 2 +- .../MetricsCorrelationOutputTest.java | 2 +- .../LocalSampleCalculatorOutputTest.java | 2 +- .../output/model/ModelResultFilterTest.java | 2 +- .../output/model/ModelTensorOutputTest.java | 2 +- .../common/output/model/ModelTensorTest.java | 2 +- .../common/output/model/ModelTensorsTest.java | 2 +- .../output/sample/SampleAlgoOutputTest.java | 2 +- .../MLConnectorDeleteRequestTests.java | 17 +++++---- .../connector/MLConnectorGetRequestTests.java | 2 +- .../MLConnectorGetResponseTests.java | 19 +++++----- .../MLCreateConnectorInputTests.java | 19 ++++------ .../MLCreateConnectorRequestTests.java | 14 ++++---- .../deploy/MLDeployModelInputTest.java | 2 +- .../deploy/MLDeployModelNodesRequestTest.java | 2 +- .../deploy/MLDeployModelRequestTest.java | 2 +- .../transport/forward/MLForwardInputTest.java | 2 +- .../forward/MLForwardRequestTest.java | 2 +- .../forward/MLForwardResponseTest.java | 2 +- .../model/MLModelDeleteRequestTest.java | 2 +- .../model/MLModelGetRequestTest.java | 2 +- .../model/MLModelGetResponseTest.java | 16 +++++---- .../MLModelGroupDeleteRequestTest.java | 13 ++++--- .../MLRegisterModelGroupInputTest.java | 11 +++--- .../MLRegisterModelGroupRequestTest.java | 19 +++++----- .../MLUpdateModelGroupInputTest.java | 11 +++--- .../MLUpdateModelGroupRequestTest.java | 19 +++++----- .../MLPredictionTaskRequestTest.java | 2 +- .../MLPredictionTaskResponseTest.java | 2 +- .../register/MLRegisterModelInputTest.java | 2 +- .../register/MLRegisterModelRequestTest.java | 2 +- .../transport/sync/MLSyncUpInputTest.java | 2 +- .../sync/MLSyncUpNodeRequestTest.java | 2 +- .../transport/task/MLTaskGetRequestTest.java | 2 +- .../training/MLTrainingTaskRequestTest.java | 2 +- .../training/MLTrainingTaskResponseTest.java | 2 +- .../undeploy/MLUndeployModelInputTest.java | 2 +- .../MLUndeployModelNodesRequestTest.java | 2 +- .../MLRegisterModelMetaInputTest.java | 2 +- .../MLRegisterModelMetaRequestTest.java | 2 +- .../MLUploadModelChunkInputTest.java | 2 +- .../MLUploadModelChunkRequestTest.java | 2 +- .../remote/AwsConnectorExecutor.java | 2 +- .../opensearch/ml/engine/MLEngineTest.java | 2 +- .../MetricsCorrelationTest.java | 36 +++++++++---------- .../GetConnectorTransportAction.java | 2 +- .../TransportDeployModelOnNodeAction.java | 2 +- .../ml/action/handler/MLSearchHandler.java | 6 ++-- .../TransportUpdateModelGroupAction.java | 4 +-- .../models/DeleteModelTransportAction.java | 4 +-- .../models/GetModelTransportAction.java | 4 +-- .../profile/MLProfileModelResponse.java | 6 ++-- .../action/profile/MLProfileNodeRequest.java | 4 +-- .../action/profile/MLProfileNodeResponse.java | 4 +-- .../ml/action/profile/MLProfileRequest.java | 4 +-- .../ml/action/profile/MLProfileResponse.java | 4 +-- .../profile/MLProfileTransportAction.java | 2 +- .../ml/action/stats/MLStatsNodeRequest.java | 4 +-- .../ml/action/stats/MLStatsNodeResponse.java | 4 +-- .../ml/action/stats/MLStatsNodesRequest.java | 4 +-- .../ml/action/stats/MLStatsNodesResponse.java | 4 +-- .../stats/MLStatsNodesTransportAction.java | 2 +- .../syncup/TransportSyncUpOnNodeAction.java | 2 +- .../tasks/DeleteTaskTransportAction.java | 2 +- .../action/tasks/GetTaskTransportAction.java | 4 +-- .../TransportUndeployModelAction.java | 2 +- .../upload_chunk/MLModelChunkUploader.java | 2 +- .../helper/ConnectorAccessControlHelper.java | 2 +- .../ml/helper/ModelAccessControlHelper.java | 2 +- .../opensearch/ml/model/MLModelManager.java | 4 +-- .../ml/plugin/MachineLearningPlugin.java | 2 +- .../opensearch/ml/profile/MLModelProfile.java | 6 ++-- .../ml/profile/MLPredictRequestStats.java | 6 ++-- .../opensearch/ml/profile/MLProfileInput.java | 8 ++--- .../ml/rest/AbstractMLSearchAction.java | 2 +- .../ml/rest/RestMLCreateConnectorAction.java | 2 +- .../ml/rest/RestMLDeployModelAction.java | 2 +- .../ml/rest/RestMLExecuteAction.java | 2 +- .../ml/rest/RestMLPredictionAction.java | 4 +-- .../ml/rest/RestMLProfileAction.java | 4 +-- .../ml/rest/RestMLRegisterModelAction.java | 2 +- .../rest/RestMLRegisterModelGroupAction.java | 2 +- .../rest/RestMLRegisterModelMetaAction.java | 2 +- .../opensearch/ml/rest/RestMLStatsAction.java | 4 +-- .../ml/rest/RestMLTrainAndPredictAction.java | 2 +- .../ml/rest/RestMLTrainingAction.java | 2 +- .../ml/rest/RestMLUndeployModelAction.java | 2 +- .../ml/rest/RestMLUpdateModelGroupAction.java | 2 +- .../opensearch/ml/stats/MLActionStats.java | 6 ++-- .../org/opensearch/ml/stats/MLAlgoStats.java | 6 ++-- .../org/opensearch/ml/stats/MLStatsInput.java | 8 ++--- .../ml/task/MLPredictTaskRunner.java | 2 +- .../org/opensearch/ml/task/MLTaskManager.java | 2 +- .../org/opensearch/ml/utils/MLNodeUtils.java | 4 +-- .../opensearch/ml/utils/RestActionUtils.java | 2 +- .../DeleteConnectorTransportActionTests.java | 2 +- .../GetConnectorTransportActionTests.java | 2 +- .../TransportUpdateModelGroupActionTests.java | 2 +- .../DeleteModelTransportActionTests.java | 2 +- .../models/GetModelTransportActionTests.java | 2 +- .../MLProfileTransportActionTests.java | 2 +- .../MLStatsNodesTransportActionTests.java | 2 +- .../tasks/DeleteTaskTransportActionTests.java | 2 +- .../MLModelChunkUploaderTests.java | 2 +- .../MLModelAutoReDeployerTests.java | 2 +- ...onsBackwardsCompatibilityRestTestCase.java | 2 +- .../ml/cluster/MLSyncUpCronTests.java | 3 +- .../ConnectorAccessControlHelperTests.java | 2 +- .../helper/ModelAccessControlHelperTests.java | 2 +- .../indices/MLInputDatasetHandlerTests.java | 4 +-- .../ml/rest/MLCommonsRestTestCase.java | 2 +- .../rest/RestMLCustomModelChunkActionIT.java | 2 +- .../ml/rest/RestMLDeleteModelActionIT.java | 2 +- .../rest/RestMLDeleteModelGroupActionIT.java | 2 +- .../ml/rest/RestMLDeployModelActionTests.java | 2 +- .../ml/rest/RestMLGetModelActionIT.java | 2 +- .../rest/RestMLRegisterModelActionTests.java | 2 +- .../RestMLRegisterModelGroupActionTests.java | 2 +- .../RestMLRegisterModelMetaActionTests.java | 4 +-- .../RestMLSearchConnectorActionTests.java | 2 +- .../ml/rest/RestMLSearchModelActionIT.java | 2 +- .../ml/rest/RestMLSearchModelActionTests.java | 2 +- .../RestMLSearchModelGroupActionTests.java | 2 +- .../ml/rest/RestMLStatsActionTests.java | 4 +-- .../rest/RestMLUndeployModelActionTests.java | 2 +- .../RestMLUpdateModelGroupActionTests.java | 2 +- .../RestMLUploadModelChunkActionTests.java | 2 +- .../ml/task/MLPredictTaskRunnerTests.java | 2 +- .../ml/task/MLTaskManagerTests.java | 4 +-- .../ml/task/MLTrainingTaskRunnerTests.java | 4 +-- .../opensearch/ml/utils/IntegTestUtils.java | 2 +- .../ml/utils/MLExceptionUtilsTests.java | 2 +- .../opensearch/ml/utils/MLNodeUtilsTests.java | 2 +- .../org/opensearch/ml/utils/MockHelper.java | 2 +- .../org/opensearch/ml/utils/TestHelper.java | 6 ++-- 276 files changed, 689 insertions(+), 717 deletions(-) diff --git a/build.gradle b/build.gradle index e1c0282f8a..267017d403 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { ext { opensearch_group = "org.opensearch" isSnapshot = "true" == System.getProperty("build.snapshot", "true") - opensearch_version = System.getProperty("opensearch.version", "2.9.0-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "2.10.0-SNAPSHOT") buildVersionQualifier = System.getProperty("build.version_qualifier", "") // 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT diff --git a/client/src/test/java/org/opensearch/ml/client/MachineLearningNodeClientTest.java b/client/src/test/java/org/opensearch/ml/client/MachineLearningNodeClientTest.java index ba7d97b00b..f1c9795bca 100644 --- a/client/src/test/java/org/opensearch/ml/client/MachineLearningNodeClientTest.java +++ b/client/src/test/java/org/opensearch/ml/client/MachineLearningNodeClientTest.java @@ -20,18 +20,20 @@ import org.opensearch.action.search.SearchResponse; import org.opensearch.action.search.ShardSearchFailure; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.bytes.BytesReference; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.index.Index; +import org.opensearch.core.index.shard.ShardId; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; -import org.opensearch.index.Index; -import org.opensearch.index.shard.ShardId; +import org.opensearch.ml.common.FunctionName; +import org.opensearch.ml.common.MLModel; +import org.opensearch.ml.common.MLTask; +import org.opensearch.ml.common.MLTaskState; import org.opensearch.ml.common.dataframe.DataFrame; import org.opensearch.ml.common.dataset.MLInputDataset; -import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.input.MLInput; -import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.output.MLOutput; import org.opensearch.ml.common.output.MLPredictionOutput; import org.opensearch.ml.common.MLTask; diff --git a/common/src/main/java/org/opensearch/ml/common/MLModel.java b/common/src/main/java/org/opensearch/ml/common/MLModel.java index 1282e6008e..ae28066d5a 100644 --- a/common/src/main/java/org/opensearch/ml/common/MLModel.java +++ b/common/src/main/java/org/opensearch/ml/common/MLModel.java @@ -8,8 +8,8 @@ import lombok.Builder; import lombok.Getter; import lombok.Setter; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.commons.authuser.User; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; @@ -28,7 +28,7 @@ import java.util.List; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.USER; import static org.opensearch.ml.common.connector.Connector.createConnector; diff --git a/common/src/main/java/org/opensearch/ml/common/MLModelGroup.java b/common/src/main/java/org/opensearch/ml/common/MLModelGroup.java index 3a060910e0..680e29ad84 100644 --- a/common/src/main/java/org/opensearch/ml/common/MLModelGroup.java +++ b/common/src/main/java/org/opensearch/ml/common/MLModelGroup.java @@ -5,24 +5,23 @@ package org.opensearch.ml.common; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; + +import java.io.IOException; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; import lombok.Builder; import lombok.Getter; import lombok.Setter; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.util.CollectionUtils; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; -import java.io.IOException; -import java.time.Instant; -import java.util.ArrayList; -import java.util.List; - -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; - @Getter public class MLModelGroup implements ToXContentObject { public static final String MODEL_GROUP_NAME_FIELD = "name"; //name of the model group diff --git a/common/src/main/java/org/opensearch/ml/common/MLTask.java b/common/src/main/java/org/opensearch/ml/common/MLTask.java index 9080181e62..e8c814e432 100644 --- a/common/src/main/java/org/opensearch/ml/common/MLTask.java +++ b/common/src/main/java/org/opensearch/ml/common/MLTask.java @@ -9,9 +9,9 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.commons.authuser.User; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; @@ -24,7 +24,7 @@ import java.util.Arrays; import java.util.List; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.USER; @Getter diff --git a/common/src/main/java/org/opensearch/ml/common/connector/AwsConnector.java b/common/src/main/java/org/opensearch/ml/common/connector/AwsConnector.java index d9f2205a60..ed9c64ac94 100644 --- a/common/src/main/java/org/opensearch/ml/common/connector/AwsConnector.java +++ b/common/src/main/java/org/opensearch/ml/common/connector/AwsConnector.java @@ -10,7 +10,7 @@ import lombok.NoArgsConstructor; import lombok.extern.log4j.Log4j2; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.commons.authuser.User; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.AccessMode; diff --git a/common/src/main/java/org/opensearch/ml/common/connector/Connector.java b/common/src/main/java/org/opensearch/ml/common/connector/Connector.java index 7f596c71b1..2c355d300b 100644 --- a/common/src/main/java/org/opensearch/ml/common/connector/Connector.java +++ b/common/src/main/java/org/opensearch/ml/common/connector/Connector.java @@ -5,11 +5,24 @@ package org.opensearch.ml.common.connector; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.ml.common.utils.StringUtils.gson; + +import java.io.IOException; +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.apache.commons.text.StringSubstitutor; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; import org.opensearch.common.Strings; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentType; import org.opensearch.commons.authuser.User; @@ -21,20 +34,6 @@ import org.opensearch.ml.common.MLCommonsClassLoader; import org.opensearch.ml.common.output.model.ModelTensor; -import java.io.IOException; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.function.Function; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; -import static org.opensearch.ml.common.utils.StringUtils.gson; - /** * Connector defines how to connect to a remote service. */ diff --git a/common/src/main/java/org/opensearch/ml/common/connector/ConnectorAction.java b/common/src/main/java/org/opensearch/ml/common/connector/ConnectorAction.java index ddb6017099..ae43c10867 100644 --- a/common/src/main/java/org/opensearch/ml/common/connector/ConnectorAction.java +++ b/common/src/main/java/org/opensearch/ml/common/connector/ConnectorAction.java @@ -8,9 +8,9 @@ import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; @@ -19,7 +19,7 @@ import java.util.Locale; import java.util.Map; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Getter @EqualsAndHashCode diff --git a/common/src/main/java/org/opensearch/ml/common/connector/HttpConnector.java b/common/src/main/java/org/opensearch/ml/common/connector/HttpConnector.java index 29586bc856..ab50788bfc 100644 --- a/common/src/main/java/org/opensearch/ml/common/connector/HttpConnector.java +++ b/common/src/main/java/org/opensearch/ml/common/connector/HttpConnector.java @@ -5,34 +5,33 @@ package org.opensearch.ml.common.connector; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.ml.common.connector.ConnectorProtocols.HTTP; +import static org.opensearch.ml.common.connector.ConnectorProtocols.validateProtocol; +import static org.opensearch.ml.common.utils.StringUtils.getParameterMap; +import static org.opensearch.ml.common.utils.StringUtils.isJson; + +import java.io.IOException; +import java.time.Instant; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.extern.log4j.Log4j2; import org.apache.commons.text.StringSubstitutor; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.AccessMode; -import java.io.IOException; -import java.time.Instant; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.function.Function; - -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; -import static org.opensearch.ml.common.connector.ConnectorProtocols.HTTP; -import static org.opensearch.ml.common.connector.ConnectorProtocols.validateProtocol; -import static org.opensearch.ml.common.utils.StringUtils.getParameterMap; -import static org.opensearch.ml.common.utils.StringUtils.isJson; - @Log4j2 @NoArgsConstructor @EqualsAndHashCode diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/AbstractDataFrame.java b/common/src/main/java/org/opensearch/ml/common/dataframe/AbstractDataFrame.java index cff649d778..9984e6281b 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/AbstractDataFrame.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/AbstractDataFrame.java @@ -7,7 +7,7 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import lombok.AccessLevel; import lombok.Getter; diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/BooleanValue.java b/common/src/main/java/org/opensearch/ml/common/dataframe/BooleanValue.java index b4a32403e2..5863903bfc 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/BooleanValue.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/BooleanValue.java @@ -7,7 +7,7 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnMeta.java b/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnMeta.java index 65d32990ce..cfbb6484cb 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnMeta.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnMeta.java @@ -8,9 +8,9 @@ import java.io.IOException; import java.util.Locale; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import lombok.AccessLevel; import lombok.Builder; @@ -22,7 +22,7 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @Getter diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnValue.java b/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnValue.java index 2898e1a876..3a804d3f5e 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnValue.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnValue.java @@ -5,7 +5,7 @@ package org.opensearch.ml.common.dataframe; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnValueReader.java b/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnValueReader.java index 3802fcffb8..c94cae3cf8 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnValueReader.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/ColumnValueReader.java @@ -6,9 +6,8 @@ package org.opensearch.ml.common.dataframe; import java.io.IOException; - -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.Writeable; public class ColumnValueReader implements Writeable.Reader { @Override diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/DataFrame.java b/common/src/main/java/org/opensearch/ml/common/dataframe/DataFrame.java index b593ba5ead..deb6fc8665 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/DataFrame.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/DataFrame.java @@ -5,7 +5,7 @@ package org.opensearch.ml.common.dataframe; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; /** diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/DataFrameBuilder.java b/common/src/main/java/org/opensearch/ml/common/dataframe/DataFrameBuilder.java index 79de3fbf57..c225b742e2 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/DataFrameBuilder.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/DataFrameBuilder.java @@ -11,7 +11,7 @@ import java.util.Map; import java.util.stream.Collectors; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import lombok.experimental.UtilityClass; diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/DefaultDataFrame.java b/common/src/main/java/org/opensearch/ml/common/dataframe/DefaultDataFrame.java index 971fe2bee2..27dd667de6 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/DefaultDataFrame.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/DefaultDataFrame.java @@ -12,8 +12,8 @@ import java.util.List; import java.util.stream.Collectors; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import lombok.AccessLevel; import lombok.ToString; @@ -22,7 +22,7 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @ToString diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/DoubleValue.java b/common/src/main/java/org/opensearch/ml/common/dataframe/DoubleValue.java index 8f92008b7f..d0d84d9871 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/DoubleValue.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/DoubleValue.java @@ -7,7 +7,7 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/FloatValue.java b/common/src/main/java/org/opensearch/ml/common/dataframe/FloatValue.java index f0a60904dd..98727f537b 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/FloatValue.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/FloatValue.java @@ -9,7 +9,7 @@ import lombok.RequiredArgsConstructor; import lombok.ToString; import lombok.experimental.FieldDefaults; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/IntValue.java b/common/src/main/java/org/opensearch/ml/common/dataframe/IntValue.java index 8100ae4f2f..c4e8e72984 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/IntValue.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/IntValue.java @@ -7,7 +7,7 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/LongValue.java b/common/src/main/java/org/opensearch/ml/common/dataframe/LongValue.java index 4818e5b9bc..7d40265732 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/LongValue.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/LongValue.java @@ -9,9 +9,9 @@ import lombok.RequiredArgsConstructor; import lombok.ToString; import lombok.experimental.FieldDefaults; -import org.opensearch.common.io.stream.StreamOutput; import java.io.IOException; +import org.opensearch.core.common.io.stream.StreamOutput; @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @RequiredArgsConstructor diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/NullValue.java b/common/src/main/java/org/opensearch/ml/common/dataframe/NullValue.java index 88b85be5f9..0b829345a0 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/NullValue.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/NullValue.java @@ -7,7 +7,7 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; public class NullValue implements ColumnValue { diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/Row.java b/common/src/main/java/org/opensearch/ml/common/dataframe/Row.java index 563cfe8b74..8727c416e3 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/Row.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/Row.java @@ -8,9 +8,9 @@ import lombok.AccessLevel; import lombok.ToString; import lombok.experimental.FieldDefaults; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; @@ -22,7 +22,7 @@ import java.util.Iterator; import java.util.List; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @ToString diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/ShortValue.java b/common/src/main/java/org/opensearch/ml/common/dataframe/ShortValue.java index 04e689c19f..77de5aecf4 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/ShortValue.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/ShortValue.java @@ -9,7 +9,7 @@ import lombok.RequiredArgsConstructor; import lombok.ToString; import lombok.experimental.FieldDefaults; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/dataframe/StringValue.java b/common/src/main/java/org/opensearch/ml/common/dataframe/StringValue.java index d1c4474af0..f648e69e80 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataframe/StringValue.java +++ b/common/src/main/java/org/opensearch/ml/common/dataframe/StringValue.java @@ -7,7 +7,7 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import lombok.AccessLevel; import lombok.NonNull; diff --git a/common/src/main/java/org/opensearch/ml/common/dataset/DataFrameInputDataset.java b/common/src/main/java/org/opensearch/ml/common/dataset/DataFrameInputDataset.java index d02abe69e2..a535144354 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataset/DataFrameInputDataset.java +++ b/common/src/main/java/org/opensearch/ml/common/dataset/DataFrameInputDataset.java @@ -7,8 +7,8 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.annotation.InputDataSet; import org.opensearch.ml.common.dataframe.DataFrame; diff --git a/common/src/main/java/org/opensearch/ml/common/dataset/MLInputDataset.java b/common/src/main/java/org/opensearch/ml/common/dataset/MLInputDataset.java index e48365877b..2c3514530f 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataset/MLInputDataset.java +++ b/common/src/main/java/org/opensearch/ml/common/dataset/MLInputDataset.java @@ -7,9 +7,9 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import lombok.AccessLevel; import lombok.Getter; diff --git a/common/src/main/java/org/opensearch/ml/common/dataset/SearchQueryInputDataset.java b/common/src/main/java/org/opensearch/ml/common/dataset/SearchQueryInputDataset.java index bcbd2018b1..636384adbc 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataset/SearchQueryInputDataset.java +++ b/common/src/main/java/org/opensearch/ml/common/dataset/SearchQueryInputDataset.java @@ -9,8 +9,8 @@ import java.util.Collections; import java.util.List; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentType; diff --git a/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java b/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java index 32d24c305a..93a26f649c 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java +++ b/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java @@ -9,8 +9,8 @@ import lombok.Builder; import lombok.Getter; import lombok.experimental.FieldDefaults; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.annotation.InputDataSet; import org.opensearch.ml.common.output.model.ModelResultFilter; diff --git a/common/src/main/java/org/opensearch/ml/common/dataset/remote/RemoteInferenceInputDataSet.java b/common/src/main/java/org/opensearch/ml/common/dataset/remote/RemoteInferenceInputDataSet.java index f895c6c629..85a1b72022 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataset/remote/RemoteInferenceInputDataSet.java +++ b/common/src/main/java/org/opensearch/ml/common/dataset/remote/RemoteInferenceInputDataSet.java @@ -5,18 +5,17 @@ package org.opensearch.ml.common.dataset.remote; +import java.io.IOException; +import java.util.Map; import lombok.Builder; import lombok.Getter; import lombok.Setter; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.annotation.InputDataSet; import org.opensearch.ml.common.dataset.MLInputDataType; import org.opensearch.ml.common.dataset.MLInputDataset; -import java.io.IOException; -import java.util.Map; - @Getter @InputDataSet(MLInputDataType.REMOTE) public class RemoteInferenceInputDataSet extends MLInputDataset { diff --git a/common/src/main/java/org/opensearch/ml/common/input/Input.java b/common/src/main/java/org/opensearch/ml/common/input/Input.java index a8b01aef7a..0508979e44 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/Input.java +++ b/common/src/main/java/org/opensearch/ml/common/input/Input.java @@ -5,7 +5,7 @@ package org.opensearch.ml.common.input; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.ml.common.FunctionName; diff --git a/common/src/main/java/org/opensearch/ml/common/input/MLInput.java b/common/src/main/java/org/opensearch/ml/common/input/MLInput.java index 3c822c6f5d..8bbd9630b2 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/MLInput.java +++ b/common/src/main/java/org/opensearch/ml/common/input/MLInput.java @@ -8,8 +8,8 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.MLCommonsClassLoader; @@ -29,7 +29,7 @@ import java.util.List; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; /** * ML input data: algorithm name, parameters and input data set. diff --git a/common/src/main/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInput.java b/common/src/main/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInput.java index 5b649c37f9..6383bf6646 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInput.java +++ b/common/src/main/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInput.java @@ -11,8 +11,8 @@ import java.util.List; import java.util.Optional; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; @@ -28,7 +28,7 @@ import lombok.AllArgsConstructor; import lombok.Data; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; /** diff --git a/common/src/main/java/org/opensearch/ml/common/input/execute/metricscorrelation/MetricsCorrelationInput.java b/common/src/main/java/org/opensearch/ml/common/input/execute/metricscorrelation/MetricsCorrelationInput.java index 8b8f08981b..3de3cee60d 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/execute/metricscorrelation/MetricsCorrelationInput.java +++ b/common/src/main/java/org/opensearch/ml/common/input/execute/metricscorrelation/MetricsCorrelationInput.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.List; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @ExecuteInput(algorithms={FunctionName.METRICS_CORRELATION}) @Data diff --git a/common/src/main/java/org/opensearch/ml/common/input/execute/samplecalculator/LocalSampleCalculatorInput.java b/common/src/main/java/org/opensearch/ml/common/input/execute/samplecalculator/LocalSampleCalculatorInput.java index 9bbcf0ba8c..a4d08fb69f 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/execute/samplecalculator/LocalSampleCalculatorInput.java +++ b/common/src/main/java/org/opensearch/ml/common/input/execute/samplecalculator/LocalSampleCalculatorInput.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.List; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @ExecuteInput(algorithms={FunctionName.LOCAL_SAMPLE_CALCULATOR}) @Data diff --git a/common/src/main/java/org/opensearch/ml/common/input/nlp/TextDocsMLInput.java b/common/src/main/java/org/opensearch/ml/common/input/nlp/TextDocsMLInput.java index cad325154d..3a00c93436 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/nlp/TextDocsMLInput.java +++ b/common/src/main/java/org/opensearch/ml/common/input/nlp/TextDocsMLInput.java @@ -5,8 +5,8 @@ package org.opensearch.ml.common.input.nlp; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.FunctionName; @@ -19,7 +19,7 @@ import java.util.ArrayList; import java.util.List; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; /** * ML input class which supports a list fo text docs. diff --git a/common/src/main/java/org/opensearch/ml/common/input/parameter/MLAlgoParams.java b/common/src/main/java/org/opensearch/ml/common/input/parameter/MLAlgoParams.java index 095362d58f..5462feb256 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/parameter/MLAlgoParams.java +++ b/common/src/main/java/org/opensearch/ml/common/input/parameter/MLAlgoParams.java @@ -5,7 +5,7 @@ package org.opensearch.ml.common.input.parameter; -import org.opensearch.common.io.stream.NamedWriteable; +import org.opensearch.core.common.io.stream.NamedWriteable; import org.opensearch.core.xcontent.ToXContentObject; /** diff --git a/common/src/main/java/org/opensearch/ml/common/input/parameter/ad/AnomalyDetectionLibSVMParams.java b/common/src/main/java/org/opensearch/ml/common/input/parameter/ad/AnomalyDetectionLibSVMParams.java index 86b984e169..87bd3d0d36 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/parameter/ad/AnomalyDetectionLibSVMParams.java +++ b/common/src/main/java/org/opensearch/ml/common/input/parameter/ad/AnomalyDetectionLibSVMParams.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; @@ -20,7 +20,7 @@ import java.io.IOException; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data @MLAlgoParameter(algorithms={FunctionName.AD_LIBSVM}) diff --git a/common/src/main/java/org/opensearch/ml/common/input/parameter/clustering/KMeansParams.java b/common/src/main/java/org/opensearch/ml/common/input/parameter/clustering/KMeansParams.java index 2d19bbc692..73fff86f94 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/parameter/clustering/KMeansParams.java +++ b/common/src/main/java/org/opensearch/ml/common/input/parameter/clustering/KMeansParams.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; @@ -20,7 +20,7 @@ import java.io.IOException; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data @MLAlgoParameter(algorithms={FunctionName.KMEANS}) diff --git a/common/src/main/java/org/opensearch/ml/common/input/parameter/clustering/RCFSummarizeParams.java b/common/src/main/java/org/opensearch/ml/common/input/parameter/clustering/RCFSummarizeParams.java index 37ead7304e..b23461428c 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/parameter/clustering/RCFSummarizeParams.java +++ b/common/src/main/java/org/opensearch/ml/common/input/parameter/clustering/RCFSummarizeParams.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; @@ -19,7 +19,7 @@ import java.io.IOException; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data @MLAlgoParameter(algorithms={FunctionName.RCF_SUMMARIZE}) diff --git a/common/src/main/java/org/opensearch/ml/common/input/parameter/rcf/BatchRCFParams.java b/common/src/main/java/org/opensearch/ml/common/input/parameter/rcf/BatchRCFParams.java index 8cd1eba9ae..3c284a51a6 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/parameter/rcf/BatchRCFParams.java +++ b/common/src/main/java/org/opensearch/ml/common/input/parameter/rcf/BatchRCFParams.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; @@ -19,7 +19,7 @@ import java.io.IOException; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data @MLAlgoParameter(algorithms={FunctionName.BATCH_RCF}) diff --git a/common/src/main/java/org/opensearch/ml/common/input/parameter/rcf/FitRCFParams.java b/common/src/main/java/org/opensearch/ml/common/input/parameter/rcf/FitRCFParams.java index 13b78c6d11..d55fd57735 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/parameter/rcf/FitRCFParams.java +++ b/common/src/main/java/org/opensearch/ml/common/input/parameter/rcf/FitRCFParams.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; @@ -19,7 +19,7 @@ import java.io.IOException; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data @MLAlgoParameter(algorithms={FunctionName.FIT_RCF}) diff --git a/common/src/main/java/org/opensearch/ml/common/input/parameter/regression/LinearRegressionParams.java b/common/src/main/java/org/opensearch/ml/common/input/parameter/regression/LinearRegressionParams.java index d24768f5dd..9e9cb7f129 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/parameter/regression/LinearRegressionParams.java +++ b/common/src/main/java/org/opensearch/ml/common/input/parameter/regression/LinearRegressionParams.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; @@ -20,7 +20,7 @@ import java.io.IOException; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data @MLAlgoParameter(algorithms={FunctionName.LINEAR_REGRESSION}) diff --git a/common/src/main/java/org/opensearch/ml/common/input/parameter/regression/LogisticRegressionParams.java b/common/src/main/java/org/opensearch/ml/common/input/parameter/regression/LogisticRegressionParams.java index ee0fe14223..3340050ff5 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/parameter/regression/LogisticRegressionParams.java +++ b/common/src/main/java/org/opensearch/ml/common/input/parameter/regression/LogisticRegressionParams.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; @@ -20,7 +20,7 @@ import java.io.IOException; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data @MLAlgoParameter(algorithms={FunctionName.LOGISTIC_REGRESSION}) diff --git a/common/src/main/java/org/opensearch/ml/common/input/parameter/sample/SampleAlgoParams.java b/common/src/main/java/org/opensearch/ml/common/input/parameter/sample/SampleAlgoParams.java index 9ad1e58583..2544a748f5 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/parameter/sample/SampleAlgoParams.java +++ b/common/src/main/java/org/opensearch/ml/common/input/parameter/sample/SampleAlgoParams.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; @@ -19,7 +19,7 @@ import java.io.IOException; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data @MLAlgoParameter(algorithms={FunctionName.SAMPLE_ALGO}) diff --git a/common/src/main/java/org/opensearch/ml/common/input/remote/RemoteInferenceMLInput.java b/common/src/main/java/org/opensearch/ml/common/input/remote/RemoteInferenceMLInput.java index 6b262129c4..412e7a8e7e 100644 --- a/common/src/main/java/org/opensearch/ml/common/input/remote/RemoteInferenceMLInput.java +++ b/common/src/main/java/org/opensearch/ml/common/input/remote/RemoteInferenceMLInput.java @@ -5,24 +5,18 @@ package org.opensearch.ml.common.input.remote; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; + +import java.io.IOException; +import java.util.Map; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.dataset.remote.RemoteInferenceInputDataSet; import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.utils.StringUtils; -import java.io.IOException; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.util.HashMap; -import java.util.Map; - -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; -import static org.opensearch.ml.common.utils.StringUtils.gson; - @org.opensearch.ml.common.annotation.MLInput(functionNames = {FunctionName.REMOTE}) public class RemoteInferenceMLInput extends MLInput { public static final String PARAMETERS_FIELD = "parameters"; diff --git a/common/src/main/java/org/opensearch/ml/common/model/MLModelConfig.java b/common/src/main/java/org/opensearch/ml/common/model/MLModelConfig.java index 3a3c83005a..2fb07b6d8e 100644 --- a/common/src/main/java/org/opensearch/ml/common/model/MLModelConfig.java +++ b/common/src/main/java/org/opensearch/ml/common/model/MLModelConfig.java @@ -7,9 +7,9 @@ import lombok.Getter; import lombok.Setter; -import org.opensearch.common.io.stream.NamedWriteable; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.NamedWriteable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/model/MetricsCorrelationModelConfig.java b/common/src/main/java/org/opensearch/ml/common/model/MetricsCorrelationModelConfig.java index 31b4d5084e..4f26e4b4d2 100644 --- a/common/src/main/java/org/opensearch/ml/common/model/MetricsCorrelationModelConfig.java +++ b/common/src/main/java/org/opensearch/ml/common/model/MetricsCorrelationModelConfig.java @@ -15,7 +15,7 @@ import java.io.IOException; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Setter @Getter diff --git a/common/src/main/java/org/opensearch/ml/common/model/TextEmbeddingModelConfig.java b/common/src/main/java/org/opensearch/ml/common/model/TextEmbeddingModelConfig.java index b64c13a5eb..dbb15fa2d6 100644 --- a/common/src/main/java/org/opensearch/ml/common/model/TextEmbeddingModelConfig.java +++ b/common/src/main/java/org/opensearch/ml/common/model/TextEmbeddingModelConfig.java @@ -8,8 +8,8 @@ import lombok.Builder; import lombok.Getter; import lombok.Setter; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; @@ -20,7 +20,7 @@ import java.io.IOException; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Setter @Getter diff --git a/common/src/main/java/org/opensearch/ml/common/output/MLOutput.java b/common/src/main/java/org/opensearch/ml/common/output/MLOutput.java index 091e3d0d4b..83fbfe1cc1 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/MLOutput.java +++ b/common/src/main/java/org/opensearch/ml/common/output/MLOutput.java @@ -7,8 +7,8 @@ import lombok.NonNull; import lombok.RequiredArgsConstructor; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.MLCommonsClassLoader; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/output/MLPredictionOutput.java b/common/src/main/java/org/opensearch/ml/common/output/MLPredictionOutput.java index 78851da82b..28b5b07821 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/MLPredictionOutput.java +++ b/common/src/main/java/org/opensearch/ml/common/output/MLPredictionOutput.java @@ -9,8 +9,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.annotation.MLAlgoOutput; import org.opensearch.ml.common.dataframe.DataFrame; diff --git a/common/src/main/java/org/opensearch/ml/common/output/MLTrainingOutput.java b/common/src/main/java/org/opensearch/ml/common/output/MLTrainingOutput.java index 49b1737c99..c69bb9ca74 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/MLTrainingOutput.java +++ b/common/src/main/java/org/opensearch/ml/common/output/MLTrainingOutput.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Getter; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.annotation.MLAlgoOutput; diff --git a/common/src/main/java/org/opensearch/ml/common/output/Output.java b/common/src/main/java/org/opensearch/ml/common/output/Output.java index 0d1f3a455d..b90ba234b9 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/Output.java +++ b/common/src/main/java/org/opensearch/ml/common/output/Output.java @@ -5,7 +5,7 @@ package org.opensearch.ml.common.output; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; public interface Output extends ToXContentObject, Writeable { diff --git a/common/src/main/java/org/opensearch/ml/common/output/execute/anomalylocalization/AnomalyLocalizationOutput.java b/common/src/main/java/org/opensearch/ml/common/output/execute/anomalylocalization/AnomalyLocalizationOutput.java index 919fdf43a2..dde28400b7 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/execute/anomalylocalization/AnomalyLocalizationOutput.java +++ b/common/src/main/java/org/opensearch/ml/common/output/execute/anomalylocalization/AnomalyLocalizationOutput.java @@ -13,8 +13,8 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicBoolean; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import lombok.Data; import lombok.EqualsAndHashCode; @@ -28,7 +28,7 @@ import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.output.Output; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; /** * Output of localized results. diff --git a/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MCorrModelTensor.java b/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MCorrModelTensor.java index 1ee0c33182..a8dc54481b 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MCorrModelTensor.java +++ b/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MCorrModelTensor.java @@ -7,9 +7,9 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MCorrModelTensors.java b/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MCorrModelTensors.java index 41d355bf3c..d26a9e8b0e 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MCorrModelTensors.java +++ b/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MCorrModelTensors.java @@ -8,11 +8,11 @@ import lombok.Builder; import lombok.Getter; import lombok.extern.log4j.Log4j2; -import org.opensearch.common.bytes.BytesReference; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.exception.MLException; diff --git a/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MetricsCorrelationOutput.java b/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MetricsCorrelationOutput.java index d7b1269b7c..baa4efc76c 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MetricsCorrelationOutput.java +++ b/common/src/main/java/org/opensearch/ml/common/output/execute/metrics_correlation/MetricsCorrelationOutput.java @@ -9,8 +9,8 @@ import lombok.Data; import lombok.SneakyThrows; import lombok.extern.log4j.Log4j2; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.FunctionName; diff --git a/common/src/main/java/org/opensearch/ml/common/output/execute/samplecalculator/LocalSampleCalculatorOutput.java b/common/src/main/java/org/opensearch/ml/common/output/execute/samplecalculator/LocalSampleCalculatorOutput.java index c9b02609f8..33e17a60c0 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/execute/samplecalculator/LocalSampleCalculatorOutput.java +++ b/common/src/main/java/org/opensearch/ml/common/output/execute/samplecalculator/LocalSampleCalculatorOutput.java @@ -7,8 +7,8 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.annotation.ExecuteOutput; diff --git a/common/src/main/java/org/opensearch/ml/common/output/model/ModelResultFilter.java b/common/src/main/java/org/opensearch/ml/common/output/model/ModelResultFilter.java index d5eaf8fce0..2817997849 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/model/ModelResultFilter.java +++ b/common/src/main/java/org/opensearch/ml/common/output/model/ModelResultFilter.java @@ -4,16 +4,16 @@ import lombok.Builder; import lombok.Getter; import lombok.experimental.FieldDefaults; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; /** * This class is to filter model results. diff --git a/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensor.java b/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensor.java index 247c922be8..8957f33643 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensor.java +++ b/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensor.java @@ -5,15 +5,8 @@ package org.opensearch.ml.common.output.model; -import lombok.Builder; -import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; -import org.opensearch.core.xcontent.ToXContent; -import org.opensearch.core.xcontent.ToXContentObject; -import org.opensearch.core.xcontent.XContentBuilder; -import org.opensearch.core.xcontent.XContentParser; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.ml.common.utils.StringUtils.gson; import java.io.IOException; import java.nio.ByteBuffer; @@ -24,9 +17,15 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; - -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; -import static org.opensearch.ml.common.utils.StringUtils.gson; +import lombok.Builder; +import lombok.Data; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; +import org.opensearch.core.xcontent.ToXContent; +import org.opensearch.core.xcontent.ToXContentObject; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; @Data public class ModelTensor implements Writeable, ToXContentObject { diff --git a/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensorOutput.java b/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensorOutput.java index c349762190..664bd3510f 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensorOutput.java +++ b/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensorOutput.java @@ -8,8 +8,8 @@ import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.annotation.MLAlgoOutput; import org.opensearch.ml.common.output.MLOutput; diff --git a/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensors.java b/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensors.java index 994298da63..9073345550 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensors.java +++ b/common/src/main/java/org/opensearch/ml/common/output/model/ModelTensors.java @@ -7,11 +7,11 @@ import lombok.Builder; import lombok.Getter; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.exception.MLException; diff --git a/common/src/main/java/org/opensearch/ml/common/output/sample/SampleAlgoOutput.java b/common/src/main/java/org/opensearch/ml/common/output/sample/SampleAlgoOutput.java index 7dc1838123..2fe4ab540b 100644 --- a/common/src/main/java/org/opensearch/ml/common/output/sample/SampleAlgoOutput.java +++ b/common/src/main/java/org/opensearch/ml/common/output/sample/SampleAlgoOutput.java @@ -8,8 +8,9 @@ import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.annotation.MLAlgoOutput; import org.opensearch.ml.common.output.MLOutput; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/MLTaskRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/MLTaskRequest.java index 900d7728f8..bf77427806 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/MLTaskRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/MLTaskRequest.java @@ -9,8 +9,8 @@ import lombok.Setter; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; import java.util.UUID; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/MLTaskResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/MLTaskResponse.java index 71934cc13d..207e7f81d7 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/MLTaskResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/MLTaskResponse.java @@ -9,10 +9,10 @@ import lombok.Getter; import lombok.ToString; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.output.MLOutput; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorDeleteRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorDeleteRequest.java index a3dd2d6f93..9da5be98aa 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorDeleteRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorDeleteRequest.java @@ -9,10 +9,10 @@ import lombok.Getter; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorGetRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorGetRequest.java index 6b4b7dead1..118a70ccde 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorGetRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorGetRequest.java @@ -9,10 +9,10 @@ import lombok.Getter; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorGetResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorGetResponse.java index 5bcedf5a52..43425bfd95 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorGetResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLConnectorGetResponse.java @@ -7,10 +7,10 @@ import lombok.Builder; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInput.java b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInput.java index 43568afb05..35f8090a67 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInput.java @@ -7,9 +7,9 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.common.util.CollectionUtils; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; @@ -23,7 +23,7 @@ import java.util.List; import java.util.Map; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data public class MLCreateConnectorInput implements ToXContentObject, Writeable { diff --git a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorRequest.java index fc4f8002ca..107d5001b8 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorRequest.java @@ -9,10 +9,10 @@ import lombok.Getter; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -66,4 +66,4 @@ public static MLCreateConnectorRequest fromActionRequest(ActionRequest actionReq throw new UncheckedIOException("Failed to parse ActionRequest into MLCreateConnectorRequest", e); } } -} \ No newline at end of file +} diff --git a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorResponse.java index b91ad80e45..d3aad6eca4 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorResponse.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelInput.java b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelInput.java index 71e1675511..ae30dd45f5 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelInput.java @@ -5,15 +5,14 @@ package org.opensearch.ml.common.transport.deploy; +import java.io.IOException; import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.ml.common.MLTask; -import java.io.IOException; - @Data public class MLDeployModelInput implements Writeable { private String modelId; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodeRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodeRequest.java index e8acd047eb..ffa30072e0 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodeRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodeRequest.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.support.nodes.BaseNodeRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodeResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodeResponse.java index 23e80a38f5..e2a0cbf084 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodeResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodeResponse.java @@ -8,8 +8,8 @@ import lombok.extern.log4j.Log4j2; import org.opensearch.action.support.nodes.BaseNodeResponse; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesRequest.java index 310e580793..e2c8043b04 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesRequest.java @@ -8,8 +8,8 @@ import lombok.Getter; import org.opensearch.action.support.nodes.BaseNodesRequest; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesResponse.java index 8ccecec4f0..c27abebfaf 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesResponse.java @@ -9,8 +9,8 @@ import org.opensearch.action.support.nodes.BaseNodesResponse; import org.opensearch.cluster.ClusterName; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelRequest.java index ad941ccd93..b0ad113d95 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelRequest.java @@ -12,10 +12,10 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.transport.MLTaskRequest; @@ -27,7 +27,7 @@ import java.util.List; import static org.opensearch.action.ValidateActions.addValidationError; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Getter @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) diff --git a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelResponse.java index 0a07000217..b3adae463d 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/deploy/MLDeployModelResponse.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/execute/MLExecuteTaskRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/execute/MLExecuteTaskRequest.java index bb3fdd70b7..e772b78d2d 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/execute/MLExecuteTaskRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/execute/MLExecuteTaskRequest.java @@ -13,10 +13,10 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.MLCommonsClassLoader; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.input.Input; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/execute/MLExecuteTaskResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/execute/MLExecuteTaskResponse.java index 5d40840a4e..db3f338e39 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/execute/MLExecuteTaskResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/execute/MLExecuteTaskResponse.java @@ -10,10 +10,10 @@ import lombok.NonNull; import lombok.ToString; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.FunctionName; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardInput.java b/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardInput.java index 5c8f042b89..624cec3c7d 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardInput.java @@ -8,9 +8,9 @@ import lombok.Builder; import lombok.Data; import lombok.extern.log4j.Log4j2; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.transport.register.MLRegisterModelInput; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardRequest.java index 9396e32373..7d2949fd3a 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardRequest.java @@ -13,10 +13,10 @@ import lombok.extern.log4j.Log4j2; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardResponse.java index 4304a9e0a0..1f9820b1bc 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/forward/MLForwardResponse.java @@ -9,10 +9,10 @@ import lombok.Getter; import lombok.ToString; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelDeleteRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelDeleteRequest.java index 6ec5d9f668..a42cf1d071 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelDeleteRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelDeleteRequest.java @@ -9,10 +9,10 @@ import lombok.Getter; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelGetRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelGetRequest.java index 71b4fbca9a..71c5200971 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelGetRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelGetRequest.java @@ -12,10 +12,10 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelGetResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelGetResponse.java index a2f4938429..d503963599 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelGetResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model/MLModelGetResponse.java @@ -9,10 +9,10 @@ import lombok.Getter; import lombok.ToString; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLModelGroupDeleteRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLModelGroupDeleteRequest.java index e18293d012..8c5326ab8d 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLModelGroupDeleteRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLModelGroupDeleteRequest.java @@ -9,10 +9,10 @@ import lombok.Getter; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupInput.java b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupInput.java index 960be8a08b..4595a16d77 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupInput.java @@ -7,9 +7,9 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; @@ -20,7 +20,7 @@ import java.util.List; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data public class MLRegisterModelGroupInput implements ToXContentObject, Writeable{ diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupRequest.java index c4aee784d9..3bf3dabd03 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupRequest.java @@ -12,10 +12,10 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupResponse.java index ffce71751b..368fcf3cbc 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupResponse.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupInput.java b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupInput.java index 693b3d108a..22e612a5b1 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupInput.java @@ -7,9 +7,9 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; @@ -20,7 +20,7 @@ import java.util.List; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data public class MLUpdateModelGroupInput implements ToXContentObject, Writeable { diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupRequest.java index 027425b19a..aecb62a8d2 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupRequest.java @@ -12,10 +12,10 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupResponse.java index 336c6d2723..ced4d70562 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupResponse.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskRequest.java index 3919cb8ed7..3345b90bba 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskRequest.java @@ -5,30 +5,28 @@ package org.opensearch.ml.common.transport.prediction; +import static org.opensearch.action.ValidateActions.addValidationError; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.UncheckedIOException; - -import lombok.Setter; -import org.opensearch.action.ActionRequest; -import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.commons.authuser.User; -import org.opensearch.ml.common.input.MLInput; - import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; +import lombok.Setter; import lombok.ToString; import lombok.experimental.FieldDefaults; +import org.opensearch.action.ActionRequest; +import org.opensearch.action.ActionRequestValidationException; +import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.transport.MLTaskRequest; -import static org.opensearch.action.ValidateActions.addValidationError; - @Getter @FieldDefaults(level = AccessLevel.PRIVATE) @ToString diff --git a/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelInput.java b/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelInput.java index a9641dedfa..384d375fd0 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelInput.java @@ -7,15 +7,14 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.AccessMode; import org.opensearch.ml.common.FunctionName; -import org.opensearch.ml.common.MLCommonsClassLoader; import org.opensearch.ml.common.connector.Connector; import org.opensearch.ml.common.model.MLModelConfig; import org.opensearch.ml.common.model.MLModelFormat; @@ -26,9 +25,10 @@ import java.util.List; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.connector.Connector.createConnector; + /** * ML input data: algirithm name, parameters and input data set. */ diff --git a/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelRequest.java index b8e83291fb..b57b65c524 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelRequest.java @@ -12,10 +12,10 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelResponse.java index 25c1a8be45..7144875a71 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/register/MLRegisterModelResponse.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpInput.java b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpInput.java index a6c4dd1afe..de04b2936d 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpInput.java @@ -7,9 +7,9 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import java.io.IOException; import java.util.Map; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeRequest.java index 6ef2974e43..a7a468502a 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeRequest.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.support.nodes.BaseNodeRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeResponse.java index 34e0af6d83..e7ac993fba 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeResponse.java @@ -9,8 +9,8 @@ import lombok.extern.log4j.Log4j2; import org.opensearch.action.support.nodes.BaseNodeResponse; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodesRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodesRequest.java index 3543d670bb..56ec920f5f 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodesRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodesRequest.java @@ -8,8 +8,8 @@ import lombok.Getter; import org.opensearch.action.support.nodes.BaseNodesRequest; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodesResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodesResponse.java index 9905b16b87..dee614685c 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodesResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodesResponse.java @@ -8,8 +8,8 @@ import org.opensearch.action.FailedNodeException; import org.opensearch.action.support.nodes.BaseNodesResponse; import org.opensearch.cluster.ClusterName; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; import java.util.List; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpResponse.java index faac5abcaf..c5e68a9006 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/sync/MLSyncUpResponse.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskDeleteRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskDeleteRequest.java index 3a2ee8e803..a7782a60ea 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskDeleteRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskDeleteRequest.java @@ -9,10 +9,10 @@ import lombok.Getter; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskGetRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskGetRequest.java index a98ed48281..06145adef7 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskGetRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskGetRequest.java @@ -10,10 +10,10 @@ import lombok.Getter; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskGetResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskGetResponse.java index 4951a8c099..3efef6dfe7 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskGetResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/task/MLTaskGetResponse.java @@ -8,10 +8,10 @@ import lombok.Builder; import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/training/MLTrainingTaskRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/training/MLTrainingTaskRequest.java index a8099d415c..e03f1e8dda 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/training/MLTrainingTaskRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/training/MLTrainingTaskRequest.java @@ -12,10 +12,10 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.transport.MLTaskRequest; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInput.java b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInput.java index 1b8e78705b..d0e399f291 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInput.java @@ -7,9 +7,9 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; @@ -19,7 +19,7 @@ import java.util.ArrayList; import java.util.List; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data public class MLUndeployModelInput implements ToXContentObject, Writeable { diff --git a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodeRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodeRequest.java index b0416cb1be..58a20af248 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodeRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodeRequest.java @@ -5,12 +5,11 @@ package org.opensearch.ml.common.transport.undeploy; +import java.io.IOException; import lombok.Getter; import org.opensearch.action.support.nodes.BaseNodeRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; - -import java.io.IOException; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; public class MLUndeployModelNodeRequest extends BaseNodeRequest { @Getter diff --git a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodeResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodeResponse.java index 8aca2c25da..2af72a6d6a 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodeResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodeResponse.java @@ -8,8 +8,8 @@ import lombok.Getter; import org.opensearch.action.support.nodes.BaseNodeResponse; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesRequest.java index a428605fa7..cea0d484fe 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesRequest.java @@ -8,8 +8,8 @@ import lombok.Getter; import org.opensearch.action.support.nodes.BaseNodesRequest; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesResponse.java index fd758e0051..3728f4dd8e 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesResponse.java @@ -9,8 +9,8 @@ import org.opensearch.action.support.nodes.BaseNodesResponse; import org.opensearch.cluster.ClusterName; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelsRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelsRequest.java index c7545382c4..c586698025 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelsRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelsRequest.java @@ -5,6 +5,14 @@ package org.opensearch.ml.common.transport.undeploy; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.ArrayList; +import java.util.List; import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; @@ -12,22 +20,13 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.transport.MLTaskRequest; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.util.ArrayList; -import java.util.List; - -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; - @Getter @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @ToString @@ -120,4 +119,4 @@ public static MLUndeployModelsRequest fromActionRequest(ActionRequest actionRequ } -} \ No newline at end of file +} diff --git a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelsResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelsResponse.java index 5ebc91948d..851b065482 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelsResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelsResponse.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaInput.java b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaInput.java index 3b45fe37fe..0fce0053d1 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaInput.java @@ -7,9 +7,9 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; @@ -26,7 +26,7 @@ import java.util.List; import java.util.Locale; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data public class MLRegisterModelMetaInput implements ToXContentObject, Writeable{ diff --git a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaRequest.java index c07b2ec53c..dbfc9283fc 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaRequest.java @@ -12,10 +12,10 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaResponse.java index 6ab43adb47..e58e6bfc1f 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaResponse.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInput.java b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInput.java index eb8e1de979..256c4b1fe4 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInput.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInput.java @@ -7,9 +7,9 @@ import lombok.Builder; import lombok.Data; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; @@ -17,7 +17,7 @@ import java.io.IOException; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; @Data public class MLUploadModelChunkInput implements ToXContentObject, Writeable { diff --git a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkRequest.java b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkRequest.java index f51e5a9e65..253d13c1ed 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkRequest.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkRequest.java @@ -12,10 +12,11 @@ import lombok.experimental.FieldDefaults; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkResponse.java index 8da597bbac..c30fa685d4 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkResponse.java @@ -7,8 +7,8 @@ import lombok.Getter; import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/test/java/org/opensearch/ml/common/MLCommonsClassLoaderTests.java b/common/src/test/java/org/opensearch/ml/common/MLCommonsClassLoaderTests.java index 3da2165764..94cba5295f 100644 --- a/common/src/test/java/org/opensearch/ml/common/MLCommonsClassLoaderTests.java +++ b/common/src/test/java/org/opensearch/ml/common/MLCommonsClassLoaderTests.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.NamedXContentRegistry; diff --git a/common/src/test/java/org/opensearch/ml/common/MLModelTests.java b/common/src/test/java/org/opensearch/ml/common/MLModelTests.java index f81f2df89e..b59fa2ac2a 100644 --- a/common/src/test/java/org/opensearch/ml/common/MLModelTests.java +++ b/common/src/test/java/org/opensearch/ml/common/MLModelTests.java @@ -8,7 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentType; import org.opensearch.commons.authuser.User; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/test/java/org/opensearch/ml/common/RemoteModelTests.java b/common/src/test/java/org/opensearch/ml/common/RemoteModelTests.java index bcbcc149c9..10c5d0515f 100644 --- a/common/src/test/java/org/opensearch/ml/common/RemoteModelTests.java +++ b/common/src/test/java/org/opensearch/ml/common/RemoteModelTests.java @@ -5,23 +5,22 @@ package org.opensearch.ml.common; +import static org.junit.Assert.assertEquals; +import static org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS; + +import java.io.IOException; import org.junit.Assert; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.connector.Connector; import org.opensearch.ml.common.connector.HttpConnectorTest; -import java.io.IOException; - -import static org.junit.Assert.assertEquals; -import static org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS; - public class RemoteModelTests { @Test diff --git a/common/src/test/java/org/opensearch/ml/common/TestHelper.java b/common/src/test/java/org/opensearch/ml/common/TestHelper.java index 6d927f4a66..9377b123e8 100644 --- a/common/src/test/java/org/opensearch/ml/common/TestHelper.java +++ b/common/src/test/java/org/opensearch/ml/common/TestHelper.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common; import org.opensearch.common.Strings; -import org.opensearch.common.bytes.BytesReference; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/DefaultDataFrameTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/DefaultDataFrameTest.java index ede1084f85..1249df6ec5 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/DefaultDataFrameTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/DefaultDataFrameTest.java @@ -16,7 +16,7 @@ import org.junit.rules.ExpectedException; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/common/src/test/java/org/opensearch/ml/common/dataset/SearchQueryInputDatasetTest.java b/common/src/test/java/org/opensearch/ml/common/dataset/SearchQueryInputDatasetTest.java index 7368294b98..d1a3af0ce2 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataset/SearchQueryInputDatasetTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataset/SearchQueryInputDatasetTest.java @@ -13,7 +13,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.index.query.MatchAllQueryBuilder; import org.opensearch.search.builder.SearchSourceBuilder; diff --git a/common/src/test/java/org/opensearch/ml/common/dataset/remote/RemoteInferenceInputDataSetTest.java b/common/src/test/java/org/opensearch/ml/common/dataset/remote/RemoteInferenceInputDataSetTest.java index 618bc336a7..55381895ee 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataset/remote/RemoteInferenceInputDataSetTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataset/remote/RemoteInferenceInputDataSetTest.java @@ -1,16 +1,15 @@ package org.opensearch.ml.common.dataset.remote; -import org.junit.Assert; -import org.junit.Test; -import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.ml.common.dataset.MLInputDataset; +import static org.opensearch.ml.common.dataset.MLInputDataType.REMOTE; import java.io.IOException; import java.util.HashMap; import java.util.Map; - -import static org.opensearch.ml.common.dataset.MLInputDataType.REMOTE; +import org.junit.Assert; +import org.junit.Test; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.ml.common.dataset.MLInputDataset; public class RemoteInferenceInputDataSetTest { diff --git a/common/src/test/java/org/opensearch/ml/common/input/MLInputTest.java b/common/src/test/java/org/opensearch/ml/common/input/MLInputTest.java index d7752d74b3..599acad25e 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/MLInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/MLInputTest.java @@ -12,7 +12,7 @@ import org.junit.rules.ExpectedException; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; diff --git a/common/src/test/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInputTests.java b/common/src/test/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInputTests.java index 7697f1a6d9..a3f1502652 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInputTests.java +++ b/common/src/test/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInputTests.java @@ -12,9 +12,9 @@ import org.junit.Test; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.opensearch.common.io.stream.NamedWriteableRegistry; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; diff --git a/common/src/test/java/org/opensearch/ml/common/input/execute/metricscorrelation/MetricsCorrelationInputTest.java b/common/src/test/java/org/opensearch/ml/common/input/execute/metricscorrelation/MetricsCorrelationInputTest.java index 31d684e0aa..832e07b7e7 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/execute/metricscorrelation/MetricsCorrelationInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/execute/metricscorrelation/MetricsCorrelationInputTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/input/execute/samplecalculator/LocalSampleCalculatorInputTest.java b/common/src/test/java/org/opensearch/ml/common/input/execute/samplecalculator/LocalSampleCalculatorInputTest.java index 8e25783265..fec5c99ced 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/execute/samplecalculator/LocalSampleCalculatorInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/execute/samplecalculator/LocalSampleCalculatorInputTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/input/parameter/ad/AnomalyDetectionLibSVMParamsTest.java b/common/src/test/java/org/opensearch/ml/common/input/parameter/ad/AnomalyDetectionLibSVMParamsTest.java index 1dd6e21192..544f43ec1e 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/parameter/ad/AnomalyDetectionLibSVMParamsTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/parameter/ad/AnomalyDetectionLibSVMParamsTest.java @@ -8,7 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/input/parameter/clustering/KMeansParamsTest.java b/common/src/test/java/org/opensearch/ml/common/input/parameter/clustering/KMeansParamsTest.java index 3f339cf92e..b4cd2f0c81 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/parameter/clustering/KMeansParamsTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/parameter/clustering/KMeansParamsTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/input/parameter/clustering/RCFSummarizeParamsTest.java b/common/src/test/java/org/opensearch/ml/common/input/parameter/clustering/RCFSummarizeParamsTest.java index f4739d7020..0a29ebfffa 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/parameter/clustering/RCFSummarizeParamsTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/parameter/clustering/RCFSummarizeParamsTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/input/parameter/rcf/BatchRCFParamsTest.java b/common/src/test/java/org/opensearch/ml/common/input/parameter/rcf/BatchRCFParamsTest.java index a87e7bd8da..7137763146 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/parameter/rcf/BatchRCFParamsTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/parameter/rcf/BatchRCFParamsTest.java @@ -8,7 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/input/parameter/rcf/FitRCFParamsTest.java b/common/src/test/java/org/opensearch/ml/common/input/parameter/rcf/FitRCFParamsTest.java index ab6feaf7b4..e87973a98a 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/parameter/rcf/FitRCFParamsTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/parameter/rcf/FitRCFParamsTest.java @@ -8,7 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/input/parameter/regression/LinearRegressionParamsTest.java b/common/src/test/java/org/opensearch/ml/common/input/parameter/regression/LinearRegressionParamsTest.java index 6345d9d6a3..be71883e92 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/parameter/regression/LinearRegressionParamsTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/parameter/regression/LinearRegressionParamsTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/input/parameter/regression/LogisticRegressionParamsTest.java b/common/src/test/java/org/opensearch/ml/common/input/parameter/regression/LogisticRegressionParamsTest.java index d4df3830b2..ab45c9e41e 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/parameter/regression/LogisticRegressionParamsTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/parameter/regression/LogisticRegressionParamsTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/model/TextEmbeddingModelConfigTests.java b/common/src/test/java/org/opensearch/ml/common/model/TextEmbeddingModelConfigTests.java index 1e31b308dd..acba744ced 100644 --- a/common/src/test/java/org/opensearch/ml/common/model/TextEmbeddingModelConfigTests.java +++ b/common/src/test/java/org/opensearch/ml/common/model/TextEmbeddingModelConfigTests.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; diff --git a/common/src/test/java/org/opensearch/ml/common/output/MLPredictionOutputTest.java b/common/src/test/java/org/opensearch/ml/common/output/MLPredictionOutputTest.java index 99d1c71605..7702f224d6 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/MLPredictionOutputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/MLPredictionOutputTest.java @@ -9,7 +9,7 @@ import org.junit.Test; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.ToXContent; diff --git a/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MCorrModelTensorTest.java b/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MCorrModelTensorTest.java index 2220d8aea3..e600fa3325 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MCorrModelTensorTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MCorrModelTensorTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MCorrModelTensorsTest.java b/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MCorrModelTensorsTest.java index 12eef1600f..516a50cb5b 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MCorrModelTensorsTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MCorrModelTensorsTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MetricsCorrelationOutputTest.java b/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MetricsCorrelationOutputTest.java index 12d1973ea3..6cd7c3ec3f 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MetricsCorrelationOutputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/execute/metricscorrelation/MetricsCorrelationOutputTest.java @@ -8,7 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.ml.common.output.execute.metrics_correlation.MCorrModelTensor; import org.opensearch.ml.common.output.execute.metrics_correlation.MCorrModelTensors; import org.opensearch.ml.common.output.execute.metrics_correlation.MetricsCorrelationOutput; diff --git a/common/src/test/java/org/opensearch/ml/common/output/execute/samplecalculator/LocalSampleCalculatorOutputTest.java b/common/src/test/java/org/opensearch/ml/common/output/execute/samplecalculator/LocalSampleCalculatorOutputTest.java index 0e47a75a64..ca2e6fc46d 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/execute/samplecalculator/LocalSampleCalculatorOutputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/execute/samplecalculator/LocalSampleCalculatorOutputTest.java @@ -9,7 +9,7 @@ import org.junit.Test; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.ToXContent; diff --git a/common/src/test/java/org/opensearch/ml/common/output/model/ModelResultFilterTest.java b/common/src/test/java/org/opensearch/ml/common/output/model/ModelResultFilterTest.java index 3bda884191..8b1434d35a 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/model/ModelResultFilterTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/model/ModelResultFilterTest.java @@ -3,7 +3,7 @@ import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import java.io.IOException; import java.util.Arrays; diff --git a/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorOutputTest.java b/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorOutputTest.java index b3eb8601b9..d9f4c2c968 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorOutputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorOutputTest.java @@ -3,7 +3,7 @@ import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.ml.common.output.MLOutputType; import java.io.IOException; diff --git a/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorTest.java b/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorTest.java index a3552fba3b..68904cb390 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorsTest.java b/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorsTest.java index 55ed9b9c5a..f8e3fee984 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorsTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/model/ModelTensorsTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.TestHelper; diff --git a/common/src/test/java/org/opensearch/ml/common/output/sample/SampleAlgoOutputTest.java b/common/src/test/java/org/opensearch/ml/common/output/sample/SampleAlgoOutputTest.java index d11b6f6acf..06e6274a25 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/sample/SampleAlgoOutputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/sample/SampleAlgoOutputTest.java @@ -9,7 +9,7 @@ import org.junit.Test; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.ToXContent; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorDeleteRequestTests.java b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorDeleteRequestTests.java index 27bb438599..5002435ad3 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorDeleteRequestTests.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorDeleteRequestTests.java @@ -5,20 +5,19 @@ package org.opensearch.ml.common.transport.connector; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + +import java.io.IOException; +import java.io.UncheckedIOException; import org.junit.Before; import org.junit.Test; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; - -import java.io.IOException; -import java.io.UncheckedIOException; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; +import org.opensearch.core.common.io.stream.StreamOutput; public class MLConnectorDeleteRequestTests { private String connectorId; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorGetRequestTests.java b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorGetRequestTests.java index 0113aca7d6..53fcce560b 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorGetRequestTests.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorGetRequestTests.java @@ -14,7 +14,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorGetResponseTests.java b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorGetResponseTests.java index 69a19255e8..45c8c5746c 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorGetResponseTests.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLConnectorGetResponseTests.java @@ -5,28 +5,27 @@ package org.opensearch.ml.common.transport.connector; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; + +import java.io.IOException; +import java.io.UncheckedIOException; import org.junit.Before; import org.junit.Test; import org.opensearch.action.ActionResponse; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.connector.Connector; import org.opensearch.ml.common.connector.HttpConnectorTest; -import java.io.IOException; -import java.io.UncheckedIOException; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; - public class MLConnectorGetResponseTests { Connector connector; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInputTests.java b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInputTests.java index c037da1529..aeaff7d000 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInputTests.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInputTests.java @@ -5,29 +5,29 @@ package org.opensearch.ml.common.transport.connector; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + import java.io.IOException; -import java.io.UncheckedIOException; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.Consumer; - import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.opensearch.action.ActionRequest; -import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; @@ -38,13 +38,6 @@ import org.opensearch.ml.common.connector.MLPreProcessFunction; import org.opensearch.search.SearchModule; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - public class MLCreateConnectorInputTests { private MLCreateConnectorInput mlCreateConnectorInput; private MLCreateConnectorInput mlCreateDryRunConnectorInput; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorRequestTests.java b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorRequestTests.java index 6fe82d7f2b..10f31da13d 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorRequestTests.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorRequestTests.java @@ -5,30 +5,28 @@ package org.opensearch.ml.common.transport.connector; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + import java.io.IOException; import java.io.UncheckedIOException; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; - import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.AccessMode; import org.opensearch.ml.common.connector.ConnectorAction; import org.opensearch.ml.common.connector.MLPostProcessFunction; import org.opensearch.ml.common.connector.MLPreProcessFunction; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; - public class MLCreateConnectorRequestTests { private MLCreateConnectorInput mlCreateConnectorInput; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelInputTest.java index 7c340d8bde..e3f1583f13 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelInputTest.java @@ -5,7 +5,7 @@ import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.MLTaskState; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesRequestTest.java index e27020bd81..871865478c 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelNodesRequestTest.java @@ -8,7 +8,7 @@ import org.opensearch.Version; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.transport.TransportAddress; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLTask; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelRequestTest.java index 8992c1bb2c..e2945dc212 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelRequestTest.java @@ -5,7 +5,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.*; import org.opensearch.core.xcontent.NamedXContentRegistry; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardInputTest.java index f7f1b6901d..d9b3fc77c4 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardInputTest.java @@ -5,7 +5,7 @@ import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.MLTaskState; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardRequestTest.java index 735b459c22..b0eabfcb83 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardRequestTest.java @@ -7,7 +7,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.MLTaskState; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardResponseTest.java index 1fe6602f32..bace2b0be1 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardResponseTest.java @@ -7,7 +7,7 @@ import org.opensearch.action.ActionResponse; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.ToXContent; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelDeleteRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelDeleteRequestTest.java index ddc053ac8e..533b96ecdf 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelDeleteRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelDeleteRequestTest.java @@ -10,7 +10,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetRequestTest.java index 53b40cf0cc..97f784d868 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetRequestTest.java @@ -10,7 +10,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetResponseTest.java index c7d68e9cc5..2dc347921a 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetResponseTest.java @@ -5,27 +5,29 @@ package org.opensearch.ml.common.transport.model; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; + +import java.io.IOException; +import java.io.UncheckedIOException; import org.junit.Before; import org.junit.Test; import org.opensearch.action.ActionResponse; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.model.MLModelState; -import java.io.IOException; -import java.io.UncheckedIOException; - -import static org.junit.Assert.*; -import static org.junit.Assert.assertEquals; - public class MLModelGetResponseTest { MLModel mlModel; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLModelGroupDeleteRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLModelGroupDeleteRequestTest.java index 4041ad9e21..0264d3a851 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLModelGroupDeleteRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLModelGroupDeleteRequestTest.java @@ -1,17 +1,16 @@ package org.opensearch.ml.common.transport.model_group; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; + +import java.io.IOException; +import java.io.UncheckedIOException; import org.junit.Before; import org.junit.Test; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; - -import java.io.IOException; -import java.io.UncheckedIOException; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; +import org.opensearch.core.common.io.stream.StreamOutput; public class MLModelGroupDeleteRequestTest { diff --git a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupInputTest.java index 793f30378c..a9a4969533 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupInputTest.java @@ -1,16 +1,15 @@ package org.opensearch.ml.common.transport.model_group; +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.util.Arrays; import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.ml.common.AccessMode; -import java.io.IOException; -import java.util.Arrays; - -import static org.junit.Assert.assertEquals; - public class MLRegisterModelGroupInputTest { private MLRegisterModelGroupInput mlRegisterModelGroupInput; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupRequestTest.java index f06f23c8ba..ea1695e96d 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLRegisterModelGroupRequestTest.java @@ -1,22 +1,21 @@ package org.opensearch.ml.common.transport.model_group; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.Arrays; import org.junit.Before; import org.junit.Test; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.AccessMode; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.util.Arrays; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; - public class MLRegisterModelGroupRequestTest { private MLRegisterModelGroupInput mlRegisterModelGroupInput; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupInputTest.java index f37940f669..9dc0fc559c 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupInputTest.java @@ -1,16 +1,15 @@ package org.opensearch.ml.common.transport.model_group; +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.util.Arrays; import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.ml.common.AccessMode; -import java.io.IOException; -import java.util.Arrays; - -import static org.junit.Assert.assertEquals; - public class MLUpdateModelGroupInputTest { private MLUpdateModelGroupInput mlUpdateModelGroupInput; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupRequestTest.java index 032aec6c46..c5406cfa7a 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/model_group/MLUpdateModelGroupRequestTest.java @@ -1,22 +1,21 @@ package org.opensearch.ml.common.transport.model_group; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.Arrays; import org.junit.Before; import org.junit.Test; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.AccessMode; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.util.Arrays; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; - public class MLUpdateModelGroupRequestTest { private MLUpdateModelGroupInput mlUpdateModelGroupInput; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskRequestTest.java index 8f3469a151..ce96aa56c1 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskRequestTest.java @@ -16,7 +16,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.index.query.MatchAllQueryBuilder; import org.opensearch.ml.common.dataframe.ColumnType; import org.opensearch.ml.common.dataframe.DataFrame; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskResponseTest.java index cc5f40b13f..2544e1337c 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskResponseTest.java @@ -9,7 +9,7 @@ import org.opensearch.action.ActionResponse; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.ToXContent; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelInputTest.java index 31db9ec0ee..17ccb79dc6 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelInputTest.java @@ -9,7 +9,7 @@ import org.mockito.junit.MockitoJUnitRunner; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentFactory; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelRequestTest.java index b5289da2a7..b983fb1827 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelRequestTest.java @@ -8,7 +8,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.model.TextEmbeddingModelConfig; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.model.MLModelFormat; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpInputTest.java index bd8e44118a..7a728a1e41 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpInputTest.java @@ -2,7 +2,7 @@ import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import java.io.IOException; import java.util.HashMap; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeRequestTest.java index cdc118c361..e1bf0cb7d2 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpNodeRequestTest.java @@ -8,7 +8,7 @@ import org.opensearch.Version; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.transport.TransportAddress; import java.io.IOException; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/task/MLTaskGetRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/task/MLTaskGetRequestTest.java index 32059a3310..5d4e300904 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/task/MLTaskGetRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/task/MLTaskGetRequestTest.java @@ -5,7 +5,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/training/MLTrainingTaskRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/training/MLTrainingTaskRequestTest.java index da832556c1..7c3e9eaa06 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/training/MLTrainingTaskRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/training/MLTrainingTaskRequestTest.java @@ -10,7 +10,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.dataframe.DataFrame; import org.opensearch.ml.common.dataframe.DataFrameBuilder; import org.opensearch.ml.common.dataset.DataFrameInputDataset; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/training/MLTrainingTaskResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/training/MLTrainingTaskResponseTest.java index 0b3523029f..0e7b2940a6 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/training/MLTrainingTaskResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/training/MLTrainingTaskResponseTest.java @@ -11,7 +11,7 @@ import org.junit.Test; import org.opensearch.action.ActionResponse; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.output.MLTrainingOutput; import org.opensearch.ml.common.transport.MLTaskResponse; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInputTest.java index c3e5702961..d15d53ad23 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInputTest.java @@ -4,7 +4,7 @@ import org.junit.Test; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.*; import org.opensearch.core.xcontent.NamedXContentRegistry; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesRequestTest.java index 8da5e09827..7f4444dd0a 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesRequestTest.java @@ -6,7 +6,7 @@ import org.opensearch.Version; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.transport.TransportAddress; import java.io.IOException; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaInputTest.java index 1e86e7f7c7..c9ace159ee 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaInputTest.java @@ -8,7 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaRequestTest.java index e5aa0e41d6..0c3a432d94 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLRegisterModelMetaRequestTest.java @@ -10,7 +10,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.model.MLModelFormat; import org.opensearch.ml.common.model.MLModelState; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInputTest.java index 8ef1b54b1c..9acbcef6ef 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInputTest.java @@ -17,7 +17,7 @@ import org.junit.Test; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; diff --git a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkRequestTest.java b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkRequestTest.java index 372caf8f7c..9571c5db53 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkRequestTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkRequestTest.java @@ -10,7 +10,7 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/AwsConnectorExecutor.java b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/AwsConnectorExecutor.java index 3102bd91dc..d2e692d001 100644 --- a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/AwsConnectorExecutor.java +++ b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/AwsConnectorExecutor.java @@ -15,7 +15,7 @@ import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.output.model.ModelTensors; import org.opensearch.ml.engine.annotation.ConnectorExecutor; -import org.opensearch.rest.RestStatus; +import org.opensearch.core.rest.RestStatus; import org.opensearch.script.ScriptService; import software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder; import software.amazon.awssdk.core.sync.RequestBody; diff --git a/ml-algorithms/src/test/java/org/opensearch/ml/engine/MLEngineTest.java b/ml-algorithms/src/test/java/org/opensearch/ml/engine/MLEngineTest.java index 789781308b..2657944c0a 100644 --- a/ml-algorithms/src/test/java/org/opensearch/ml/engine/MLEngineTest.java +++ b/ml-algorithms/src/test/java/org/opensearch/ml/engine/MLEngineTest.java @@ -13,7 +13,7 @@ import org.junit.rules.ExpectedException; import org.mockito.MockedStatic; import org.mockito.Mockito; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.dataframe.ColumnMeta; diff --git a/ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelationTest.java b/ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelationTest.java index 72c0d687b0..32848af49f 100644 --- a/ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelationTest.java +++ b/ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelationTest.java @@ -19,8 +19,8 @@ import org.opensearch.action.search.SearchResponse; import org.opensearch.action.search.ShardSearchFailure; import org.opensearch.client.Client; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; @@ -99,7 +99,7 @@ import static org.opensearch.ml.engine.algorithms.metrics_correlation.MetricsCorrelation.MODEL_CONTENT_HASH; //TODO: fix mockito error: Cannot mock/spy class org.opensearch.common.settings.Settings final class - + @Ignore public class MetricsCorrelationTest { @Rule @@ -198,7 +198,7 @@ public void setUp() throws IOException, URISyntaxException { extendedInput = MetricsCorrelationInput.builder().inputData(extendedInputData).build(); } - + @Test public void testWhenModelIdNotNullButModelIsNotDeployed() throws ExecuteException { metricsCorrelation.initModel(model, params); @@ -227,7 +227,7 @@ public void testWhenModelIdNotNullButModelIsNotDeployed() throws ExecuteExceptio assertNull(mlModelOutputs.get(0).getMCorrModelTensors()); } - + @Test public void testExecuteWithModelInIndexAndEmptyOutput() throws ExecuteException, URISyntaxException { Map params = new HashMap<>(); @@ -290,7 +290,7 @@ public void testExecuteWithModelInIndexAndOneEvent() throws ExecuteException, UR assertNotNull(mlModelOutputs.get(0).getMCorrModelTensors().get(0).getSuspected_metrics()); } - + @Test public void testExecuteWithNoModelIndexAndOneEvent() throws ExecuteException, URISyntaxException { Map params = new HashMap<>(); @@ -331,7 +331,7 @@ public void testExecuteWithNoModelIndexAndOneEvent() throws ExecuteException, UR assertNotNull(mlModelOutputs.get(0).getMCorrModelTensors().get(0).getSuspected_metrics()); } - + @Test public void testExecuteWithModelInIndexAndInvokeDeployAndOneEvent() throws ExecuteException, URISyntaxException { Map params = new HashMap<>(); @@ -379,7 +379,7 @@ public void testExecuteWithModelInIndexAndInvokeDeployAndOneEvent() throws Execu } - + @Test public void testExecuteWithNoModelInIndexAndOneEvent() throws ExecuteException, URISyntaxException { Map params = new HashMap<>(); @@ -421,7 +421,7 @@ public void testExecuteWithNoModelInIndexAndOneEvent() throws ExecuteException, assertNotNull(mlModelOutputs.get(0).getMCorrModelTensors().get(0).getSuspected_metrics()); } - + @Test public void testGetModel() { ActionFuture mockedFuture = mock(ActionFuture.class); @@ -486,7 +486,7 @@ public void testSearchRequest() { assertEquals(MLModel.MODEL_VERSION_FIELD, versionQueryBuilder.fieldName()); } - + @Test public void testRegisterModel() throws InterruptedException { doAnswer(invocation -> { @@ -510,7 +510,7 @@ public void testRegisterModel() throws InterruptedException { verify(mlRegisterModelResponseActionListener).onResponse(mlRegisterModelResponse); } - + @Test public void testDeployModel() { doAnswer(invocation -> { @@ -525,7 +525,7 @@ public void testDeployModel() { verify(mlDeployModelResponseActionListener).onResponse(mlDeployModelResponse); } - + @Test public void testDeployModelFail() { Exception ex = new ExecuteException("Testing"); @@ -538,14 +538,14 @@ public void testDeployModelFail() { verify(mlDeployModelResponseActionListener).onFailure(ex); } - + @Test public void testWrongInput() throws ExecuteException { exceptionRule.expect(ExecuteException.class); metricsCorrelation.execute(mock(LocalSampleCalculatorInput.class)); } - + @Test public void parseModelTensorOutput_NullOutput() { exceptionRule.expect(MLException.class); @@ -553,7 +553,7 @@ public void parseModelTensorOutput_NullOutput() { metricsCorrelation.parseModelTensorOutput(null, null); } - + @Test public void initModel_NullModelZipFile() { exceptionRule.expect(IllegalArgumentException.class); @@ -563,7 +563,7 @@ public void initModel_NullModelZipFile() { metricsCorrelation.initModel(model, params); } - + @Test public void initModel_NullModelHelper() throws URISyntaxException { exceptionRule.expect(IllegalArgumentException.class); @@ -573,7 +573,7 @@ public void initModel_NullModelHelper() throws URISyntaxException { metricsCorrelation.initModel(model, params); } - + @Test public void initModel_NullMLEngine() throws URISyntaxException { exceptionRule.expect(IllegalArgumentException.class); @@ -584,7 +584,7 @@ public void initModel_NullMLEngine() throws URISyntaxException { metricsCorrelation.initModel(model, params); } - + @Test public void initModel_NullModelId() throws URISyntaxException { exceptionRule.expect(IllegalArgumentException.class); @@ -594,7 +594,7 @@ public void initModel_NullModelId() throws URISyntaxException { metricsCorrelation.initModel(model, params); } - + @Test public void initModel_WrongFunctionName() { exceptionRule.expect(IllegalArgumentException.class); 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 59bab2393e..c77534d2b1 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 @@ -5,7 +5,7 @@ package org.opensearch.ml.action.connector; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_CONNECTOR_INDEX; import static org.opensearch.ml.utils.MLNodeUtils.createXContentParserFromRegistry; import static org.opensearch.ml.utils.RestActionUtils.getFetchSourceContext; diff --git a/plugin/src/main/java/org/opensearch/ml/action/deploy/TransportDeployModelOnNodeAction.java b/plugin/src/main/java/org/opensearch/ml/action/deploy/TransportDeployModelOnNodeAction.java index 7a33b869d9..4bf041dd7c 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/deploy/TransportDeployModelOnNodeAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/deploy/TransportDeployModelOnNodeAction.java @@ -23,7 +23,7 @@ import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.breaker.MLCircuitBreakerService; import org.opensearch.ml.common.FunctionName; diff --git a/plugin/src/main/java/org/opensearch/ml/action/handler/MLSearchHandler.java b/plugin/src/main/java/org/opensearch/ml/action/handler/MLSearchHandler.java index c4fd51eb29..fb5886cc3b 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/handler/MLSearchHandler.java +++ b/plugin/src/main/java/org/opensearch/ml/action/handler/MLSearchHandler.java @@ -5,8 +5,8 @@ package org.opensearch.ml.action.handler; -import static org.opensearch.rest.RestStatus.BAD_REQUEST; -import static org.opensearch.rest.RestStatus.INTERNAL_SERVER_ERROR; +import static org.opensearch.core.rest.RestStatus.BAD_REQUEST; +import static org.opensearch.core.rest.RestStatus.INTERNAL_SERVER_ERROR; import java.util.ArrayList; import java.util.Arrays; @@ -23,6 +23,7 @@ import org.opensearch.common.util.CollectionUtils; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.commons.authuser.User; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.index.IndexNotFoundException; import org.opensearch.index.query.BoolQueryBuilder; @@ -38,7 +39,6 @@ import org.opensearch.ml.common.exception.MLResourceNotFoundException; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.utils.RestActionUtils; -import org.opensearch.rest.RestStatus; import org.opensearch.search.SearchHits; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.fetch.subphase.FetchSourceContext; 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 ea699da4af..640cffdd84 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 @@ -5,7 +5,7 @@ package org.opensearch.ml.action.model_group; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_MODEL_GROUP_INDEX; import static org.opensearch.ml.utils.MLExceptionUtils.logException; @@ -28,6 +28,7 @@ import org.opensearch.common.util.CollectionUtils; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.commons.authuser.User; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.IndexNotFoundException; @@ -43,7 +44,6 @@ import org.opensearch.ml.model.MLModelGroupManager; import org.opensearch.ml.utils.MLNodeUtils; import org.opensearch.ml.utils.RestActionUtils; -import org.opensearch.rest.RestStatus; import org.opensearch.search.SearchHit; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; 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 6e193d6909..24d7122a52 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 @@ -5,7 +5,7 @@ package org.opensearch.ml.action.models; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_MODEL_GROUP_INDEX; import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; import static org.opensearch.ml.common.MLModel.ALGORITHM_FIELD; @@ -31,6 +31,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.commons.authuser.User; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.query.BoolQueryBuilder; @@ -47,7 +48,6 @@ import org.opensearch.ml.common.transport.model.MLModelGetRequest; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.utils.RestActionUtils; -import org.opensearch.rest.RestStatus; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.fetch.subphase.FetchSourceContext; import org.opensearch.tasks.Task; 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 05c4deaa86..8c0309afaf 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 @@ -5,7 +5,7 @@ package org.opensearch.ml.action.models; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; import static org.opensearch.ml.common.MLModel.ALGORITHM_FIELD; import static org.opensearch.ml.utils.MLNodeUtils.createXContentParserFromRegistry; @@ -23,6 +23,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.commons.authuser.User; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.IndexNotFoundException; @@ -35,7 +36,6 @@ import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.helper.ModelAccessControlHelper; import org.opensearch.ml.utils.RestActionUtils; -import org.opensearch.rest.RestStatus; import org.opensearch.search.fetch.subphase.FetchSourceContext; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; diff --git a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileModelResponse.java b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileModelResponse.java index 1b8e970ae6..0f1e62d6f0 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileModelResponse.java +++ b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileModelResponse.java @@ -11,9 +11,9 @@ import java.util.HashMap; import java.util.Map; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.MLTask; diff --git a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileNodeRequest.java b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileNodeRequest.java index c96880d4ad..8665d08bbc 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileNodeRequest.java +++ b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileNodeRequest.java @@ -8,8 +8,8 @@ import java.io.IOException; import org.opensearch.action.support.nodes.BaseNodeRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import lombok.Getter; diff --git a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileNodeResponse.java b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileNodeResponse.java index 8039445748..2b0a209fd5 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileNodeResponse.java +++ b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileNodeResponse.java @@ -10,8 +10,8 @@ import org.opensearch.action.support.nodes.BaseNodeResponse; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileRequest.java b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileRequest.java index 8d859821dc..c3d22b78c4 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileRequest.java +++ b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileRequest.java @@ -8,8 +8,8 @@ import java.io.IOException; import org.opensearch.action.support.nodes.BaseNodesRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.profile.MLProfileInput; import lombok.Getter; diff --git a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileResponse.java b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileResponse.java index 6a7bdcb523..f368689ffc 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileResponse.java +++ b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileResponse.java @@ -12,8 +12,8 @@ import org.opensearch.action.support.nodes.BaseNodesResponse; import org.opensearch.cluster.ClusterName; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileTransportAction.java index f4da1afbbc..5d602d09a6 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/profile/MLProfileTransportAction.java @@ -17,7 +17,7 @@ import org.opensearch.action.support.nodes.TransportNodesAction; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.env.Environment; import org.opensearch.ml.common.MLTask; import org.opensearch.ml.model.MLModelManager; diff --git a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodeRequest.java b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodeRequest.java index 9148cfc657..4019c92dac 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodeRequest.java +++ b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodeRequest.java @@ -8,8 +8,8 @@ import java.io.IOException; import org.opensearch.action.support.nodes.BaseNodeRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import lombok.Getter; diff --git a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodeResponse.java b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodeResponse.java index 97093792e9..1f815e086a 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodeResponse.java +++ b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodeResponse.java @@ -11,8 +11,8 @@ import org.opensearch.action.support.nodes.BaseNodeResponse; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.FunctionName; diff --git a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesRequest.java b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesRequest.java index 66c1302d52..2cc3d2c1bf 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesRequest.java +++ b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesRequest.java @@ -10,8 +10,8 @@ import org.opensearch.action.support.nodes.BaseNodesRequest; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.stats.MLNodeLevelStat; import org.opensearch.ml.stats.MLStatLevel; import org.opensearch.ml.stats.MLStatsInput; diff --git a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesResponse.java b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesResponse.java index 10d0ef23db..0ee31066b4 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesResponse.java +++ b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesResponse.java @@ -12,8 +12,8 @@ import org.opensearch.action.support.nodes.BaseNodesResponse; import org.opensearch.cluster.ClusterName; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesTransportAction.java index 479ccdcbf1..e6c59bf771 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/stats/MLStatsNodesTransportAction.java @@ -15,7 +15,7 @@ import org.opensearch.action.support.nodes.TransportNodesAction; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.env.Environment; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.stats.ActionName; 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 97dde53782..e705bdb7cd 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 @@ -23,8 +23,8 @@ import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; -import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.MLTaskState; 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 26b808faa9..cc0428a66d 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 @@ -5,7 +5,7 @@ package org.opensearch.ml.action.tasks; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_TASK_INDEX; import static org.opensearch.ml.utils.MLNodeUtils.createXContentParserFromRegistry; 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 11e9c67d2c..a2415c63f7 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 @@ -5,7 +5,7 @@ package org.opensearch.ml.action.tasks; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_TASK_INDEX; import static org.opensearch.ml.utils.MLNodeUtils.createXContentParserFromRegistry; @@ -18,6 +18,7 @@ import org.opensearch.client.Client; import org.opensearch.common.inject.Inject; import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.IndexNotFoundException; @@ -26,7 +27,6 @@ import org.opensearch.ml.common.transport.task.MLTaskGetAction; import org.opensearch.ml.common.transport.task.MLTaskGetRequest; import org.opensearch.ml.common.transport.task.MLTaskGetResponse; -import org.opensearch.rest.RestStatus; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; diff --git a/plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelAction.java b/plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelAction.java index e010f24a75..a35317ab1d 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelAction.java @@ -26,8 +26,8 @@ import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; -import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.cluster.DiscoveryNodeHelper; import org.opensearch.ml.common.MLModel; diff --git a/plugin/src/main/java/org/opensearch/ml/action/upload_chunk/MLModelChunkUploader.java b/plugin/src/main/java/org/opensearch/ml/action/upload_chunk/MLModelChunkUploader.java index 77be5ef425..48fe68f89b 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/upload_chunk/MLModelChunkUploader.java +++ b/plugin/src/main/java/org/opensearch/ml/action/upload_chunk/MLModelChunkUploader.java @@ -4,7 +4,7 @@ */ package org.opensearch.ml.action.upload_chunk; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; import static org.opensearch.ml.common.MLModel.ALGORITHM_FIELD; import static org.opensearch.ml.utils.MLExceptionUtils.logException; 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 fc5f9e95ee..0aa4ecec52 100644 --- a/plugin/src/main/java/org/opensearch/ml/helper/ConnectorAccessControlHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/helper/ConnectorAccessControlHelper.java @@ -7,7 +7,7 @@ package org.opensearch.ml.helper; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_CONNECTOR_ACCESS_CONTROL_ENABLED; import org.apache.lucene.search.join.ScoreMode; 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 c6800c1838..8d7ae60503 100644 --- a/plugin/src/main/java/org/opensearch/ml/helper/ModelAccessControlHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/helper/ModelAccessControlHelper.java @@ -7,7 +7,7 @@ package org.opensearch.ml.helper; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +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; 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 07720d45f8..7a6480ced2 100644 --- a/plugin/src/main/java/org/opensearch/ml/model/MLModelManager.java +++ b/plugin/src/main/java/org/opensearch/ml/model/MLModelManager.java @@ -5,9 +5,9 @@ package org.opensearch.ml.model; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.common.xcontent.XContentType.JSON; import static org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_CONNECTOR_INDEX; import static org.opensearch.ml.common.CommonValue.ML_MODEL_GROUP_INDEX; import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; @@ -79,6 +79,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; @@ -115,7 +116,6 @@ import org.opensearch.ml.stats.MLStats; import org.opensearch.ml.task.MLTaskManager; import org.opensearch.ml.utils.MLExceptionUtils; -import org.opensearch.rest.RestStatus; import org.opensearch.script.ScriptService; import org.opensearch.search.fetch.subphase.FetchSourceContext; import org.opensearch.threadpool.ThreadPool; 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 5870cbd3f1..e4c2f1d0b5 100644 --- a/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java +++ b/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java @@ -22,13 +22,13 @@ import org.opensearch.cluster.metadata.IndexNameExpressionResolver; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.IndexScopedSettings; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.SettingsFilter; import org.opensearch.common.util.concurrent.OpenSearchExecutors; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.env.Environment; import org.opensearch.env.NodeEnvironment; diff --git a/plugin/src/main/java/org/opensearch/ml/profile/MLModelProfile.java b/plugin/src/main/java/org/opensearch/ml/profile/MLModelProfile.java index 1f0320ac4d..2e9fcad046 100644 --- a/plugin/src/main/java/org/opensearch/ml/profile/MLModelProfile.java +++ b/plugin/src/main/java/org/opensearch/ml/profile/MLModelProfile.java @@ -7,9 +7,9 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.model.MLModelState; diff --git a/plugin/src/main/java/org/opensearch/ml/profile/MLPredictRequestStats.java b/plugin/src/main/java/org/opensearch/ml/profile/MLPredictRequestStats.java index efa94e8b80..dea85e4c14 100644 --- a/plugin/src/main/java/org/opensearch/ml/profile/MLPredictRequestStats.java +++ b/plugin/src/main/java/org/opensearch/ml/profile/MLPredictRequestStats.java @@ -7,9 +7,9 @@ import java.io.IOException; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/plugin/src/main/java/org/opensearch/ml/profile/MLProfileInput.java b/plugin/src/main/java/org/opensearch/ml/profile/MLProfileInput.java index 18fbcb1959..b850455776 100644 --- a/plugin/src/main/java/org/opensearch/ml/profile/MLProfileInput.java +++ b/plugin/src/main/java/org/opensearch/ml/profile/MLProfileInput.java @@ -5,16 +5,16 @@ package org.opensearch.ml.profile; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.utils.MLNodeUtils.parseArrayField; import java.io.IOException; import java.util.HashSet; import java.util.Set; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; 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 57fcdbab2b..4c94f8267a 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/AbstractMLSearchAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/AbstractMLSearchAction.java @@ -16,13 +16,13 @@ import org.opensearch.action.search.SearchRequest; import org.opensearch.action.search.SearchResponse; import org.opensearch.client.node.NodeClient; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; -import org.opensearch.rest.RestStatus; import org.opensearch.rest.action.RestResponseListener; import org.opensearch.search.builder.SearchSourceBuilder; 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 9b0ae00da8..662e635505 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateConnectorAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateConnectorAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import java.io.IOException; 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 b6c3ae37bf..71598e954e 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeployModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeployModelAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_ID; 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 e1562f03e5..be93b65ab2 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLExecuteAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLExecuteAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_ALGORITHM; import static org.opensearch.ml.utils.RestActionUtils.getAlgorithm; 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 14f4d882d3..3824f42bb0 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLPredictionAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLPredictionAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_ALGORITHM; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_ID; @@ -18,6 +18,7 @@ import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; @@ -31,7 +32,6 @@ import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestRequest; -import org.opensearch.rest.RestStatus; import org.opensearch.rest.action.RestToXContentListener; import com.google.common.annotations.VisibleForTesting; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLProfileAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLProfileAction.java index fb19b0a141..000f48f49d 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLProfileAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLProfileAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_ID; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_TASK_ID; @@ -24,6 +24,7 @@ import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.service.ClusterService; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; @@ -38,7 +39,6 @@ import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestRequest; -import org.opensearch.rest.RestStatus; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; 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 b8869afd42..9e33022290 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_MODEL_URL; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_DEPLOY_MODEL; 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 10fdbc2abb..0e473fbb98 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelGroupAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelGroupAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import java.io.IOException; 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 fa18eb4f8b..53212b09c6 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelMetaAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLRegisterModelMetaAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_ALLOW_LOCAL_FILE_UPLOAD; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLStatsAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLStatsAction.java index 3a6066c59e..54b0f51286 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLStatsAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLStatsAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.utils.RestActionUtils.splitCommaSeparatedParam; @@ -26,6 +26,7 @@ import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.service.ClusterService; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; @@ -42,7 +43,6 @@ import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestRequest; -import org.opensearch.rest.RestStatus; import com.google.common.collect.ImmutableList; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLTrainAndPredictAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLTrainAndPredictAction.java index 4419e57820..fb687ec96a 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLTrainAndPredictAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLTrainAndPredictAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_ALGORITHM; import static org.opensearch.ml.utils.RestActionUtils.getAlgorithm; diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLTrainingAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLTrainingAction.java index fa1c381313..b1d25d5491 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLTrainingAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLTrainingAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_ALGORITHM; import static org.opensearch.ml.utils.RestActionUtils.getAlgorithm; 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 0f537854fb..c895163e1c 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUndeployModelAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUndeployModelAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; 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; 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 87f64e0c5b..f7757ab652 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelGroupAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelGroupAction.java @@ -5,7 +5,7 @@ package org.opensearch.ml.rest; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI; import static org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_GROUP_ID; import static org.opensearch.ml.utils.RestActionUtils.getParameterId; diff --git a/plugin/src/main/java/org/opensearch/ml/stats/MLActionStats.java b/plugin/src/main/java/org/opensearch/ml/stats/MLActionStats.java index 334d1eaefe..bb96b64124 100644 --- a/plugin/src/main/java/org/opensearch/ml/stats/MLActionStats.java +++ b/plugin/src/main/java/org/opensearch/ml/stats/MLActionStats.java @@ -9,9 +9,9 @@ import java.util.Locale; import java.util.Map; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/plugin/src/main/java/org/opensearch/ml/stats/MLAlgoStats.java b/plugin/src/main/java/org/opensearch/ml/stats/MLAlgoStats.java index 138031ce53..7266ff0a23 100644 --- a/plugin/src/main/java/org/opensearch/ml/stats/MLAlgoStats.java +++ b/plugin/src/main/java/org/opensearch/ml/stats/MLAlgoStats.java @@ -9,9 +9,9 @@ import java.util.Locale; import java.util.Map; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/plugin/src/main/java/org/opensearch/ml/stats/MLStatsInput.java b/plugin/src/main/java/org/opensearch/ml/stats/MLStatsInput.java index 9d5e05eed8..01ee7f61cc 100644 --- a/plugin/src/main/java/org/opensearch/ml/stats/MLStatsInput.java +++ b/plugin/src/main/java/org/opensearch/ml/stats/MLStatsInput.java @@ -5,7 +5,7 @@ package org.opensearch.ml.stats; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.utils.MLNodeUtils.parseArrayField; import static org.opensearch.ml.utils.MLNodeUtils.parseField; @@ -15,9 +15,9 @@ import java.util.Locale; import java.util.Set; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; 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 2ced667e69..39ff3f7d80 100644 --- a/plugin/src/main/java/org/opensearch/ml/task/MLPredictTaskRunner.java +++ b/plugin/src/main/java/org/opensearch/ml/task/MLPredictTaskRunner.java @@ -5,7 +5,7 @@ package org.opensearch.ml.task; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.common.CommonValue.ML_MODEL_INDEX; import static org.opensearch.ml.common.MLModel.ALGORITHM_FIELD; import static org.opensearch.ml.permission.AccessController.checkUserPermissions; diff --git a/plugin/src/main/java/org/opensearch/ml/task/MLTaskManager.java b/plugin/src/main/java/org/opensearch/ml/task/MLTaskManager.java index d51a422a75..5799d2a237 100644 --- a/plugin/src/main/java/org/opensearch/ml/task/MLTaskManager.java +++ b/plugin/src/main/java/org/opensearch/ml/task/MLTaskManager.java @@ -33,6 +33,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.core.common.Strings; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.MLTask; @@ -42,7 +43,6 @@ import org.opensearch.ml.common.exception.MLLimitExceededException; import org.opensearch.ml.common.exception.MLResourceNotFoundException; import org.opensearch.ml.indices.MLIndicesHandler; -import org.opensearch.rest.RestStatus; import org.opensearch.threadpool.ThreadPool; import com.google.common.collect.ImmutableMap; diff --git a/plugin/src/main/java/org/opensearch/ml/utils/MLNodeUtils.java b/plugin/src/main/java/org/opensearch/ml/utils/MLNodeUtils.java index 588bcae0ea..5d96da22cd 100644 --- a/plugin/src/main/java/org/opensearch/ml/utils/MLNodeUtils.java +++ b/plugin/src/main/java/org/opensearch/ml/utils/MLNodeUtils.java @@ -5,7 +5,7 @@ package org.opensearch.ml.utils; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; import static org.opensearch.ml.plugin.MachineLearningPlugin.ML_ROLE_NAME; import java.io.IOException; @@ -13,10 +13,10 @@ import java.util.function.Function; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.ml.breaker.MLCircuitBreakerService; diff --git a/plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java b/plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java index 156057bc58..198e143035 100644 --- a/plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java +++ b/plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java @@ -24,10 +24,10 @@ import org.opensearch.commons.ConfigConstants; import org.opensearch.commons.authuser.User; import org.opensearch.core.common.Strings; +import org.opensearch.core.rest.RestStatus; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestRequest; -import org.opensearch.rest.RestStatus; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.fetch.subphase.FetchSourceContext; 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 85900dde05..f3436ee98b 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 @@ -30,10 +30,10 @@ import org.opensearch.action.search.ShardSearchFailure; import org.opensearch.action.support.ActionFilters; import org.opensearch.client.Client; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; 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 249b46b4e3..04ff8cd96a 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 @@ -23,10 +23,10 @@ import org.opensearch.action.get.GetResponse; import org.opensearch.action.support.ActionFilters; import org.opensearch.client.Client; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; 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 d9950224cd..914744b4ef 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 @@ -29,12 +29,12 @@ import org.opensearch.action.update.UpdateResponse; import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.commons.ConfigConstants; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; 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 980a1a4d3e..9a17a4b06b 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 @@ -40,10 +40,10 @@ import org.opensearch.action.support.ActionFilters; import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; 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 4b7096f486..eb7a109260 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 @@ -24,10 +24,10 @@ import org.opensearch.action.support.ActionFilters; import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; 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 1a99dbc4bd..9687cc7b8d 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 @@ -22,9 +22,9 @@ import org.opensearch.action.support.ActionFilters; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.env.Environment; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLTask; diff --git a/plugin/src/test/java/org/opensearch/ml/action/stats/MLStatsNodesTransportActionTests.java b/plugin/src/test/java/org/opensearch/ml/action/stats/MLStatsNodesTransportActionTests.java index cef0e3a9c2..fe0e962fd8 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/stats/MLStatsNodesTransportActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/stats/MLStatsNodesTransportActionTests.java @@ -21,8 +21,8 @@ import org.opensearch.action.support.ActionFilters; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.env.Environment; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.stats.ActionName; 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 7fbc5275ca..1f881b0234 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 @@ -24,10 +24,10 @@ import org.opensearch.action.get.GetResponse; import org.opensearch.action.support.ActionFilters; import org.opensearch.client.Client; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/plugin/src/test/java/org/opensearch/ml/action/upload_chunk/MLModelChunkUploaderTests.java b/plugin/src/test/java/org/opensearch/ml/action/upload_chunk/MLModelChunkUploaderTests.java index 1e0b45744e..59c9465f4b 100644 --- a/plugin/src/test/java/org/opensearch/ml/action/upload_chunk/MLModelChunkUploaderTests.java +++ b/plugin/src/test/java/org/opensearch/ml/action/upload_chunk/MLModelChunkUploaderTests.java @@ -23,12 +23,12 @@ import org.opensearch.action.get.GetResponse; import org.opensearch.action.index.IndexResponse; import org.opensearch.client.Client; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.commons.ConfigConstants; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; 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 841fe8f0a1..11935ae9b2 100644 --- a/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerTests.java @@ -36,11 +36,11 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.MLModel; diff --git a/plugin/src/test/java/org/opensearch/ml/bwc/MLCommonsBackwardsCompatibilityRestTestCase.java b/plugin/src/test/java/org/opensearch/ml/bwc/MLCommonsBackwardsCompatibilityRestTestCase.java index b4278e4ae3..f5323e25c9 100644 --- a/plugin/src/test/java/org/opensearch/ml/bwc/MLCommonsBackwardsCompatibilityRestTestCase.java +++ b/plugin/src/test/java/org/opensearch/ml/bwc/MLCommonsBackwardsCompatibilityRestTestCase.java @@ -59,6 +59,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentType; import org.opensearch.commons.rest.SecureRestClientBuilder; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.DeprecationHandler; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; @@ -78,7 +79,6 @@ import org.opensearch.ml.stats.MLActionLevelStat; import org.opensearch.ml.utils.TestData; import org.opensearch.ml.utils.TestHelper; -import org.opensearch.rest.RestStatus; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.test.rest.OpenSearchRestTestCase; 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 c860412ad7..b884f3a947 100644 --- a/plugin/src/test/java/org/opensearch/ml/cluster/MLSyncUpCronTests.java +++ b/plugin/src/test/java/org/opensearch/ml/cluster/MLSyncUpCronTests.java @@ -56,11 +56,11 @@ import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.commons.ConfigConstants; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.model.MLModelState; @@ -84,6 +84,7 @@ import com.google.common.collect.ImmutableSet; public class MLSyncUpCronTests extends OpenSearchTestCase { + @Mock private Client client; @Mock 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 933cd4d825..2be7993315 100644 --- a/plugin/src/test/java/org/opensearch/ml/helper/ConnectorAccessControlHelperTests.java +++ b/plugin/src/test/java/org/opensearch/ml/helper/ConnectorAccessControlHelperTests.java @@ -26,13 +26,13 @@ import org.opensearch.action.get.GetResponse; import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.commons.ConfigConstants; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.index.get.GetResult; 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 b5300ecdb4..d200c46338 100644 --- a/plugin/src/test/java/org/opensearch/ml/helper/ModelAccessControlHelperTests.java +++ b/plugin/src/test/java/org/opensearch/ml/helper/ModelAccessControlHelperTests.java @@ -24,12 +24,12 @@ import org.opensearch.action.get.GetResponse; import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.index.get.GetResult; diff --git a/plugin/src/test/java/org/opensearch/ml/indices/MLInputDatasetHandlerTests.java b/plugin/src/test/java/org/opensearch/ml/indices/MLInputDatasetHandlerTests.java index 94beb2b96d..264b0c9fbe 100644 --- a/plugin/src/test/java/org/opensearch/ml/indices/MLInputDatasetHandlerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/indices/MLInputDatasetHandlerTests.java @@ -28,8 +28,8 @@ import org.opensearch.action.ActionListener; import org.opensearch.action.search.SearchResponse; import org.opensearch.client.Client; -import org.opensearch.common.bytes.BytesArray; -import org.opensearch.common.bytes.BytesReference; +import org.opensearch.core.common.bytes.BytesArray; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.index.query.QueryBuilders; import org.opensearch.ml.common.dataframe.DataFrame; import org.opensearch.ml.common.dataframe.DataFrameBuilder; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/MLCommonsRestTestCase.java b/plugin/src/test/java/org/opensearch/ml/rest/MLCommonsRestTestCase.java index 963fd91f76..8a06ad0ed7 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/MLCommonsRestTestCase.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/MLCommonsRestTestCase.java @@ -59,6 +59,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentType; import org.opensearch.commons.rest.SecureRestClientBuilder; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.DeprecationHandler; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; @@ -81,7 +82,6 @@ import org.opensearch.ml.stats.MLActionLevelStat; import org.opensearch.ml.utils.TestData; import org.opensearch.ml.utils.TestHelper; -import org.opensearch.rest.RestStatus; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.test.rest.OpenSearchRestTestCase; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLCustomModelChunkActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLCustomModelChunkActionIT.java index 97abfd3147..6941e8b9bc 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLCustomModelChunkActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLCustomModelChunkActionIT.java @@ -15,6 +15,7 @@ import org.junit.rules.ExpectedException; import org.opensearch.client.Response; import org.opensearch.client.ResponseException; +import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.common.model.MLModelFormat; import org.opensearch.ml.common.model.MLModelState; import org.opensearch.ml.common.model.TextEmbeddingModelConfig; @@ -22,7 +23,6 @@ import org.opensearch.ml.common.transport.upload_chunk.MLRegisterModelMetaInput; import org.opensearch.ml.common.transport.upload_chunk.MLUploadModelChunkInput; import org.opensearch.ml.utils.TestHelper; -import org.opensearch.rest.RestStatus; public class RestMLCustomModelChunkActionIT extends MLCommonsRestTestCase { diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionIT.java index bca50c6b39..81a56174e2 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionIT.java @@ -13,8 +13,8 @@ import org.junit.Rule; import org.junit.rules.ExpectedException; import org.opensearch.client.Response; +import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.utils.TestHelper; -import org.opensearch.rest.RestStatus; public class RestMLDeleteModelActionIT extends MLCommonsRestTestCase { @Rule diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelGroupActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelGroupActionIT.java index 608d192e30..804af57f3d 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelGroupActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelGroupActionIT.java @@ -13,8 +13,8 @@ import org.junit.Rule; import org.junit.rules.ExpectedException; import org.opensearch.client.Response; +import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.utils.TestHelper; -import org.opensearch.rest.RestStatus; public class RestMLDeleteModelGroupActionIT extends MLCommonsRestTestCase { @Rule 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 631dac8b79..4e76b6dd68 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java @@ -17,10 +17,10 @@ import org.mockito.Mock; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.common.Strings; +import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.deploy.MLDeployModelAction; import org.opensearch.ml.common.transport.deploy.MLDeployModelRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionIT.java index f80632f3ea..566fc818bd 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionIT.java @@ -14,8 +14,8 @@ import org.junit.rules.ExpectedException; import org.opensearch.client.Response; import org.opensearch.client.ResponseException; +import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.utils.TestHelper; -import org.opensearch.rest.RestStatus; public class RestMLGetModelActionIT extends MLCommonsRestTestCase { @Rule 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 d53a23a38f..dab3183049 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java @@ -28,11 +28,11 @@ import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.common.Strings; +import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.register.MLRegisterModelAction; 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 a3b72f7134..2d5cc32079 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelGroupActionTests.java @@ -25,10 +25,10 @@ import org.opensearch.action.ActionListener; import org.opensearch.action.get.GetResponse; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.common.Strings; +import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupAction; import org.opensearch.ml.common.transport.model_group.MLRegisterModelGroupInput; 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 331b5efb60..ff7bb2ae0d 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java @@ -26,11 +26,11 @@ import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.common.Strings; +import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.upload_chunk.MLRegisterModelMetaAction; @@ -122,7 +122,7 @@ public void testRegisterModelMetaRequest() throws Exception { verify(client, times(1)).execute(eq(MLRegisterModelMetaAction.INSTANCE), argumentCaptor.capture(), any()); MLRegisterModelMetaInput metaModelRequest = argumentCaptor.getValue().getMlRegisterModelMetaInput(); assertEquals("all-MiniLM-L6-v3", metaModelRequest.getName()); - assertEquals("1", metaModelRequest.getModelGroupId()); + assertEquals("1", metaModelRequest.getVersion()); assertEquals(Integer.valueOf(2), metaModelRequest.getTotalChunks()); } 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 74f1349f7c..92bbca0235 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchConnectorActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchConnectorActionTests.java @@ -33,6 +33,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.core.common.Strings; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.transport.connector.MLConnectorSearchAction; import org.opensearch.ml.utils.TestHelper; @@ -40,7 +41,6 @@ import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; -import org.opensearch.rest.RestStatus; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.search.aggregations.InternalAggregations; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionIT.java index db6e1e87a3..06d9c4fbec 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionIT.java @@ -15,8 +15,8 @@ import org.junit.rules.ExpectedException; import org.opensearch.client.Response; import org.opensearch.client.ResponseException; +import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.utils.TestHelper; -import org.opensearch.rest.RestStatus; public class RestMLSearchModelActionIT extends MLCommonsRestTestCase { @Rule 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 baf254f9e6..728a0c902a 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java @@ -33,6 +33,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.core.common.Strings; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.transport.model.MLModelSearchAction; import org.opensearch.ml.utils.TestHelper; @@ -40,7 +41,6 @@ import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; -import org.opensearch.rest.RestStatus; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.search.aggregations.InternalAggregations; 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 09c8aebec3..ab92217aec 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelGroupActionTests.java @@ -33,6 +33,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.core.common.Strings; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.transport.model_group.MLModelGroupSearchAction; import org.opensearch.ml.utils.TestHelper; @@ -40,7 +41,6 @@ import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; -import org.opensearch.rest.RestStatus; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.search.aggregations.InternalAggregations; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLStatsActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLStatsActionTests.java index 797e3c5f9a..703256713f 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLStatsActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLStatsActionTests.java @@ -44,10 +44,11 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.rest.RestStatus; import org.opensearch.ml.action.stats.MLStatsNodeResponse; import org.opensearch.ml.action.stats.MLStatsNodesAction; import org.opensearch.ml.action.stats.MLStatsNodesRequest; @@ -69,7 +70,6 @@ import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestRequest; -import org.opensearch.rest.RestStatus; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.rest.FakeRestRequest; import org.opensearch.threadpool.TestThreadPool; 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 4bd65243aa..a130871df7 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java @@ -28,11 +28,11 @@ import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.ClusterState; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.common.Strings; +import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelsAction; 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 4be74e6370..fbd31512e3 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelGroupActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUpdateModelGroupActionTests.java @@ -26,10 +26,10 @@ import org.opensearch.action.ActionListener; import org.opensearch.action.get.GetResponse; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.common.Strings; +import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupAction; import org.opensearch.ml.common.transport.model_group.MLUpdateModelGroupInput; 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 ae28822963..9864eaf4fb 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java @@ -25,10 +25,10 @@ import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.core.common.Strings; +import org.opensearch.core.common.bytes.BytesArray; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.upload_chunk.MLUploadModelChunkAction; 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 f91aee8d9b..fa4d561245 100644 --- a/plugin/src/test/java/org/opensearch/ml/task/MLPredictTaskRunnerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/task/MLPredictTaskRunnerTests.java @@ -28,12 +28,12 @@ import org.opensearch.client.Client; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.commons.ConfigConstants; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.index.get.GetResult; diff --git a/plugin/src/test/java/org/opensearch/ml/task/MLTaskManagerTests.java b/plugin/src/test/java/org/opensearch/ml/task/MLTaskManagerTests.java index a6ee48418a..10e9e3c367 100644 --- a/plugin/src/test/java/org/opensearch/ml/task/MLTaskManagerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/task/MLTaskManagerTests.java @@ -34,8 +34,8 @@ import org.opensearch.client.Client; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.index.Index; -import org.opensearch.index.shard.ShardId; +import org.opensearch.core.index.Index; +import org.opensearch.core.index.shard.ShardId; import org.opensearch.ml.common.MLTask; import org.opensearch.ml.common.MLTaskState; import org.opensearch.ml.common.MLTaskType; diff --git a/plugin/src/test/java/org/opensearch/ml/task/MLTrainingTaskRunnerTests.java b/plugin/src/test/java/org/opensearch/ml/task/MLTrainingTaskRunnerTests.java index 9144a118bf..35796e85a8 100644 --- a/plugin/src/test/java/org/opensearch/ml/task/MLTrainingTaskRunnerTests.java +++ b/plugin/src/test/java/org/opensearch/ml/task/MLTrainingTaskRunnerTests.java @@ -33,9 +33,9 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.index.Index; +import org.opensearch.core.index.Index; +import org.opensearch.core.index.shard.ShardId; import org.opensearch.index.query.MatchAllQueryBuilder; -import org.opensearch.index.shard.ShardId; import org.opensearch.ml.breaker.MLCircuitBreakerService; import org.opensearch.ml.cluster.DiscoveryNodeHelper; import org.opensearch.ml.common.FunctionName; diff --git a/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java b/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java index da468cda62..fa0c15de54 100644 --- a/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java +++ b/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java @@ -26,6 +26,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.index.query.QueryBuilder; @@ -47,7 +48,6 @@ import org.opensearch.ml.common.transport.task.MLTaskGetResponse; import org.opensearch.ml.common.transport.training.MLTrainingTaskAction; import org.opensearch.ml.common.transport.training.MLTrainingTaskRequest; -import org.opensearch.rest.RestStatus; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.search.builder.SearchSourceBuilder; diff --git a/plugin/src/test/java/org/opensearch/ml/utils/MLExceptionUtilsTests.java b/plugin/src/test/java/org/opensearch/ml/utils/MLExceptionUtilsTests.java index 8cca3b75a1..f53d84b305 100644 --- a/plugin/src/test/java/org/opensearch/ml/utils/MLExceptionUtilsTests.java +++ b/plugin/src/test/java/org/opensearch/ml/utils/MLExceptionUtilsTests.java @@ -16,7 +16,7 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.opensearch.common.io.stream.NotSerializableExceptionWrapper; +import org.opensearch.core.common.io.stream.NotSerializableExceptionWrapper; import org.opensearch.ml.common.exception.MLLimitExceededException; import org.opensearch.ml.common.exception.MLResourceNotFoundException; import org.opensearch.test.OpenSearchIntegTestCase; diff --git a/plugin/src/test/java/org/opensearch/ml/utils/MLNodeUtilsTests.java b/plugin/src/test/java/org/opensearch/ml/utils/MLNodeUtilsTests.java index 7e810ac9ea..11be98488e 100644 --- a/plugin/src/test/java/org/opensearch/ml/utils/MLNodeUtilsTests.java +++ b/plugin/src/test/java/org/opensearch/ml/utils/MLNodeUtilsTests.java @@ -16,8 +16,8 @@ import org.opensearch.Version; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodeRole; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/plugin/src/test/java/org/opensearch/ml/utils/MockHelper.java b/plugin/src/test/java/org/opensearch/ml/utils/MockHelper.java index 8204ca833a..75ae178d41 100644 --- a/plugin/src/test/java/org/opensearch/ml/utils/MockHelper.java +++ b/plugin/src/test/java/org/opensearch/ml/utils/MockHelper.java @@ -23,8 +23,8 @@ import org.opensearch.action.index.IndexResponse; import org.opensearch.action.update.UpdateResponse; import org.opensearch.client.Client; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.index.get.GetResult; import org.opensearch.ml.common.MLModel; diff --git a/plugin/src/test/java/org/opensearch/ml/utils/TestHelper.java b/plugin/src/test/java/org/opensearch/ml/utils/TestHelper.java index 2e8cbb93a6..7eb20ed21d 100644 --- a/plugin/src/test/java/org/opensearch/ml/utils/TestHelper.java +++ b/plugin/src/test/java/org/opensearch/ml/utils/TestHelper.java @@ -50,8 +50,6 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.node.DiscoveryNodes; -import org.opensearch.common.bytes.BytesArray; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; @@ -59,6 +57,9 @@ import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.bytes.BytesArray; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.rest.RestStatus; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.ToXContentObject; @@ -75,7 +76,6 @@ import org.opensearch.ml.profile.MLProfileInput; import org.opensearch.ml.stats.MLStatsInput; import org.opensearch.rest.RestRequest; -import org.opensearch.rest.RestStatus; import org.opensearch.search.SearchModule; import org.opensearch.test.rest.FakeRestRequest;