From a439b63a1a20a8dd2f37a00357a8d7857f8fca82 Mon Sep 17 00:00:00 2001 From: xinyual Date: Sun, 12 Nov 2023 12:30:38 +0800 Subject: [PATCH] optimize import Signed-off-by: xinyual --- .../org/opensearch/ml/model/MLModelManager.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 3c36d0b40e..280eaabfb6 100644 --- a/plugin/src/main/java/org/opensearch/ml/model/MLModelManager.java +++ b/plugin/src/main/java/org/opensearch/ml/model/MLModelManager.java @@ -14,7 +14,10 @@ import static org.opensearch.ml.common.CommonValue.NOT_FOUND; import static org.opensearch.ml.common.CommonValue.UNDEPLOYED; import static org.opensearch.ml.common.MLModel.ALGORITHM_FIELD; -import static org.opensearch.ml.common.MLTask.*; +import static org.opensearch.ml.common.MLTask.FUNCTION_NAME_FIELD; +import static org.opensearch.ml.common.MLTask.ERROR_FIELD; +import static org.opensearch.ml.common.MLTask.MODEL_ID_FIELD; +import static org.opensearch.ml.common.MLTask.STATE_FIELD; import static org.opensearch.ml.common.MLTaskState.COMPLETED; import static org.opensearch.ml.common.MLTaskState.FAILED; import static org.opensearch.ml.engine.ModelHelper.CHUNK_FILES; @@ -755,7 +758,13 @@ private void registerPrebuiltModel(MLRegisterModelInput registerModelInput, MLTa } modelHelper.downloadPrebuiltModelConfig(taskId, registerModelInput, ActionListener.wrap(mlRegisterModelInput -> { mlTask.setFunctionName(mlRegisterModelInput.getFunctionName()); - mlTaskManager.updateMLTask(taskId, ImmutableMap.of(FUNCTION_NAME_FIELD, mlRegisterModelInput.getFunctionName()), TIMEOUT_IN_MILLIS, false); + mlTaskManager + .updateMLTask( + taskId, + ImmutableMap.of(FUNCTION_NAME_FIELD, mlRegisterModelInput.getFunctionName()), + TIMEOUT_IN_MILLIS, + false + ); registerModelFromUrl(mlRegisterModelInput, mlTask, modelVersion); }, e -> { log.error("Failed to register prebuilt model", e);