From 79623d12252030d202e4a8084ef09b24e02f1283 Mon Sep 17 00:00:00 2001 From: peacewong Date: Tue, 29 Aug 2023 22:03:32 +0800 Subject: [PATCH] Optimize Code --- .../interactor/job/interactive/InteractiveJob.java | 3 +-- .../linkis/manager/am/restful/EMRestfulApi.java | 13 +++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/linkis-computation-governance/linkis-client/linkis-cli/src/main/java/org/apache/linkis/cli/application/interactor/job/interactive/InteractiveJob.java b/linkis-computation-governance/linkis-client/linkis-cli/src/main/java/org/apache/linkis/cli/application/interactor/job/interactive/InteractiveJob.java index 1c04a06b5a..a097b1b25b 100644 --- a/linkis-computation-governance/linkis-client/linkis-cli/src/main/java/org/apache/linkis/cli/application/interactor/job/interactive/InteractiveJob.java +++ b/linkis-computation-governance/linkis-client/linkis-cli/src/main/java/org/apache/linkis/cli/application/interactor/job/interactive/InteractiveJob.java @@ -217,8 +217,7 @@ private LinkisOperResultAdapter waitJobComplete(String user, String jobId) // query progress try { jobInfoResult = oper.queryJobInfo(user, jobId); - oper.queryJobStatus( - jobInfoResult.getUser(), jobInfoResult.getJobID(), jobInfoResult.getStrongerExecId()); + oper.queryJobStatus(user, jobId, jobInfoResult.getStrongerExecId()); } catch (Exception e) { logger.warn("", e); retryCnt++; diff --git a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/java/org/apache/linkis/manager/am/restful/EMRestfulApi.java b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/java/org/apache/linkis/manager/am/restful/EMRestfulApi.java index b1bf62b3ba..4d5cb480d3 100644 --- a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/java/org/apache/linkis/manager/am/restful/EMRestfulApi.java +++ b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/java/org/apache/linkis/manager/am/restful/EMRestfulApi.java @@ -359,14 +359,11 @@ public Message executeECMOperation(HttpServletRequest req, @RequestBody JsonNode "Fail to process the operation parameters, cased by " + ExceptionUtils.getRootCauseMessage(e)); } - if (parameters.containsKey("engineConnInstance")) { - return executeECMOperation( - ecmNode, - parameters.get("engineConnInstance").toString(), - new ECMOperateRequest(userName, parameters)); - } else { - return executeECMOperation(ecmNode, "", new ECMOperateRequest(userName, parameters)); - } + + return executeECMOperation( + ecmNode, + parameters.getOrDefault("engineConnInstance", "").toString(), + new ECMOperateRequest(userName, parameters)); } @ApiOperation(value = "openEngineLog", notes = "open Engine log", response = Message.class)