update xxl-job 2.3.0 => 2.3.1
parent
b3b763b88c
commit
3646b9b7f0
2
pom.xml
2
pom.xml
|
|
@ -33,7 +33,7 @@
|
|||
<hutool.version>5.8.1</hutool.version>
|
||||
<redisson.version>3.17.0</redisson.version>
|
||||
<lock4j.version>2.2.1</lock4j.version>
|
||||
<xxl-job.version>2.3.0</xxl-job.version>
|
||||
<xxl-job.version>2.3.1</xxl-job.version>
|
||||
<knife4j-aggregation.version>2.0.9</knife4j-aggregation.version>
|
||||
<knife4j.version>3.0.3</knife4j.version>
|
||||
<satoken.version>1.30.0</satoken.version>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* index controller
|
||||
*
|
||||
* @author xuxueli 2015-12-19 16:13:16
|
||||
*/
|
||||
@Controller
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* job code controller
|
||||
*
|
||||
* @author xuxueli 2015-12-19 16:13:16
|
||||
*/
|
||||
@Controller
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import java.util.*;
|
|||
|
||||
/**
|
||||
* job group controller
|
||||
*
|
||||
* @author xuxueli 2016-10-02 20:52:56
|
||||
*/
|
||||
@Controller
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.xxl.job.admin.controller;
|
||||
|
||||
import com.xxl.job.admin.core.cron.CronExpression;
|
||||
import com.xxl.job.admin.core.exception.XxlJobException;
|
||||
import com.xxl.job.admin.core.model.XxlJobGroup;
|
||||
import com.xxl.job.admin.core.model.XxlJobInfo;
|
||||
|
|
@ -29,11 +28,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* index controller
|
||||
*
|
||||
* @author xuxueli 2015-12-19 16:13:16
|
||||
*/
|
||||
@Controller
|
||||
|
|
@ -91,6 +90,7 @@ public class JobInfoController {
|
|||
}
|
||||
return jobGroupList;
|
||||
}
|
||||
|
||||
public static void validPermission(HttpServletRequest request, int jobGroup) {
|
||||
XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY);
|
||||
if (!loginUser.validPermission(jobGroup)) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.xxl.job.admin.controller;
|
||||
|
||||
import com.xxl.job.admin.core.exception.XxlJobException;
|
||||
import com.xxl.job.admin.core.complete.XxlJobCompleter;
|
||||
import com.xxl.job.admin.core.exception.XxlJobException;
|
||||
import com.xxl.job.admin.core.model.XxlJobGroup;
|
||||
import com.xxl.job.admin.core.model.XxlJobInfo;
|
||||
import com.xxl.job.admin.core.model.XxlJobLog;
|
||||
|
|
@ -33,6 +33,7 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* index controller
|
||||
*
|
||||
* @author xuxueli 2015-12-19 16:13:16
|
||||
*/
|
||||
@Controller
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import java.lang.annotation.Target;
|
|||
|
||||
/**
|
||||
* 权限限制
|
||||
*
|
||||
* @author xuxueli 2015-12-12 18:29:02
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ public class CookieInterceptor implements AsyncHandlerInterceptor {
|
|||
modelAndView.addObject("I18nUtil", FtlUtil.generateStaticModel(I18nUtil.class.getName()));
|
||||
}
|
||||
|
||||
AsyncHandlerInterceptor.super.postHandle(request, response, handler, modelAndView);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class PermissionInterceptor implements AsyncHandlerInterceptor {
|
|||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
|
||||
if (!(handler instanceof HandlerMethod)) {
|
||||
return AsyncHandlerInterceptor.super.preHandle(request, response, handler);
|
||||
return true; // proceed with the next interceptor
|
||||
}
|
||||
|
||||
// if need login
|
||||
|
|
@ -53,7 +53,7 @@ public class PermissionInterceptor implements AsyncHandlerInterceptor {
|
|||
request.setAttribute(LoginService.LOGIN_IDENTITY_KEY, loginUser);
|
||||
}
|
||||
|
||||
return AsyncHandlerInterceptor.super.preHandle(request, response, handler);
|
||||
return true; // proceed with the next interceptor
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.xxl.job.admin.controller.resolver;
|
||||
|
||||
import com.xxl.job.admin.core.exception.XxlJobException;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.admin.core.util.JacksonUtil;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ public class EmailJobAlarm implements JobAlarm {
|
|||
*
|
||||
* @param jobLog
|
||||
*/
|
||||
@Override
|
||||
public boolean doAlarm(XxlJobInfo info, XxlJobLog jobLog) {
|
||||
boolean alarmResult = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class XxlJobCompleter {
|
|||
|
||||
// 1、handle success, to trigger child job
|
||||
String triggerChildMsg = null;
|
||||
if (XxlJobContext.HANDLE_COCE_SUCCESS == xxlJobLog.getHandleCode()) {
|
||||
if (XxlJobContext.HANDLE_CODE_SUCCESS == xxlJobLog.getHandleCode()) {
|
||||
XxlJobInfo xxlJobInfo = XxlJobAdminConfig.getAdminConfig().getXxlJobInfoDao().loadById(xxlJobLog.getJobId());
|
||||
if (xxlJobInfo != null && xxlJobInfo.getChildJobId() != null && xxlJobInfo.getChildJobId().trim().length() > 0) {
|
||||
triggerChildMsg = "<br><br><span style=\"color:#00c0ef;\" > >>>>>>>>>>>" + I18nUtil.getString("jobconf_trigger_child_run") + "<<<<<<<<<<< </span><br>";
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.util.Arrays;
|
|||
public class XxlJobAdminConfig implements InitializingBean, DisposableBean {
|
||||
|
||||
private static XxlJobAdminConfig adminConfig = null;
|
||||
|
||||
public static XxlJobAdminConfig getAdminConfig() {
|
||||
return adminConfig;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,16 +19,7 @@ package com.xxl.job.admin.core.cron;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.text.ParseException;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.SortedSet;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.TimeZone;
|
||||
import java.util.TreeSet;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Provides a parser and evaluator for unix-like cron expressions. Cron
|
||||
|
|
@ -191,13 +182,11 @@ import java.util.TreeSet;
|
|||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Sharada Jambula, James House
|
||||
* @author Contributions from Mads Henderson
|
||||
* @author Refactoring from CronTrigger to CronExpression by Aaron Craven
|
||||
*
|
||||
* <p>
|
||||
* Borrowed from quartz v2.3.1
|
||||
*
|
||||
*/
|
||||
public final class CronExpression implements Serializable, Cloneable {
|
||||
|
||||
|
|
@ -217,6 +206,7 @@ public final class CronExpression implements Serializable, Cloneable {
|
|||
|
||||
protected static final Map<String, Integer> monthMap = new HashMap<String, Integer>(20);
|
||||
protected static final Map<String, Integer> dayMap = new HashMap<String, Integer>(60);
|
||||
|
||||
static {
|
||||
monthMap.put("JAN", 0);
|
||||
monthMap.put("FEB", 1);
|
||||
|
|
@ -265,8 +255,7 @@ public final class CronExpression implements Serializable, Cloneable {
|
|||
*
|
||||
* @param cronExpression String representation of the cron expression the
|
||||
* new object should represent
|
||||
* @throws java.text.ParseException
|
||||
* if the string expression cannot be parsed into a valid
|
||||
* @throws ParseException if the string expression cannot be parsed into a valid
|
||||
* <CODE>CronExpression</CODE>
|
||||
*/
|
||||
public CronExpression(String cronExpression) throws ParseException {
|
||||
|
|
@ -283,8 +272,7 @@ public final class CronExpression implements Serializable, Cloneable {
|
|||
* Constructs a new {@code CronExpression} as a copy of an existing
|
||||
* instance.
|
||||
*
|
||||
* @param expression
|
||||
* The existing cron expression to be copied
|
||||
* @param expression The existing cron expression to be copied
|
||||
*/
|
||||
public CronExpression(CronExpression expression) {
|
||||
/*
|
||||
|
|
@ -1067,14 +1055,28 @@ public final class CronExpression implements Serializable, Cloneable {
|
|||
int max = -1;
|
||||
if (stopAt < startAt) {
|
||||
switch (type) {
|
||||
case SECOND : max = 60; break;
|
||||
case MINUTE : max = 60; break;
|
||||
case HOUR : max = 24; break;
|
||||
case MONTH : max = 12; break;
|
||||
case DAY_OF_WEEK : max = 7; break;
|
||||
case DAY_OF_MONTH : max = 31; break;
|
||||
case YEAR : throw new IllegalArgumentException("Start year must be less than stop year");
|
||||
default : throw new IllegalArgumentException("Unexpected type encountered");
|
||||
case SECOND:
|
||||
max = 60;
|
||||
break;
|
||||
case MINUTE:
|
||||
max = 60;
|
||||
break;
|
||||
case HOUR:
|
||||
max = 24;
|
||||
break;
|
||||
case MONTH:
|
||||
max = 12;
|
||||
break;
|
||||
case DAY_OF_WEEK:
|
||||
max = 7;
|
||||
break;
|
||||
case DAY_OF_MONTH:
|
||||
max = 31;
|
||||
break;
|
||||
case YEAR:
|
||||
throw new IllegalArgumentException("Start year must be less than stop year");
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected type encountered");
|
||||
}
|
||||
stopAt += max;
|
||||
}
|
||||
|
|
@ -1280,7 +1282,7 @@ public final class CronExpression implements Serializable, Cloneable {
|
|||
day = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
|
||||
day -= lastdayOffset;
|
||||
|
||||
java.util.Calendar tcal = java.util.Calendar.getInstance(getTimeZone());
|
||||
Calendar tcal = Calendar.getInstance(getTimeZone());
|
||||
tcal.set(Calendar.SECOND, 0);
|
||||
tcal.set(Calendar.MINUTE, 0);
|
||||
tcal.set(Calendar.HOUR_OF_DAY, 0);
|
||||
|
|
@ -1316,7 +1318,7 @@ public final class CronExpression implements Serializable, Cloneable {
|
|||
t = day;
|
||||
day = daysOfMonth.first();
|
||||
|
||||
java.util.Calendar tcal = java.util.Calendar.getInstance(getTimeZone());
|
||||
Calendar tcal = Calendar.getInstance(getTimeZone());
|
||||
tcal.set(Calendar.SECOND, 0);
|
||||
tcal.set(Calendar.MINUTE, 0);
|
||||
tcal.set(Calendar.HOUR_OF_DAY, 0);
|
||||
|
|
@ -1580,9 +1582,9 @@ public final class CronExpression implements Serializable, Cloneable {
|
|||
* @param hour the hour to set
|
||||
*/
|
||||
protected void setCalendarHour(Calendar cal, int hour) {
|
||||
cal.set(java.util.Calendar.HOUR_OF_DAY, hour);
|
||||
if (cal.get(java.util.Calendar.HOUR_OF_DAY) != hour && hour != 24) {
|
||||
cal.set(java.util.Calendar.HOUR_OF_DAY, hour + 1);
|
||||
cal.set(Calendar.HOUR_OF_DAY, hour);
|
||||
if (cal.get(Calendar.HOUR_OF_DAY) != hour && hour != 24) {
|
||||
cal.set(Calendar.HOUR_OF_DAY, hour + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ public class XxlJobException extends RuntimeException {
|
|||
|
||||
public XxlJobException() {
|
||||
}
|
||||
|
||||
public XxlJobException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public class XxlJobGroup {
|
|||
|
||||
// registry list
|
||||
private List<String> registryList; // 执行器地址列表(系统注册)
|
||||
|
||||
public List<String> getRegistryList() {
|
||||
if (addressList != null && addressList.trim().length() > 0) {
|
||||
registryList = new ArrayList<String>(Arrays.asList(addressList.split(",")));
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.util.Date;
|
|||
|
||||
/**
|
||||
* xxl-job log, used to track trigger process
|
||||
*
|
||||
* @author xuxueli 2015-12-19 23:19:09
|
||||
*/
|
||||
public class XxlJobLog {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.util.Date;
|
|||
|
||||
/**
|
||||
* xxl-job log for glue, used to track job code process
|
||||
*
|
||||
* @author xuxueli 2016-5-19 17:57:46
|
||||
*/
|
||||
public class XxlJobLogGlue {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//package com.xxl.job.admin.core.jobbean;
|
||||
package com.xxl.job.admin.core.old;//package com.xxl.job.admin.core.jobbean;
|
||||
//
|
||||
//import com.xxl.job.admin.core.thread.JobTriggerPoolHelper;
|
||||
//import com.xxl.job.admin.core.trigger.TriggerTypeEnum;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//package com.xxl.job.admin.core.schedule;
|
||||
package com.xxl.job.admin.core.old;//package com.xxl.job.admin.core.schedule;
|
||||
//
|
||||
//import com.xxl.job.admin.core.conf.XxlJobAdminConfig;
|
||||
//import com.xxl.job.admin.core.jobbean.RemoteHttpJobBean;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//package com.xxl.job.admin.core.quartz;
|
||||
package com.xxl.job.admin.core.old;//package com.xxl.job.admin.core.quartz;
|
||||
//
|
||||
//import org.quartz.SchedulerConfigException;
|
||||
//import org.quartz.spi.ThreadPool;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public enum ExecutorRouteStrategyEnum {
|
|||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public ExecutorRouter getRouter() {
|
||||
return router;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.xxl.job.admin.core.route.strategy;
|
||||
|
||||
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
|
||||
import com.xxl.job.admin.core.route.ExecutorRouter;
|
||||
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
|
||||
import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.core.biz.ExecutorBiz;
|
||||
import com.xxl.job.core.biz.model.IdleBeatParam;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public class ExecutorRouteConsistentHash extends ExecutorRouter {
|
|||
|
||||
/**
|
||||
* get hash code on 2^32 ring (md5散列的方式计算hash值)
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.xxl.job.admin.core.route.strategy;
|
||||
|
||||
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
|
||||
import com.xxl.job.admin.core.route.ExecutorRouter;
|
||||
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
|
||||
import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.core.biz.ExecutorBiz;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.util.concurrent.ConcurrentMap;
|
|||
* 单个JOB对应的每个执行器,使用频率最低的优先被选举
|
||||
* a(*)、LFU(Least Frequently Used):最不经常使用,频率/次数
|
||||
* b、LRU(Least Recently Used):最近最久未使用,时间
|
||||
*
|
||||
* <p>
|
||||
* Created by xuxueli on 17/3/10.
|
||||
*/
|
||||
public class ExecutorRouteLFU extends ExecutorRouter {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.util.concurrent.ConcurrentMap;
|
|||
* 单个JOB对应的每个执行器,最久为使用的优先被选举
|
||||
* a、LFU(Least Frequently Used):最不经常使用,频率/次数
|
||||
* b(*)、LRU(Least Recently Used):最近最久未使用,时间
|
||||
*
|
||||
* <p>
|
||||
* Created by xuxueli on 17/3/10.
|
||||
*/
|
||||
public class ExecutorRouteLRU extends ExecutorRouter {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ public class XxlJobScheduler {
|
|||
|
||||
// ---------------------- executor-client ----------------------
|
||||
private static ConcurrentMap<String, ExecutorBiz> executorBizRepository = new ConcurrentHashMap<String, ExecutorBiz>();
|
||||
|
||||
public static ExecutorBiz getExecutorBiz(String address) throws Exception {
|
||||
// valid
|
||||
if (address == null || address.trim().length() == 0) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public class JobCompleteHelper {
|
|||
private static Logger logger = LoggerFactory.getLogger(JobCompleteHelper.class);
|
||||
|
||||
private static JobCompleteHelper instance = new JobCompleteHelper();
|
||||
|
||||
public static JobCompleteHelper getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
|
@ -32,6 +33,7 @@ public class JobCompleteHelper {
|
|||
private ThreadPoolExecutor callbackThreadPool = null;
|
||||
private Thread monitorThread;
|
||||
private volatile boolean toStop = false;
|
||||
|
||||
public void start() {
|
||||
|
||||
// for callback
|
||||
|
|
@ -180,5 +182,4 @@ public class JobCompleteHelper {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ public class JobFailMonitorHelper {
|
|||
private static Logger logger = LoggerFactory.getLogger(JobFailMonitorHelper.class);
|
||||
|
||||
private static JobFailMonitorHelper instance = new JobFailMonitorHelper();
|
||||
|
||||
public static JobFailMonitorHelper getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
|
@ -28,6 +29,7 @@ public class JobFailMonitorHelper {
|
|||
|
||||
private Thread monitorThread;
|
||||
private volatile boolean toStop = false;
|
||||
|
||||
public void start() {
|
||||
monitorThread = new Thread(new Runnable() {
|
||||
|
||||
|
|
@ -60,7 +62,7 @@ public class JobFailMonitorHelper {
|
|||
|
||||
// 2、fail alarm monitor
|
||||
int newAlarmStatus = 0; // 告警状态:0-默认、-1=锁定状态、1-无需告警、2-告警成功、3-告警失败
|
||||
if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) {
|
||||
if (info != null) {
|
||||
boolean alarmResult = XxlJobAdminConfig.getAdminConfig().getJobAlarmer().alarm(info, log);
|
||||
newAlarmStatus = alarmResult ? 2 : 3;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ public class JobLogReportHelper {
|
|||
private static Logger logger = LoggerFactory.getLogger(JobLogReportHelper.class);
|
||||
|
||||
private static JobLogReportHelper instance = new JobLogReportHelper();
|
||||
|
||||
public static JobLogReportHelper getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
|
@ -27,6 +28,7 @@ public class JobLogReportHelper {
|
|||
|
||||
private Thread logrThread;
|
||||
private volatile boolean toStop = false;
|
||||
|
||||
public void start() {
|
||||
logrThread = new Thread(new Runnable() {
|
||||
|
||||
|
|
|
|||
|
|
@ -15,12 +15,14 @@ import java.util.concurrent.*;
|
|||
|
||||
/**
|
||||
* job registry instance
|
||||
*
|
||||
* @author xuxueli 2016-10-02 19:10:24
|
||||
*/
|
||||
public class JobRegistryHelper {
|
||||
private static Logger logger = LoggerFactory.getLogger(JobRegistryHelper.class);
|
||||
|
||||
private static JobRegistryHelper instance = new JobRegistryHelper();
|
||||
|
||||
public static JobRegistryHelper getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public class JobScheduleHelper {
|
|||
private static Logger logger = LoggerFactory.getLogger(JobScheduleHelper.class);
|
||||
|
||||
private static JobScheduleHelper instance = new JobScheduleHelper();
|
||||
|
||||
public static JobScheduleHelper getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ public class JobTriggerPoolHelper {
|
|||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------- helper ----------------------
|
||||
|
||||
private static JobTriggerPoolHelper helper = new JobTriggerPoolHelper();
|
||||
|
|
@ -128,6 +127,7 @@ public class JobTriggerPoolHelper {
|
|||
public static void toStart() {
|
||||
helper.start();
|
||||
}
|
||||
|
||||
public static void toStop() {
|
||||
helper.stop();
|
||||
}
|
||||
|
|
@ -135,12 +135,10 @@ public class JobTriggerPoolHelper {
|
|||
/**
|
||||
* @param jobId
|
||||
* @param triggerType
|
||||
* @param failRetryCount
|
||||
* >=0: use this param
|
||||
* @param failRetryCount >=0: use this param
|
||||
* <0: use param from job info config
|
||||
* @param executorShardingParam
|
||||
* @param executorParam
|
||||
* null: use job param
|
||||
* @param executorParam null: use job param
|
||||
* not null: cover job param
|
||||
*/
|
||||
public static void trigger(int jobId, TriggerTypeEnum triggerType, int failRetryCount, String executorShardingParam, String executorParam, String addressList) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@ public enum TriggerTypeEnum {
|
|||
private TriggerTypeEnum(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
private String title;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,15 +30,12 @@ public class XxlJobTrigger {
|
|||
*
|
||||
* @param jobId
|
||||
* @param triggerType
|
||||
* @param failRetryCount
|
||||
* >=0: use this param
|
||||
* @param failRetryCount >=0: use this param
|
||||
* <0: use param from job info config
|
||||
* @param executorShardingParam
|
||||
* @param executorParam
|
||||
* null: use job param
|
||||
* @param executorParam null: use job param
|
||||
* not null: cover job param
|
||||
* @param addressList
|
||||
* null: use executor addressList
|
||||
* @param addressList null: use executor addressList
|
||||
* not null: cover
|
||||
*/
|
||||
public static void trigger(int jobId,
|
||||
|
|
@ -200,6 +197,7 @@ public class XxlJobTrigger {
|
|||
|
||||
/**
|
||||
* run executor
|
||||
*
|
||||
* @param triggerParam
|
||||
* @param address
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public class I18nUtil {
|
|||
private static Logger logger = LoggerFactory.getLogger(I18nUtil.class);
|
||||
|
||||
private static Properties prop = null;
|
||||
|
||||
public static Properties loadI18nProp() {
|
||||
if (prop != null) {
|
||||
return prop;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* Jackson util
|
||||
*
|
||||
* <p>
|
||||
* 1、obj need private and set/get;
|
||||
* 2、do not support inner class;
|
||||
*
|
||||
|
|
@ -22,6 +22,7 @@ public class JacksonUtil {
|
|||
private static Logger logger = LoggerFactory.getLogger(JacksonUtil.class);
|
||||
|
||||
private final static ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
public static ObjectMapper getInstance() {
|
||||
return objectMapper;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import java.util.concurrent.ConcurrentMap;
|
|||
public class LocalCacheUtil {
|
||||
|
||||
private static ConcurrentMap<String, LocalCacheData> cacheRepository = new ConcurrentHashMap<String, LocalCacheData>(); // 类型建议用抽象父类,兼容性更好;
|
||||
|
||||
private static class LocalCacheData {
|
||||
private String key;
|
||||
private Object val;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* job info
|
||||
*
|
||||
* @author xuxueli 2016-1-12 18:03:45
|
||||
*/
|
||||
@Mapper
|
||||
|
|
@ -21,6 +22,7 @@ public interface XxlJobInfoDao {
|
|||
@Param("jobDesc") String jobDesc,
|
||||
@Param("executorHandler") String executorHandler,
|
||||
@Param("author") String author);
|
||||
|
||||
public int pageListCount(@Param("offset") int offset,
|
||||
@Param("pagesize") int pagesize,
|
||||
@Param("jobGroup") int jobGroup,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* job log
|
||||
*
|
||||
* @author xuxueli 2016-1-12 18:03:06
|
||||
*/
|
||||
@Mapper
|
||||
|
|
@ -23,6 +24,7 @@ public interface XxlJobLogDao {
|
|||
@Param("triggerTimeStart") Date triggerTimeStart,
|
||||
@Param("triggerTimeEnd") Date triggerTimeEnd,
|
||||
@Param("logStatus") int logStatus);
|
||||
|
||||
public int pageListCount(@Param("offset") int offset,
|
||||
@Param("pagesize") int pagesize,
|
||||
@Param("jobGroup") int jobGroup,
|
||||
|
|
@ -49,6 +51,7 @@ public interface XxlJobLogDao {
|
|||
@Param("clearBeforeTime") Date clearBeforeTime,
|
||||
@Param("clearBeforeNum") int clearBeforeNum,
|
||||
@Param("pagesize") int pagesize);
|
||||
|
||||
public int clearLog(@Param("logIds") List<Long> logIds);
|
||||
|
||||
public List<Long> findFailJobLogIds(@Param("pagesize") int pagesize);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* job log for glue
|
||||
*
|
||||
* @author xuxueli 2016-5-19 18:04:56
|
||||
*/
|
||||
@Mapper
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* job log
|
||||
*
|
||||
* @author xuxueli 2019-11-22
|
||||
*/
|
||||
@Mapper
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.xxl.job.admin.dao;
|
|||
import com.xxl.job.admin.core.model.XxlJobUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -15,6 +16,7 @@ public interface XxlJobUserDao {
|
|||
@Param("pagesize") int pagesize,
|
||||
@Param("username") String username,
|
||||
@Param("role") int role);
|
||||
|
||||
public int pageListCount(@Param("offset") int offset,
|
||||
@Param("pagesize") int pagesize,
|
||||
@Param("username") String username,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ public class LoginService {
|
|||
String tokenHex = new BigInteger(tokenJson.getBytes()).toString(16);
|
||||
return tokenHex;
|
||||
}
|
||||
|
||||
private XxlJobUser parseToken(String tokenHex) {
|
||||
XxlJobUser xxlJobUser = null;
|
||||
if (tokenHex != null) {
|
||||
|
|
@ -103,8 +104,5 @@ public class LoginService {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("121312");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public interface XxlJobService {
|
|||
/**
|
||||
* remove job
|
||||
* *
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import java.util.*;
|
|||
|
||||
/**
|
||||
* core job action for xxl-job
|
||||
*
|
||||
* @author xuxueli 2016-5-28 15:30:33
|
||||
*/
|
||||
@Service
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
admin_name=Scheduling Center
|
||||
admin_name_full=Distributed Task Scheduling Platform XXL-JOB
|
||||
admin_version=2.3.0
|
||||
admin_version=2.3.1
|
||||
admin_i18n=en
|
||||
|
||||
## system
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
admin_name=任务调度中心
|
||||
admin_name_full=分布式任务调度平台XXL-JOB
|
||||
admin_version=2.3.0
|
||||
admin_version=2.3.1
|
||||
admin_i18n=
|
||||
|
||||
## system
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
admin_name=任務調度中心
|
||||
admin_name_full=分布式任務調度平臺XXL-JOB
|
||||
admin_version=2.3.0
|
||||
admin_version=2.3.1
|
||||
admin_i18n=
|
||||
|
||||
## system
|
||||
|
|
|
|||
Loading…
Reference in New Issue