Bladeren bron

Merge branch 'master' of https://github.com/xuxueli/xxl-job

xuxueli 5 jaren geleden
bovenliggende
commit
ada47e5aef

+ 2 - 2
doc/XXL-JOB-English-Documentation.md Bestand weergeven

19
 - 1.Simple: support through the Web page on the task CRUD operation, simple operation, a minute to get started;
19
 - 1.Simple: support through the Web page on the task CRUD operation, simple operation, a minute to get started;
20
 - 2.Dynamic: support dynamic modification of task status, pause / resume tasks, and termination of running tasks,immediate effect;
20
 - 2.Dynamic: support dynamic modification of task status, pause / resume tasks, and termination of running tasks,immediate effect;
21
 - 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;
21
 - 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;
22
-- 4.Executer HA (Distributed): Task Distributed Execution, Task " Executer " supports cluster deployment to ensure that tasks perform HA;
23
-- 5.Task Failover: Deploy the Excuter cluster,tasks will be smooth to switch excuter when the strategy of the router choose ‘failover’;
22
+- 4.Executor HA (Distributed): Task Distributed Execution, Task " Executer " supports cluster deployment to ensure that tasks perform HA;
23
+- 5.Task Failover: Deploy the Excutor cluster,tasks will be smooth to switch excuter when the strategy of the router choose ‘failover’;
24
 - 6.Consistency: "Dispatch Center" through the DB lock to ensure the consistency of cluster distributed scheduling,one task excuted for once;
24
 - 6.Consistency: "Dispatch Center" through the DB lock to ensure the consistency of cluster distributed scheduling,one task excuted for once;
25
 - 7.Custom task parameters: support online configuration scheduling tasks into the parameters, immediate effect;
25
 - 7.Custom task parameters: support online configuration scheduling tasks into the parameters, immediate effect;
26
 - 8.Scheduling thread pool: scheduling system multi-threaded trigger scheduling operation, to ensure accurate scheduling, not blocked;
26
 - 8.Scheduling thread pool: scheduling system multi-threaded trigger scheduling operation, to ensure accurate scheduling, not blocked;

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java Bestand weergeven

96
 		Date triggerTimeEnd = null;
96
 		Date triggerTimeEnd = null;
