You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "XiaoJiang521 (via GitHub)" <gi...@apache.org> on 2023/09/14 02:13:28 UTC

[GitHub] [seatunnel-web] XiaoJiang521 commented on a diff in pull request #121: [Improve] Optimize the code, add a specific Result type.

XiaoJiang521 commented on code in PR #121:
URL: https://github.com/apache/seatunnel-web/pull/121#discussion_r1325260483


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/JobExecutorController.java:
##########
@@ -44,12 +43,12 @@
 @RestController
 public class JobExecutorController {
 
-    @Autowired IJobExecutorService jobExecutorService;
+    @Resource IJobExecutorService jobExecutorService;

Review Comment:
   I'm a little curious, what are the advantages of Resource over Autowired



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/JobExecutorServiceImpl.java:
##########
@@ -160,14 +159,13 @@ private SeaTunnelClient createSeaTunnelClient() {
     }
 
     public static String getClusterName(String testClassName) {
-        //        return System.getProperty("user.name") + "_" + testClassName;
         return testClassName;
     }
 
     @Override
-    public Result jobPause(Integer userId, Long jobInstanceId) {
+    public Result<Void> jobPause(Integer userId, Long jobInstanceId) {
         JobInstance jobInstance = jobInstanceDao.getJobInstance(jobInstanceId);
-        if (getJobStatusFromEngine(jobInstance, jobInstance.getJobEngineId()) == "RUNNING") {
+        if (Objects.equals(getJobStatusFromEngine(jobInstance, jobInstance.getJobEngineId()), "RUNNING")) {

Review Comment:
   How about StringUtils.euqles here
    



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org