Browse Source

Fix typos and clean some code...

周传文 5 years ago
parent
commit
4fa63e3aae

+ 2 - 2
doc/XXL-JOB-English-Documentation.md View File

@@ -19,8 +19,8 @@ XXL-JOB is a lightweight distributed task scheduling framework, the core design
19 19
 - 1.Simple: support through the Web page on the task CRUD operation, simple operation, a minute to get started;
20 20
 - 2.Dynamic: support dynamic modification of task status, pause / resume tasks, and termination of running tasks,immediate effect;
21 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 24
 - 6.Consistency: "Dispatch Center" through the DB lock to ensure the consistency of cluster distributed scheduling,one task excuted for once;
25 25
 - 7.Custom task parameters: support online configuration scheduling tasks into the parameters, immediate effect;
26 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/JobApiController.java View File

@@ -20,7 +20,7 @@ public class JobApiController implements InitializingBean {
20 20
 
21 21
 
22 22
     @Override
23
-    public void afterPropertiesSet() throws Exception {
23
+    public void afterPropertiesSet() {
24 24
 
25 25
     }
26 26
 

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java View File

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

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java View File

@@ -26,7 +26,7 @@ public class XxlJobAdminConfig implements InitializingBean{
26 26
     }
27 27
 
28 28
     @Override
29
-    public void afterPropertiesSet() throws Exception {
29
+    public void afterPropertiesSet() {
30 30
         adminConfig = this;
31 31
     }
32 32
 

+ 2 - 2
xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobScheduler.java View File

@@ -40,7 +40,7 @@ public class XxlJobScheduler implements InitializingBean, DisposableBean {
40 40
 
41 41
 
42 42
     @Override
43
-    public void afterPropertiesSet() throws Exception {
43
+    public void afterPropertiesSet() {
44 44
         // init i18n
45 45
         initI18n();
46 46
 
@@ -116,7 +116,7 @@ public class XxlJobScheduler implements InitializingBean, DisposableBean {
116 116
 
117 117
     // ---------------------- executor-client ----------------------
118 118
     private static ConcurrentMap<String, ExecutorBiz> executorBizRepository = new ConcurrentHashMap<String, ExecutorBiz>();
119
-    public static ExecutorBiz getExecutorBiz(String address) throws Exception {
119
+    public static ExecutorBiz getExecutorBiz(String address) {
120 120
         // valid
121 121
         if (address==null || address.trim().length()==0) {
122 122
             return null;

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

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

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/RemoteHttpJobBean.java View File

@@ -11,7 +11,7 @@
11 11
 //
12 12
 ///**
13 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 15
 // * @author xuxueli 2015-12-17 18:20:34
16 16
 // */
17 17
 ////@DisallowConcurrentExecution

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

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

@@ -93,7 +93,7 @@ public class JobScheduleHelper {
93 93
 
94 94
                                     // 1、trigger
95 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 98
                                     // 2、fresh next
99 99
                                     jobInfo.setTriggerLastTime(jobInfo.getTriggerNextTime());
@@ -177,9 +177,9 @@ public class JobScheduleHelper {
177 177
                         if (null != preparedStatement) {
178 178
                             try {
179 179
                                 preparedStatement.close();
180
-                            } catch (SQLException ignore) {
180
+                            } catch (SQLException e) {
181 181
                                 if (!scheduleThreadToStop) {
182
-                                    logger.error(ignore.getMessage(), ignore);
182
+                                    logger.error(e.getMessage(), e);
183 183
                                 }
184 184
                             }
185 185
                         }
@@ -238,7 +238,7 @@ public class JobScheduleHelper {
238 238
 
239 239
                         // ring trigger
240 240
                         logger.debug(">>>>>>>>>>> xxl-job, time-ring beat : " + nowSecond + " = " + Arrays.asList(ringItemData) );
241
-                        if (ringItemData!=null && ringItemData.size()>0) {
241
+                        if (ringItemData.size() > 0) {
242 242
                             // do trigger
243 243
                             for (int jobId: ringItemData) {
244 244
                                 // do trigger
@@ -291,7 +291,7 @@ public class JobScheduleHelper {
291 291
         }
292 292
         ringItemData.add(jobId);
293 293
 
294
-        logger.debug(">>>>>>>>>>> xxl-job, shecule push time-ring : " + ringSecond + " = " + Arrays.asList(ringItemData) );
294
+        logger.debug(">>>>>>>>>>> xxl-job, schedule push time-ring : " + ringSecond + " = " + Arrays.asList(ringItemData) );
295 295
     }
296 296
 
297 297
     public void toStop(){

+ 2 - 2
xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/LocalCacheUtil.java View File

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

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobRegistryDao.java View File

@@ -26,7 +26,7 @@ public interface XxlJobRegistryDao {
26 26
                             @Param("registryKey") String registryKey,
27 27
                             @Param("registryValue") String registryValue);
28 28
 
29
-    public int registryDelete(@Param("registryGroup") String registGroup,
29
+    public int registryDelete(@Param("registryGroup") String registryGroup,
30 30
                           @Param("registryKey") String registryKey,
31 31
                           @Param("registryValue") String registryValue);
32 32
 

+ 3 - 3
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java View File

@@ -126,9 +126,9 @@ public class AdminBizImpl implements AdminBiz {
126 126
 
127 127
     @Override
128 128
     public ReturnT<String> registry(RegistryParam registryParam) {
129
-        int ret = xxlJobRegistryDao.registryUpdate(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue());
129
+        int ret = xxlJobRegistryDao.registryUpdate(registryParam.getRegistryGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue());
130 130
         if (ret < 1) {
131
-            xxlJobRegistryDao.registrySave(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue());
131
+            xxlJobRegistryDao.registrySave(registryParam.getRegistryGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue());
132 132
 
133 133
             // fresh
134 134
             freshGroupRegistryInfo(registryParam);
@@ -138,7 +138,7 @@ public class AdminBizImpl implements AdminBiz {
138 138
 
139 139
     @Override
140 140
     public ReturnT<String> registryRemove(RegistryParam registryParam) {
141
-        int ret = xxlJobRegistryDao.registryDelete(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue());
141
+        int ret = xxlJobRegistryDao.registryDelete(registryParam.getRegistryGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue());
142 142
         if (ret > 0) {
143 143
 
144 144
             // fresh

+ 3 - 3
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java View File

@@ -284,18 +284,18 @@ public class XxlJobServiceImpl implements XxlJobService {
284 284
 		int jobLogSuccessCount = xxlJobLogDao.triggerCountByHandleCode(ReturnT.SUCCESS_CODE);
285 285
 
286 286
 		// executor count
287
-		Set<String> executerAddressSet = new HashSet<String>();
287
+		Set<String> executorAddressSet = new HashSet<String>();
288 288
 		List<XxlJobGroup> groupList = xxlJobGroupDao.findAll();
289 289
 
290 290
 		if (groupList!=null && !groupList.isEmpty()) {
291 291
 			for (XxlJobGroup group: groupList) {
292 292
 				if (group.getRegistryList()!=null && !group.getRegistryList().isEmpty()) {
293
-					executerAddressSet.addAll(group.getRegistryList());
293
+					executorAddressSet.addAll(group.getRegistryList());
294 294
 				}
295 295
 			}
296 296
 		}
297 297
 
298
-		int executorCount = executerAddressSet.size();
298
+		int executorCount = executorAddressSet.size();
299 299
 
300 300
 		Map<String, Object> dashboardMap = new HashMap<String, Object>();
301 301
 		dashboardMap.put("jobInfoCount", jobInfoCount);

+ 8 - 8
xxl-job-core/src/main/java/com/xxl/job/core/biz/model/RegistryParam.java View File

@@ -8,23 +8,23 @@ import java.io.Serializable;
8 8
 public class RegistryParam implements Serializable {
9 9
     private static final long serialVersionUID = 42L;
10 10
 
11
-    private String registGroup;
11
+    private String registryGroup;
12 12
     private String registryKey;
13 13
     private String registryValue;
14 14
 
15 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 18
         this.registryKey = registryKey;
19 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 30
     public String getRegistryKey() {
@@ -46,7 +46,7 @@ public class RegistryParam implements Serializable {
46 46
     @Override
47 47
     public String toString() {
48 48
         return "RegistryParam{" +
49
-                "registGroup='" + registGroup + '\'' +
49
+                "registryGroup='" + registryGroup + '\'' +
50 50
                 ", registryKey='" + registryKey + '\'' +
51 51
                 ", registryValue='" + registryValue + '\'' +
52 52
                 '}';