diff --git a/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java b/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java index ca1b3a2f15..247741bcc8 100644 --- a/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java +++ b/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java @@ -243,7 +243,7 @@ private void queryRunningModels(ActionListener listener) { MLModel.PLANNING_WORKER_NODES_FIELD, MLModel.DEPLOY_TO_ALL_NODES_FIELD, MLModel.FUNCTION_NAME_FIELD, - MLModel.ALGORITHM_FIELD}; + MLModel.ALGORITHM_FIELD }; String[] excludes = new String[] { MLModel.MODEL_CONTENT_FIELD, MLModel.OLD_MODEL_CONTENT_FIELD }; FetchSourceContext fetchContext = new FetchSourceContext(true, includes, excludes); @@ -266,7 +266,11 @@ private void triggerModelRedeploy(ModelAutoRedeployArrangement modelAutoRedeploy .ofNullable(sourceAsMap.get(MLModel.FUNCTION_NAME_FIELD)) .orElse(sourceAsMap.get(MLModel.ALGORITHM_FIELD)); if (functionName == null) { - log.error("Model function_name or algorithm is null, model is not in correct status, please check the model, model id is: {}", modelId); + log + .error( + "Model function_name or algorithm is null, model is not in correct status, please check the model, model id is: {}", + modelId + ); return; } if (FunctionName.REMOTE == FunctionName.from(functionName)) { diff --git a/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerIT.java b/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerIT.java index d6eca1c2bc..a19c60d28c 100644 --- a/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerIT.java +++ b/plugin/src/test/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployerIT.java @@ -7,16 +7,17 @@ package org.opensearch.ml.autoredeploy; -import lombok.SneakyThrows; -import org.junit.Before; -import org.opensearch.ml.common.MLTaskState; -import org.opensearch.ml.rest.MLCommonsRestTestCase; +import static org.opensearch.ml.common.MLTask.MODEL_ID_FIELD; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import static org.opensearch.ml.common.MLTask.MODEL_ID_FIELD; +import org.junit.Before; +import org.opensearch.ml.common.MLTaskState; +import org.opensearch.ml.rest.MLCommonsRestTestCase; + +import lombok.SneakyThrows; public class MLModelAutoReDeployerIT extends MLCommonsRestTestCase { @@ -27,11 +28,10 @@ public void setup() throws IOException { @SneakyThrows private void prepareModel() { - String requestBody = Files.readString(Path.of(this - .getClass() - .getClassLoader() - .getResource("org/opensearch/ml/autoredeploy/TracedSmallModelRequest.json") - .toURI())); + String requestBody = Files + .readString( + Path.of(this.getClass().getClassLoader().getResource("org/opensearch/ml/autoredeploy/TracedSmallModelRequest.json").toURI()) + ); String registerFirstModelTaskId = registerModel(requestBody); String registerSecondModelTaskId = registerModel(requestBody); waitForTask(registerFirstModelTaskId, MLTaskState.COMPLETED);