Merge pull request #1282 from Zhouchuanwen/master

Fix typos and modify unreasonable var's name
2.1.2
许雪里 5 years ago committed by GitHub
commit f7c67b4da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,8 +19,8 @@ XXL-JOB is a lightweight distributed task scheduling framework, the core design
- 1.Simple: support through the Web page on the task CRUD operation, simple operation, a minute to get started; - 1.Simple: support through the Web page on the task CRUD operation, simple operation, a minute to get started;
- 2.Dynamic: support dynamic modification of task status, pause / resume tasks, and termination of running tasks,immediate effect; - 2.Dynamic: support dynamic modification of task status, pause / resume tasks, and termination of running tasks,immediate effect;
- 3.Dispatch center HA (center type): Dispatch with central design, "dispatch center" based on the cluster of Quartz implementation, can guarantee the scheduling - center HA; - 3.Dispatch center HA (center type): Dispatch with central design, "dispatch center" based on the cluster of Quartz implementation, can guarantee the scheduling - center HA;
- 4.Executer HA (Distributed): Task Distributed Execution, Task " Executer " supports cluster deployment to ensure that tasks perform HA; - 4.Executor HA (Distributed): Task Distributed Execution, Task " Executer " supports cluster deployment to ensure that tasks perform HA;
- 5.Task Failover: Deploy the Excuter cluster,tasks will be smooth to switch excuter when the strategy of the router choose failover; - 5.Task Failover: Deploy the Excutor cluster,tasks will be smooth to switch excuter when the strategy of the router choose failover;
- 6.Consistency: "Dispatch Center" through the DB lock to ensure the consistency of cluster distributed scheduling,one task excuted for once; - 6.Consistency: "Dispatch Center" through the DB lock to ensure the consistency of cluster distributed scheduling,one task excuted for once;
- 7.Custom task parameters: support online configuration scheduling tasks into the parameters, immediate effect; - 7.Custom task parameters: support online configuration scheduling tasks into the parameters, immediate effect;
- 8.Scheduling thread pool: scheduling system multi-threaded trigger scheduling operation, to ensure accurate scheduling, not blocked; - 8.Scheduling thread pool: scheduling system multi-threaded trigger scheduling operation, to ensure accurate scheduling, not blocked;

