Skip to content

Commit 2fad596

Browse files
Optimize BuildJobActionImpl.
1 parent b2ecce7 commit 2fad596

File tree

1 file changed

+3
-4
lines changed
  • dss-orchestrator/orchestrators/dss-workflow/dss-linkis-node-execution/src/main/java/com/webank/wedatasphere/dss/linkis/node/execution/service/impl

1 file changed

+3
-4
lines changed

dss-orchestrator/orchestrators/dss-workflow/dss-linkis-node-execution/src/main/java/com/webank/wedatasphere/dss/linkis/node/execution/service/impl/BuildJobActionImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.webank.wedatasphere.dss.linkis.node.execution.job.Job;
2323
import com.webank.wedatasphere.dss.linkis.node.execution.job.LinkisJob;
2424
import com.webank.wedatasphere.dss.linkis.node.execution.service.BuildJobAction;
25+
import com.webank.wedatasphere.dss.linkis.node.execution.utils.LinkisJobExecutionUtils;
2526
import org.apache.commons.lang3.SerializationUtils;
2627
import org.apache.commons.lang3.StringUtils;
2728
import org.apache.linkis.manager.label.constant.LabelKeyConstant;
@@ -75,8 +76,7 @@ private String parseExecutionCode(Job job) {
7576
String code = job.getCode();
7677
logger.info("The parseExecutionCode0X code for the job is {}", code);
7778
if (StringUtils.isEmpty(code) || code.equalsIgnoreCase("null")) {
78-
Gson gson = new Gson();
79-
code = gson.toJson(job.getParams());
79+
code = LinkisJobExecutionUtils.gson.toJson(job.getParams());
8080
logger.info("The executable code for the job is {}", code);
8181
}
8282
return code;
@@ -88,8 +88,7 @@ private String parseExecutionCodeFor1X(Job job) {
8888
logger.info("The parseExecutionCodeFor1X code for the job is {}", code);
8989
//for appconn node in subflow contains embeddedFlowId
9090
if (StringUtils.isEmpty(code) || code.equalsIgnoreCase("null") || code.contains(EMBEDDED_FLOW_ID.getValue())) {
91-
Gson gson = new Gson();
92-
code = gson.toJson(job.getParams());
91+
code = LinkisJobExecutionUtils.gson.toJson(job.getParams());
9392
logger.info("The executable code for the job is {}", code);
9493
}
9594
return code;

0 commit comments

Comments
 (0)