97
 		if (filterTime!=null && filterTime.trim().length()>0) {
97
 		if (filterTime!=null && filterTime.trim().length()>0) {
98
 			String[] temp = filterTime.split(" - ");
98
 			String[] temp = filterTime.split(" - ");
99
-			if (temp!=null && temp.length == 2) {
99
+			if (temp.length == 2) {
100
 				triggerTimeStart = DateUtil.parseDateTime(temp[0]);
100
 				triggerTimeStart = DateUtil.parseDateTime(temp[0]);
101
 				triggerTimeEnd = DateUtil.parseDateTime(temp[1]);
101
 				triggerTimeEnd = DateUtil.parseDateTime(temp[1]);
102
 			}
102
 			}

+ 0 - 2
xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java Bestand weergeven

952
 
952
 
953
     protected int skipWhiteSpace(int i, String s) {
953
     protected int skipWhiteSpace(int i, String s) {
954
         for (; i < s.length() && (s.charAt(i) == ' ' || s.charAt(i) == '\t'); i++) {
954
         for (; i < s.length() && (s.charAt(i) == ' ' || s.charAt(i) == '\t'); i++) {
955
-            ;
956
         }
955
         }
957
 
956
 
958
         return i;
957
         return i;
960
 
959
 
961
     protected int findNextWhiteSpace(int i, String s) {
960
     protected int findNextWhiteSpace(int i, String s) {
962
         for (; i < s.length() && (s.charAt(i) != ' ' || s.charAt(i) != '\t'); i++) {
961
         for (; i < s.length() && (s.charAt(i) != ' ' || s.charAt(i) != '\t'); i++) {
963
-            ;
964
         }
962
         }
965
 
963
 
966
         return i;
964
         return i;

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/RemoteHttpJobBean.java Bestand weergeven

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

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java Bestand weergeven

35
         if (lruItem == null) {
35
         if (lruItem == null) {
36
             /**
36
             /**
37
              * LinkedHashMap
37
              * LinkedHashMap
38
-             *      a、accessOrder:ture=访问顺序排序(get/put时排序);false=插入顺序排期;
38
+             *      a、accessOrder:true=访问顺序排序(get/put时排序);false=插入顺序排期;
39
              *      b、removeEldestEntry:新增元素时将会调用,返回true时会删除最老元素;可封装LinkedHashMap并重写该方法,比如定义最大容量,超出是返回true即可实现固定长度的LRU算法;
39
              *      b、removeEldestEntry:新增元素时将会调用,返回true时会删除最老元素;可封装LinkedHashMap并重写该方法,比如定义最大容量,超出是返回true即可实现固定长度的LRU算法;
40
              */
40
              */
41
             lruItem = new LinkedHashMap<String, String>(16, 0.75f, true);
41
             lruItem = new LinkedHashMap<String, String>(16, 0.75f, true);

+ 5 - 5
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java Bestand weergeven

93
 
93
 
94
                                     // 1、trigger
94
                                     // 1、trigger
95
                                     JobTriggerPoolHelper.trigger(jobInfo.getId(), TriggerTypeEnum.CRON, -1, null, null);
95
                                     JobTriggerPoolHelper.trigger(jobInfo.getId(), TriggerTypeEnum.CRON, -1, null, null);
96
-                                    logger.debug(">>>>>>>>>>> xxl-job, shecule push trigger : jobId = " + jobInfo.getId() );
96
+                                    logger.debug(">>>>>>>>>>> xxl-job, schedule push trigger : jobId = " + jobInfo.getId() );
97
 
97
 
98
                                     // 2、fresh next
98
                                     // 2、fresh next
99
                                     refreshNextValidTime(jobInfo, new Date());
99
                                     refreshNextValidTime(jobInfo, new Date());
175
                         if (null != preparedStatement) {
175
                         if (null != preparedStatement) {
176
                             try {
176
                             try {
177
                                 preparedStatement.close();
177
                                 preparedStatement.close();
178
-                            } catch (SQLException ignore) {
178
+                            } catch (SQLException e) {
179
                                 if (!scheduleThreadToStop) {
179
                                 if (!scheduleThreadToStop) {
180
-                                    logger.error(ignore.getMessage(), ignore);
180
+                                    logger.error(e.getMessage(), e);
181
                                 }
181
                                 }
182
                             }
182
                             }
183
                         }
183
                         }
236
 
236
 
237
                         // ring trigger
237
                         // ring trigger
238
                         logger.debug(">>>>>>>>>>> xxl-job, time-ring beat : " + nowSecond + " = " + Arrays.asList(ringItemData) );
238
                         logger.debug(">>>>>>>>>>> xxl-job, time-ring beat : " + nowSecond + " = " + Arrays.asList(ringItemData) );
239
-                        if (ringItemData!=null && ringItemData.size()>0) {
239
+                        if (ringItemData.size() > 0) {
240
                             // do trigger
240
                             // do trigger
241
                             for (int jobId: ringItemData) {
241
                             for (int jobId: ringItemData) {
242
                                 // do trigger
242
                                 // do trigger
289
         }
289
         }
290
         ringItemData.add(jobId);
290
         ringItemData.add(jobId);
291
 
291
 
292
-        logger.debug(">>>>>>>>>>> xxl-job, shecule push time-ring : " + ringSecond + " = " + Arrays.asList(ringItemData) );
292
+        logger.debug(">>>>>>>>>>> xxl-job, schedule push time-ring : " + ringSecond + " = " + Arrays.asList(ringItemData) );
293
     }
293
     }
294
 
294
 
295
     public void toStop(){
295
     public void toStop(){

+ 2 - 2
xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/LocalCacheUtil.java Bestand weergeven

62
     public static boolean set(String key, Object val, long cacheTime){
62
     public static boolean set(String key, Object val, long cacheTime){
63
 
63
 
64
         // clean timeout cache, before set new cache (avoid cache too much)
64
         // clean timeout cache, before set new cache (avoid cache too much)
65
-        cleanTimeutCache();
65
+        cleanTimeoutCache();
66
 
66
 
67
         // set new cache
67
         // set new cache
68
         if (key==null || key.trim().length()==0) {
68
         if (key==null || key.trim().length()==0) {
118
      *
118
      *
119
      * @return
119
      * @return
120
      */
120
      */
121
-    public static boolean cleanTimeutCache(){
121
+    public static boolean cleanTimeoutCache(){
122
         if (!cacheRepository.keySet().isEmpty()) {
122
         if (!cacheRepository.keySet().isEmpty()) {
123
             for (String key: cacheRepository.keySet()) {
123
             for (String key: cacheRepository.keySet()) {
124
                 LocalCacheData localCacheData = cacheRepository.get(key);
124
                 LocalCacheData localCacheData = cacheRepository.get(key);

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobRegistryDao.java Bestand weergeven

31
                             @Param("registryValue") String registryValue,
31
                             @Param("registryValue") String registryValue,
32
                             @Param("updateTime") Date updateTime);
32
                             @Param("updateTime") Date updateTime);
33
 
33
 
34
-    public int registryDelete(@Param("registryGroup") String registGroup,
34
+    public int registryDelete(@Param("registryGroup") String registryGroup,
35
                           @Param("registryKey") String registryKey,
35
                           @Param("registryKey") String registryKey,
36
                           @Param("registryValue") String registryValue);
36
                           @Param("registryValue") String registryValue);
37
 
37
 

+ 5 - 5
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java Bestand weergeven

129
     public ReturnT<String> registry(RegistryParam registryParam) {
129
     public ReturnT<String> registry(RegistryParam registryParam) {
130
 
130
 
131
         // valid
131
         // valid
132
-        if (!StringUtils.hasText(registryParam.getRegistGroup())
132
+        if (!StringUtils.hasText(registryParam.getRegistryGroup())
133
                 || !StringUtils.hasText(registryParam.getRegistryKey())
133
                 || !StringUtils.hasText(registryParam.getRegistryKey())
134
                 || !StringUtils.hasText(registryParam.getRegistryValue())) {
134
                 || !StringUtils.hasText(registryParam.getRegistryValue())) {
135
             return new ReturnT<String>(ReturnT.FAIL_CODE, "Illegal Argument.");
135
             return new ReturnT<String>(ReturnT.FAIL_CODE, "Illegal Argument.");
136
         }
136
         }
137
 
137
 
138
-        int ret = xxlJobRegistryDao.registryUpdate(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue(), new Date());
138
+        int ret = xxlJobRegistryDao.registryUpdate(registryParam.getRegistryGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue(), new Date());
139
         if (ret < 1) {
139
         if (ret < 1) {
140
-            xxlJobRegistryDao.registrySave(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue(), new Date());
140
+            xxlJobRegistryDao.registrySave(registryParam.getRegistryGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue(), new Date());
141
 
141
 
142
             // fresh
142
             // fresh
143
             freshGroupRegistryInfo(registryParam);
143
             freshGroupRegistryInfo(registryParam);
149
     public ReturnT<String> registryRemove(RegistryParam registryParam) {
149
     public ReturnT<String> registryRemove(RegistryParam registryParam) {
150
 
150
 
151
         // valid
151
         // valid
152
-        if (!StringUtils.hasText(registryParam.getRegistGroup())
152
+        if (!StringUtils.hasText(registryParam.getRegistryGroup())
153
                 || !StringUtils.hasText(registryParam.getRegistryKey())
153
                 || !StringUtils.hasText(registryParam.getRegistryKey())
154
                 || !StringUtils.hasText(registryParam.getRegistryValue())) {
154
                 || !StringUtils.hasText(registryParam.getRegistryValue())) {
155
             return new ReturnT<String>(ReturnT.FAIL_CODE, "Illegal Argument.");
155
             return new ReturnT<String>(ReturnT.FAIL_CODE, "Illegal Argument.");
156
         }
156
         }
157
 
157
 
158
-        int ret = xxlJobRegistryDao.registryDelete(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue());
158
+        int ret = xxlJobRegistryDao.registryDelete(registryParam.getRegistryGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue());
159
         if (ret > 0) {
159
         if (ret > 0) {
160
 
160
 
161
             // fresh
161
             // fresh

+ 3 - 3
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java Bestand weergeven

291
 		int jobLogSuccessCount = xxlJobLogDao.triggerCountByHandleCode(ReturnT.SUCCESS_CODE);
291
 		int jobLogSuccessCount = xxlJobLogDao.triggerCountByHandleCode(ReturnT.SUCCESS_CODE);
292
 
292
 
293
 		// executor count
293
 		// executor count
294
-		Set<String> executerAddressSet = new HashSet<String>();
294
+		Set<String> executorAddressSet = new HashSet<String>();
295
 		List<XxlJobGroup> groupList = xxlJobGroupDao.findAll();
295
 		List<XxlJobGroup> groupList = xxlJobGroupDao.findAll();
296
 
296
 
297
 		if (groupList!=null && !groupList.isEmpty()) {
297
 		if (groupList!=null && !groupList.isEmpty()) {
298
 			for (XxlJobGroup group: groupList) {
298
 			for (XxlJobGroup group: groupList) {
299
 				if (group.getRegistryList()!=null && !group.getRegistryList().isEmpty()) {
299
 				if (group.getRegistryList()!=null && !group.getRegistryList().isEmpty()) {
300
-					executerAddressSet.addAll(group.getRegistryList());
300
+					executorAddressSet.addAll(group.getRegistryList());
301
 				}
301
 				}
302
 			}
302
 			}
303
 		}
303
 		}
304
 
304
 
305
-		int executorCount = executerAddressSet.size();
305
+		int executorCount = executorAddressSet.size();
306
 
306
 
307
 		Map<String, Object> dashboardMap = new HashMap<String, Object>();
307
 		Map<String, Object> dashboardMap = new HashMap<String, Object>();
308
 		dashboardMap.put("jobInfoCount", jobInfoCount);
308
 		dashboardMap.put("jobInfoCount", jobInfoCount);

+ 8 - 8
xxl-job-core/src/main/java/com/xxl/job/core/biz/model/RegistryParam.java Bestand weergeven

8
 public class RegistryParam implements Serializable {
8
 public class RegistryParam implements Serializable {
9
     private static final long serialVersionUID = 42L;
9
     private static final long serialVersionUID = 42L;
10
 
10
 
11
-    private String registGroup;
11
+    private String registryGroup;
12
     private String registryKey;
12
     private String registryKey;
13
     private String registryValue;
13
     private String registryValue;
14
 
14
 
15
     public RegistryParam(){}
15
     public RegistryParam(){}
16
-    public RegistryParam(String registGroup, String registryKey, String registryValue) {
17
-        this.registGroup = registGroup;
16
+    public RegistryParam(String registryGroup, String registryKey, String registryValue) {
17
+        this.registryGroup = registryGroup;
18
         this.registryKey = registryKey;
18
         this.registryKey = registryKey;
19
         this.registryValue = registryValue;
19
         this.registryValue = registryValue;
20
     }
20
     }
21
 
21
 
22
-    public String getRegistGroup() {
23
-        return registGroup;
22
+    public String getRegistryGroup() {
23
+        return registryGroup;
24
     }
24
     }
25
 
25
 
26
-    public void setRegistGroup(String registGroup) {
27
-        this.registGroup = registGroup;
26
+    public void setRegistryGroup(String registryGroup) {
27
+        this.registryGroup = registryGroup;
28
     }
28
     }
29
 
29
 
30
     public String getRegistryKey() {
30
     public String getRegistryKey() {
46
     @Override
46
     @Override
47
     public String toString() {
47
     public String toString() {
48
         return "RegistryParam{" +
48
         return "RegistryParam{" +
49
-                "registGroup='" + registGroup + '\'' +
49
+                "registryGroup='" + registryGroup + '\'' +
50
                 ", registryKey='" + registryKey + '\'' +
50
                 ", registryKey='" + registryKey + '\'' +
51
                 ", registryValue='" + registryValue + '\'' +
51
                 ", registryValue='" + registryValue + '\'' +
52
                 '}';
52
                 '}';