diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 5db21444..3c4f6f49 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1397,6 +1397,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 2、任务告警逻辑调整,改为通过扫描失败日志方式触发。一方面精确扫描失败任务,降低扫描范围;另一方面取消内存队列,降低线程内存消耗; - 3、记住密码功能优化,选中时永久记住;非选中时关闭浏览器即登出; - 4、项目依赖升级至较新稳定版本,如spring、jackson、groovy等等; +- 5、精简项目,取消第三方依赖,如 commons-collections4 ; - [迭代中]注册中心优化,实时性注册发现:心跳注册间隔10s,refresh失败则首次注册并立即更新注册信息,心跳类似;30s过期销毁; - [迭代中]脚本任务,支持数据参数,新版本仅支持单参数不支持需要兼容; - [迭代中]提供执行器Docker镜像; diff --git a/pom.xml b/pom.xml index 1dd8b1e3..bb1e67d7 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,6 @@ 4.12 1.3 - 4.2 3.8.1 2.5.5 diff --git a/xxl-job-admin/pom.xml b/xxl-job-admin/pom.xml index b0139907..f1f065b5 100644 --- a/xxl-job-admin/pom.xml +++ b/xxl-job-admin/pom.xml @@ -88,12 +88,6 @@ ${mysql-connector-java.version} - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - org.apache.commons @@ -102,8 +96,6 @@ - - org.quartz-scheduler diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java index b3eed30c..b39306ca 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java @@ -3,13 +3,11 @@ package com.xxl.job.admin.controller; import com.xxl.job.admin.core.conf.XxlJobAdminConfig; import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobRegistry; -import com.xxl.job.admin.core.schedule.XxlJobDynamicScheduler; import com.xxl.job.admin.core.util.I18nUtil; import com.xxl.job.admin.dao.XxlJobGroupDao; import com.xxl.job.admin.dao.XxlJobInfoDao; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.enums.RegistryConfig; -import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -92,7 +90,7 @@ public class JobGroupController { // 0=自动注册 List registryList = findRegistryByAppName(xxlJobGroup.getAppName()); String addressListStr = null; - if (CollectionUtils.isNotEmpty(registryList)) { + if (registryList!=null && !registryList.isEmpty()) { Collections.sort(registryList); addressListStr = StringUtils.join(registryList, ","); } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java index 2e59d633..acea99fc 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java @@ -7,14 +7,11 @@ import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.admin.core.trigger.TriggerTypeEnum; import com.xxl.job.admin.core.util.I18nUtil; import com.xxl.job.core.biz.model.ReturnT; -import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.mail.javamail.MimeMessageHelper; -import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; -import java.io.UnsupportedEncodingException; import java.text.MessageFormat; import java.util.Arrays; import java.util.HashSet; @@ -50,7 +47,7 @@ public class JobFailMonitorHelper { try { List failLogIds = XxlJobAdminConfig.getAdminConfig().getXxlJobLogDao().findFailJobLogIds(1000); - if (CollectionUtils.isNotEmpty(failLogIds)) { + if (failLogIds!=null && !failLogIds.isEmpty()) { for (int failLogId: failLogIds) { // lock log diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobRegistryMonitorHelper.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobRegistryMonitorHelper.java index e1dd3a12..3856c991 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobRegistryMonitorHelper.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobRegistryMonitorHelper.java @@ -3,9 +3,7 @@ package com.xxl.job.admin.core.thread; import com.xxl.job.admin.core.conf.XxlJobAdminConfig; import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobRegistry; -import com.xxl.job.admin.core.schedule.XxlJobDynamicScheduler; import com.xxl.job.core.enums.RegistryConfig; -import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,7 +36,7 @@ public class JobRegistryMonitorHelper { try { // auto registry group List groupList = XxlJobAdminConfig.getAdminConfig().getXxlJobGroupDao().findByAddressType(0); - if (CollectionUtils.isNotEmpty(groupList)) { + if (groupList!=null && !groupList.isEmpty()) { // remove dead address (admin/executor) XxlJobAdminConfig.getAdminConfig().getXxlJobRegistryDao().removeDead(RegistryConfig.DEAD_TIMEOUT); @@ -67,7 +65,7 @@ public class JobRegistryMonitorHelper { for (XxlJobGroup group: groupList) { List registryList = appAddressMap.get(group.getAppName()); String addressListStr = null; - if (CollectionUtils.isNotEmpty(registryList)) { + if (registryList!=null && !registryList.isEmpty()) { Collections.sort(registryList); addressListStr = StringUtils.join(registryList, ","); } 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 7a60eeed..934b372e 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 @@ -13,7 +13,6 @@ import com.xxl.job.core.biz.model.TriggerParam; import com.xxl.job.core.enums.ExecutorBlockStrategyEnum; import com.xxl.rpc.util.IpUtil; import com.xxl.rpc.util.ThrowableUtil; -import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -64,7 +63,8 @@ public class XxlJobTrigger { } } if (ExecutorRouteStrategyEnum.SHARDING_BROADCAST==ExecutorRouteStrategyEnum.match(jobInfo.getExecutorRouteStrategy(), null) - && CollectionUtils.isNotEmpty(group.getRegistryList()) && shardingParam==null) { + && group.getRegistryList()!=null && !group.getRegistryList().isEmpty() + && shardingParam==null) { for (int i = 0; i < group.getRegistryList().size(); i++) { processTrigger(group, jobInfo, finalFailRetryCount, triggerType, i, group.getRegistryList().size()); } @@ -118,7 +118,7 @@ public class XxlJobTrigger { // 3、init address String address = null; ReturnT routeAddressResult = null; - if (CollectionUtils.isNotEmpty(group.getRegistryList())) { + if (group.getRegistryList()!=null && !group.getRegistryList().isEmpty()) { if (ExecutorRouteStrategyEnum.SHARDING_BROADCAST == executorRouteStrategyEnum) { if (index < group.getRegistryList().size()) { address = group.getRegistryList().get(index); diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java index 205b553a..6b6ee268 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java @@ -13,7 +13,6 @@ import com.xxl.job.admin.service.XxlJobService; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.enums.ExecutorBlockStrategyEnum; import com.xxl.job.core.glue.GlueTypeEnum; -import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.FastDateFormat; @@ -287,9 +286,9 @@ public class XxlJobServiceImpl implements XxlJobService { Set executerAddressSet = new HashSet(); List groupList = xxlJobGroupDao.findAll(); - if (CollectionUtils.isNotEmpty(groupList)) { + if (groupList!=null && !groupList.isEmpty()) { for (XxlJobGroup group: groupList) { - if (CollectionUtils.isNotEmpty(group.getRegistryList())) { + if (group.getRegistryList()!=null && !group.getRegistryList().isEmpty()) { executerAddressSet.addAll(group.getRegistryList()); } } @@ -325,7 +324,7 @@ public class XxlJobServiceImpl implements XxlJobService { int triggerCountFailTotal = 0; List> triggerCountMapAll = xxlJobLogDao.triggerCountByDay(startDate, endDate); - if (CollectionUtils.isNotEmpty(triggerCountMapAll)) { + if (triggerCountMapAll!=null && triggerCountMapAll.size()>0) { for (Map item: triggerCountMapAll) { String day = String.valueOf(item.get("triggerDay")); int triggerDayCount = Integer.valueOf(String.valueOf(item.get("triggerDayCount")));