精简项目,取消第三方依赖,如 commons-collections4 ;

master
xuxueli 6 years ago
parent cc31669821
commit bce7cc4676
  1. 1
      doc/XXL-JOB官方文档.md
  2. 1
      pom.xml
  3. 8
      xxl-job-admin/pom.xml
  4. 4
      xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java
  5. 5
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
  6. 6
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobRegistryMonitorHelper.java
  7. 6
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java
  8. 7
      xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java

@ -1397,6 +1397,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 2、任务告警逻辑调整,改为通过扫描失败日志方式触发。一方面精确扫描失败任务,降低扫描范围;另一方面取消内存队列,降低线程内存消耗;
- 3、记住密码功能优化,选中时永久记住;非选中时关闭浏览器即登出;
- 4、项目依赖升级至较新稳定版本,如spring、jackson、groovy等等;
- 5、精简项目,取消第三方依赖,如 commons-collections4 ;
- [迭代中]注册中心优化,实时性注册发现:心跳注册间隔10s,refresh失败则首次注册并立即更新注册信息,心跳类似;30s过期销毁;
- [迭代中]脚本任务,支持数据参数,新版本仅支持单参数不支持需要兼容;
- [迭代中]提供执行器Docker镜像;

@ -36,7 +36,6 @@
<junit.version>4.12</junit.version>
<commons-exec.version>1.3</commons-exec.version>
<commons-collections4.version>4.2</commons-collections4.version>
<commons-lang3.version>3.8.1</commons-lang3.version>
<groovy.version>2.5.5</groovy.version>

@ -88,12 +88,6 @@
<version>${mysql-connector-java.version}</version>
</dependency>
<!-- commons-collections4 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons-collections4.version}</version>
</dependency>
<!-- commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
@ -102,8 +96,6 @@
</dependency>
<!-- quartz :quartz-2.2.3/c3p0-0.9.1.1/slf4j-api-1.6.6 -->
<dependency>
<groupId>org.quartz-scheduler</groupId>

@ -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<String> registryList = findRegistryByAppName(xxlJobGroup.getAppName());
String addressListStr = null;
if (CollectionUtils.isNotEmpty(registryList)) {
if (registryList!=null && !registryList.isEmpty()) {
Collections.sort(registryList);
addressListStr = StringUtils.join(registryList, ",");
}

@ -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<Integer> failLogIds = XxlJobAdminConfig.getAdminConfig().getXxlJobLogDao().findFailJobLogIds(1000);
if (CollectionUtils.isNotEmpty(failLogIds)) {
if (failLogIds!=null && !failLogIds.isEmpty()) {
for (int failLogId: failLogIds) {
// lock log

@ -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<XxlJobGroup> 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<String> registryList = appAddressMap.get(group.getAppName());
String addressListStr = null;
if (CollectionUtils.isNotEmpty(registryList)) {
if (registryList!=null && !registryList.isEmpty()) {
Collections.sort(registryList);
addressListStr = StringUtils.join(registryList, ",");
}

@ -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<String> 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);

@ -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<String> executerAddressSet = new HashSet<String>();
List<XxlJobGroup> 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<Map<String, Object>> triggerCountMapAll = xxlJobLogDao.triggerCountByDay(startDate, endDate);
if (CollectionUtils.isNotEmpty(triggerCountMapAll)) {
if (triggerCountMapAll!=null && triggerCountMapAll.size()>0) {
for (Map<String, Object> item: triggerCountMapAll) {
String day = String.valueOf(item.get("triggerDay"));
int triggerDayCount = Integer.valueOf(String.valueOf(item.get("triggerDayCount")));

Loading…
Cancel
Save