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 0dd6d95680..4441a3d592 100644 --- a/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java +++ b/plugin/src/main/java/org/opensearch/ml/autoredeploy/MLModelAutoReDeployer.java @@ -260,19 +260,16 @@ private void triggerModelRedeploy(ModelAutoRedeployArrangement modelAutoRedeploy String modelId = modelAutoRedeployArrangement.getSearchResponse().getId(); List addedNodes = modelAutoRedeployArrangement.getAddedNodes(); Map sourceAsMap = modelAutoRedeployArrangement.getSearchResponse().getSourceAsMap(); - String functionName = (String) Optional.ofNullable(sourceAsMap.get(MLModel.FUNCTION_NAME_FIELD)) + String functionName = (String) Optional + .ofNullable(sourceAsMap.get(MLModel.FUNCTION_NAME_FIELD)) .orElse(sourceAsMap.get(MLModel.ALGORITHM_FIELD)); if (FunctionName.REMOTE == FunctionName.from(functionName)) { log.info("Skipping redeploying remote model {} as remote model deployment can be done at prediction time.", modelId); return; } - List planningWorkerNodes = (List) sourceAsMap - .get(MLModel.PLANNING_WORKER_NODES_FIELD); - Integer autoRedeployRetryTimes = (Integer) sourceAsMap - .get(MLModel.AUTO_REDEPLOY_RETRY_TIMES_FIELD); - Boolean deployToAllNodes = (Boolean) Optional - .ofNullable(sourceAsMap.get(MLModel.DEPLOY_TO_ALL_NODES_FIELD)) - .orElse(false); + List planningWorkerNodes = (List) sourceAsMap.get(MLModel.PLANNING_WORKER_NODES_FIELD); + Integer autoRedeployRetryTimes = (Integer) sourceAsMap.get(MLModel.AUTO_REDEPLOY_RETRY_TIMES_FIELD); + Boolean deployToAllNodes = (Boolean) Optional.ofNullable(sourceAsMap.get(MLModel.DEPLOY_TO_ALL_NODES_FIELD)).orElse(false); // calculate node ids. String[] nodeIds = null; if (deployToAllNodes || !allowCustomDeploymentPlan) {