@ -96,7 +96,7 @@ public class JobLogController {
Date triggerTimeEnd = null; Date triggerTimeEnd = null;
if (filterTime!=null && filterTime.trim().length()>0) { if (filterTime!=null && filterTime.trim().length()>0) {
String[] temp = filterTime.split(" - "); String[] temp = filterTime.split(" - ");
if (temp!=null && temp.length == 2) { if (temp.length == 2) {
triggerTimeStart = DateUtil.parseDateTime(temp[0]); triggerTimeStart = DateUtil.parseDateTime(temp[0]);
triggerTimeEnd = DateUtil.parseDateTime(temp[1]); triggerTimeEnd = DateUtil.parseDateTime(temp[1]);
} }

@ -952,7 +952,6 @@ public final class CronExpression implements Serializable, Cloneable {
protected int skipWhiteSpace(int i, String s) { protected int skipWhiteSpace(int i, String s) {
for (; i < s.length() && (s.charAt(i) == ' ' || s.charAt(i) == '\t'); i++) { for (; i < s.length() && (s.charAt(i) == ' ' || s.charAt(i) == '\t'); i++) {
;
} }
return i; return i;
@ -960,7 +959,6 @@ public final class CronExpression implements Serializable, Cloneable {
protected int findNextWhiteSpace(int i, String s) { protected int findNextWhiteSpace(int i, String s) {
for (; i < s.length() && (s.charAt(i) != ' ' || s.charAt(i) != '\t'); i++) { for (; i < s.length() && (s.charAt(i) != ' ' || s.charAt(i) != '\t'); i++) {
;
} }
return i; return i;

@ -11,7 +11,7 @@
// //
///** ///**
// * http job bean // * http job bean
// * “@DisallowConcurrentExecution” diable concurrent, thread size can not be only one, better given more // * “@DisallowConcurrentExecution” disable concurrent, thread size can not be only one, better given more
// * @author xuxueli 2015-12-17 18:20:34 // * @author xuxueli 2015-12-17 18:20:34
// */ // */
////@DisallowConcurrentExecution ////@DisallowConcurrentExecution

@ -35,7 +35,7 @@ public class ExecutorRouteLRU extends ExecutorRouter {
if (lruItem == null) { if (lruItem == null) {
/** /**
* LinkedHashMap * LinkedHashMap
* aaccessOrderture=访get/putfalse= * aaccessOrdertrue=访get/putfalse=
* bremoveEldestEntrytrueLinkedHashMaptrueLRU * bremoveEldestEntrytrueLinkedHashMaptrueLRU
*/ */
lruItem = new LinkedHashMap<String, String>(16, 0.75f, true); lruItem = new LinkedHashMap<String, String>(16, 0.75f, true);

@ -93,7 +93,7 @@ public class JobScheduleHelper {
// 1、trigger // 1、trigger
JobTriggerPoolHelper.trigger(jobInfo.getId(), TriggerTypeEnum.CRON, -1, null, null); JobTriggerPoolHelper.trigger(jobInfo.getId(), TriggerTypeEnum.CRON, -1, null, null);
logger.debug(">>>>>>>>>>> xxl-job, shecule push trigger : jobId = " + jobInfo.getId() ); logger.debug(">>>>>>>>>>> xxl-job, schedule push trigger : jobId = " + jobInfo.getId() );
// 2、fresh next // 2、fresh next
refreshNextValidTime(jobInfo, new Date()); refreshNextValidTime(jobInfo, new Date());
@ -175,9 +175,9 @@ public class JobScheduleHelper {
if (null != preparedStatement) { if (null != preparedStatement) {
try { try {
preparedStatement.close(); preparedStatement.close();
} catch (SQLException ignore) { } catch (SQLException e) {
if (!scheduleThreadToStop) { if (!scheduleThreadToStop) {
logger.error(ignore.getMessage(), ignore); logger.error(e.getMessage(), e);
} }
} }
} }
@ -236,7 +236,7 @@ public class JobScheduleHelper {
// ring trigger // ring trigger
logger.debug(">>>>>>>>>>> xxl-job, time-ring beat : " + nowSecond + " = " + Arrays.asList(ringItemData) ); logger.debug(">>>>>>>>>>> xxl-job, time-ring beat : " + nowSecond + " = " + Arrays.asList(ringItemData) );
if (ringItemData!=null && ringItemData.size()>0) { if (ringItemData.size() > 0) {
// do trigger // do trigger
for (int jobId: ringItemData) { for (int jobId: ringItemData) {
// do trigger // do trigger
@ -289,7 +289,7 @@ public class JobScheduleHelper {
} }
ringItemData.add(jobId); ringItemData.add(jobId);
logger.debug(">>>>>>>>>>> xxl-job, shecule push time-ring : " + ringSecond + " = " + Arrays.asList(ringItemData) ); logger.debug(">>>>>>>>>>> xxl-job, schedule push time-ring : " + ringSecond + " = " + Arrays.asList(ringItemData) );
} }
public void toStop(){ public void toStop(){

@ -62,7 +62,7 @@ public class LocalCacheUtil {
public static boolean set(String key, Object val, long cacheTime){ public static boolean set(String key, Object val, long cacheTime){
// clean timeout cache, before set new cache (avoid cache too much) // clean timeout cache, before set new cache (avoid cache too much)
cleanTimeutCache(); cleanTimeoutCache();
// set new cache // set new cache
if (key==null || key.trim().length()==0) { if (key==null || key.trim().length()==0) {
@ -118,7 +118,7 @@ public class LocalCacheUtil {
* *
* @return * @return
*/ */
public static boolean cleanTimeutCache(){ public static boolean cleanTimeoutCache(){
if (!cacheRepository.keySet().isEmpty()) { if (!cacheRepository.keySet().isEmpty()) {
for (String key: cacheRepository.keySet()) { for (String key: cacheRepository.keySet()) {
LocalCacheData localCacheData = cacheRepository.get(key); LocalCacheData localCacheData = cacheRepository.get(key);

@ -31,7 +31,7 @@ public interface XxlJobRegistryDao {
@Param("registryValue") String registryValue, @Param("registryValue") String registryValue,
@Param("updateTime") Date updateTime); @Param("updateTime") Date updateTime);
public int registryDelete(@Param("registryGroup") String registGroup, public int registryDelete(@Param("registryGroup") String registryGroup,
@Param("registryKey") String registryKey, @Param("registryKey") String registryKey,
@Param("registryValue") String registryValue); @Param("registryValue") String registryValue);

@ -129,15 +129,15 @@ public class AdminBizImpl implements AdminBiz {
public ReturnT<String> registry(RegistryParam registryParam) { public ReturnT<String> registry(RegistryParam registryParam) {
// valid // valid
if (!StringUtils.hasText(registryParam.getRegistGroup()) if (!StringUtils.hasText(registryParam.getRegistryGroup())
|| !StringUtils.hasText(registryParam.getRegistryKey()) || !StringUtils.hasText(registryParam.getRegistryKey())
|| !StringUtils.hasText(registryParam.getRegistryValue())) { || !StringUtils.hasText(registryParam.getRegistryValue())) {
return new ReturnT<String>(ReturnT.FAIL_CODE, "Illegal Argument."); return new ReturnT<String>(ReturnT.FAIL_CODE, "Illegal Argument.");
} }
int ret = xxlJobRegistryDao.registryUpdate(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue(), new Date()); int ret = xxlJobRegistryDao.registryUpdate(registryParam.getRegistryGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue(), new Date());
if (ret < 1) { if (ret < 1) {
xxlJobRegistryDao.registrySave(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue(), new Date()); xxlJobRegistryDao.registrySave(registryParam.getRegistryGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue(), new Date());
// fresh // fresh
freshGroupRegistryInfo(registryParam); freshGroupRegistryInfo(registryParam);
@ -149,13 +149,13 @@ public class AdminBizImpl implements AdminBiz {
public ReturnT<String> registryRemove(RegistryParam registryParam) { public ReturnT<String> registryRemove(RegistryParam registryParam) {
// valid // valid
if (!StringUtils.hasText(registryParam.getRegistGroup()) if (!StringUtils.hasText(registryParam.getRegistryGroup())
|| !StringUtils.hasText(registryParam.getRegistryKey()) || !StringUtils.hasText(registryParam.getRegistryKey())
|| !StringUtils.hasText(registryParam.getRegistryValue())) { || !StringUtils.hasText(registryParam.getRegistryValue())) {
return new ReturnT<String>(ReturnT.FAIL_CODE, "Illegal Argument."); return new ReturnT<String>(ReturnT.FAIL_CODE, "Illegal Argument.");
} }
int ret = xxlJobRegistryDao.registryDelete(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue()); int ret = xxlJobRegistryDao.registryDelete(registryParam.getRegistryGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue());
if (ret > 0) { if (ret > 0) {
// fresh // fresh

@ -291,18 +291,18 @@ public class XxlJobServiceImpl implements XxlJobService {
int jobLogSuccessCount = xxlJobLogDao.triggerCountByHandleCode(ReturnT.SUCCESS_CODE); int jobLogSuccessCount = xxlJobLogDao.triggerCountByHandleCode(ReturnT.SUCCESS_CODE);
// executor count // executor count
Set<String> executerAddressSet = new HashSet<String>(); Set<String> executorAddressSet = new HashSet<String>();
List<XxlJobGroup> groupList = xxlJobGroupDao.findAll(); List<XxlJobGroup> groupList = xxlJobGroupDao.findAll();
if (groupList!=null && !groupList.isEmpty()) { if (groupList!=null && !groupList.isEmpty()) {
for (XxlJobGroup group: groupList) { for (XxlJobGroup group: groupList) {
if (group.getRegistryList()!=null && !group.getRegistryList().isEmpty()) { if (group.getRegistryList()!=null && !group.getRegistryList().isEmpty()) {
executerAddressSet.addAll(group.getRegistryList()); executorAddressSet.addAll(group.getRegistryList());
} }
} }
} }
int executorCount = executerAddressSet.size(); int executorCount = executorAddressSet.size();
Map<String, Object> dashboardMap = new HashMap<String, Object>(); Map<String, Object> dashboardMap = new HashMap<String, Object>();
dashboardMap.put("jobInfoCount", jobInfoCount); dashboardMap.put("jobInfoCount", jobInfoCount);

@ -8,23 +8,23 @@ import java.io.Serializable;
public class RegistryParam implements Serializable { public class RegistryParam implements Serializable {
private static final long serialVersionUID = 42L; private static final long serialVersionUID = 42L;
private String registGroup; private String registryGroup;
private String registryKey; private String registryKey;
private String registryValue; private String registryValue;
public RegistryParam(){} public RegistryParam(){}
public RegistryParam(String registGroup, String registryKey, String registryValue) { public RegistryParam(String registryGroup, String registryKey, String registryValue) {
this.registGroup = registGroup; this.registryGroup = registryGroup;
this.registryKey = registryKey; this.registryKey = registryKey;
this.registryValue = registryValue; this.registryValue = registryValue;
} }
public String getRegistGroup() { public String getRegistryGroup() {
return registGroup; return registryGroup;
} }
public void setRegistGroup(String registGroup) { public void setRegistryGroup(String registryGroup) {
this.registGroup = registGroup; this.registryGroup = registryGroup;
} }
public String getRegistryKey() { public String getRegistryKey() {
@ -46,7 +46,7 @@ public class RegistryParam implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "RegistryParam{" + return "RegistryParam{" +
"registGroup='" + registGroup + '\'' + "registryGroup='" + registryGroup + '\'' +
", registryKey='" + registryKey + '\'' + ", registryKey='" + registryKey + '\'' +
", registryValue='" + registryValue + '\'' + ", registryValue='" + registryValue + '\'' +
'}'; '}';

Loading…
Cancel
Save