diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/ExecutorRouter.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/ExecutorRouter.java index aec1179a..f0e0a996 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/ExecutorRouter.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/ExecutorRouter.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.core.route; -import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.core.biz.ExecutorBiz; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.TriggerParam; @@ -21,9 +20,9 @@ public abstract class ExecutorRouter { * * @param triggerParam * @param addressList - * @return + * @return ReturnT.content: final address */ - public abstract ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog); + public abstract ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList); /** * run executor diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java index 837e3d18..e200c704 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.core.route.strategy; -import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.admin.core.route.ExecutorRouter; import com.xxl.job.core.biz.ExecutorBiz; import com.xxl.job.core.biz.model.ReturnT; @@ -19,7 +18,7 @@ public class ExecutorRouteBusyover extends ExecutorRouter { } @Override - public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog) { + public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList) { StringBuffer idleBeatResultSB = new StringBuffer(); for (String address : addressList) { @@ -40,12 +39,14 @@ public class ExecutorRouteBusyover extends ExecutorRouter { // beat success if (idleBeatResult.getCode() == ReturnT.SUCCESS_CODE) { - jobLog.setExecutorAddress(address); ReturnT runResult = runExecutor(triggerParam, address); idleBeatResultSB.append("

").append(runResult.getMsg()); - return new ReturnT(runResult.getCode(), idleBeatResultSB.toString()); + // result + runResult.setMsg(idleBeatResultSB.toString()); + runResult.setContent(address); + return runResult; } } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteConsistentHash.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteConsistentHash.java index 08cc6c85..3cbda46d 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteConsistentHash.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteConsistentHash.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.core.route.strategy; -import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.admin.core.route.ExecutorRouter; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.TriggerParam; @@ -78,13 +77,13 @@ public class ExecutorRouteConsistentHash extends ExecutorRouter { } @Override - public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog) { + public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList) { // address String address = route(triggerParam.getJobId(), addressList); - jobLog.setExecutorAddress(address); // run executor ReturnT runResult = runExecutor(triggerParam, address); + runResult.setContent(address); return runResult; } } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java index 2b25a909..0c260b95 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.core.route.strategy; -import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.admin.core.route.ExecutorRouter; import com.xxl.job.core.biz.ExecutorBiz; import com.xxl.job.core.biz.model.ReturnT; @@ -19,7 +18,7 @@ public class ExecutorRouteFailover extends ExecutorRouter { } @Override - public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog) { + public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList) { StringBuffer beatResultSB = new StringBuffer(); for (String address : addressList) { @@ -40,12 +39,14 @@ public class ExecutorRouteFailover extends ExecutorRouter { // beat success if (beatResult.getCode() == ReturnT.SUCCESS_CODE) { - jobLog.setExecutorAddress(address); ReturnT runResult = runExecutor(triggerParam, address); beatResultSB.append("

").append(runResult.getMsg()); - return new ReturnT(runResult.getCode(), beatResultSB.toString()); + // result + runResult.setMsg(beatResultSB.toString()); + runResult.setContent(address); + return runResult; } } return new ReturnT(ReturnT.FAIL_CODE, beatResultSB.toString()); diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFirst.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFirst.java index 181ab1e4..b3a71672 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFirst.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFirst.java @@ -17,14 +17,14 @@ public class ExecutorRouteFirst extends ExecutorRouter { } @Override - public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog) { + public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList) { // address String address = route(triggerParam.getJobId(), addressList); - jobLog.setExecutorAddress(address); // run executor ReturnT runResult = runExecutor(triggerParam, address); + runResult.setContent(address); return runResult; } } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java index ade528f3..7b34ea99 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.core.route.strategy; -import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.admin.core.route.ExecutorRouter; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.TriggerParam; @@ -57,14 +56,14 @@ public class ExecutorRouteLFU extends ExecutorRouter { } @Override - public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog) { + public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList) { // address String address = route(triggerParam.getJobId(), addressList); - jobLog.setExecutorAddress(address); // run executor ReturnT runResult = runExecutor(triggerParam, address); + runResult.setContent(address); return runResult; } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java index 3c309c86..7b7e0909 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.core.route.strategy; -import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.admin.core.route.ExecutorRouter; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.TriggerParam; @@ -56,14 +55,14 @@ public class ExecutorRouteLRU extends ExecutorRouter { @Override - public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog) { + public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList) { // address String address = route(triggerParam.getJobId(), addressList); - jobLog.setExecutorAddress(address); // run executor ReturnT runResult = runExecutor(triggerParam, address); + runResult.setContent(address); return runResult; } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLast.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLast.java index f1369ffc..c94dc938 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLast.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLast.java @@ -17,13 +17,13 @@ public class ExecutorRouteLast extends ExecutorRouter { } @Override - public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog) { + public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList) { // address String address = route(triggerParam.getJobId(), addressList); - jobLog.setExecutorAddress(address); // run executor ReturnT runResult = runExecutor(triggerParam, address); + runResult.setContent(address); return runResult; } } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteRandom.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteRandom.java index 6014c038..f27a6bda 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteRandom.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteRandom.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.core.route.strategy; -import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.admin.core.route.ExecutorRouter; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.TriggerParam; @@ -21,13 +20,13 @@ public class ExecutorRouteRandom extends ExecutorRouter { } @Override - public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog) { + public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList) { // address String address = route(triggerParam.getJobId(), addressList); - jobLog.setExecutorAddress(address); // run executor ReturnT runResult = runExecutor(triggerParam, address); + runResult.setContent(address); return runResult; } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteRound.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteRound.java index 83bae76b..a09412c0 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteRound.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteRound.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.core.route.strategy; -import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.admin.core.route.ExecutorRouter; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.TriggerParam; @@ -36,14 +35,14 @@ public class ExecutorRouteRound extends ExecutorRouter { @Override - public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList, XxlJobLog jobLog) { + public ReturnT routeRun(TriggerParam triggerParam, ArrayList addressList) { // address String address = route(triggerParam.getJobId(), addressList); - jobLog.setExecutorAddress(address); // run executor ReturnT runResult = runExecutor(triggerParam, address); + runResult.setContent(address); return runResult; } } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java index 940c4eb8..f7cbf3a6 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java @@ -86,17 +86,18 @@ public class XxlJobTrigger { triggerParam.setLogDateTim(jobLog.getTriggerTime().getTime()); // 4.2、trigger-run (route run / trigger remote executor) - triggerResult = executorRouteStrategyEnum.getRouter().routeRun(triggerParam, addressList, jobLog); + triggerResult = executorRouteStrategyEnum.getRouter().routeRun(triggerParam, addressList); triggerMsgSb.append("

>>>>>>>>>>>触发调度<<<<<<<<<<<
").append(triggerResult.getMsg()); // 4.3、trigger (fail retry) if (triggerResult.getCode()!=ReturnT.SUCCESS_CODE && failStrategy == ExecutorFailStrategyEnum.FAIL_RETRY) { - triggerResult = executorRouteStrategyEnum.getRouter().routeRun(triggerParam, addressList, jobLog); + triggerResult = executorRouteStrategyEnum.getRouter().routeRun(triggerParam, addressList); triggerMsgSb.append("

>>>>>>>>>>>失败重试<<<<<<<<<<<
").append(triggerResult.getMsg()); } } // 5、save trigger-info + jobLog.setExecutorAddress(triggerResult.getContent()); jobLog.setTriggerCode(triggerResult.getCode()); jobLog.setTriggerMsg(triggerMsgSb.toString()); XxlJobDynamicScheduler.xxlJobLogDao.updateTriggerInfo(jobLog); diff --git a/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js b/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js index 973fe2c7..8e25ba65 100644 --- a/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js +++ b/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js @@ -110,7 +110,7 @@ $(function() { } var temp = ''; - temp += '执行器地址:' + row.executorAddress; + temp += '执行器地址:' + (row.executorAddress?row.executorAddress:''); temp += '
运行模式:' + glueTypeTitle; temp += '
任务参数:' + row.executorParam;