Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <[email protected]>
  • Loading branch information
zane-neo committed Oct 14, 2024
1 parent f60e92a commit 643ce74
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private void queryRunningModels(ActionListener<SearchResponse> 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);
Expand All @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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);
Expand Down

0 comments on commit 643ce74

Please sign in to comment.