From f4576a370582b11d87ae4bca0b063c0aa8a34c47 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Fri, 5 Oct 2018 14:15:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0RM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 +++--- doc/XXL-JOB官方文档.md | 3 ++- pom.xml | 4 ++-- xxl-job-admin/Dockerfile | 4 ++-- .../xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java | 2 +- .../xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java | 2 +- xxl-job-admin/src/main/resources/i18n/message_en.properties | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index f4dc6b1e..f3da5020 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM tomcat -MAINTAINER youji@ebay.com +FROM tomcat:8.0-jre8-slim +MAINTAINER xuxueli -ADD xxl-job-admin/target/xxl-job-admin.*.war /usr/local/tomcat/webapps/scheduler.war +ADD xxl-job-admin/target/xxl-job-admin.*.war /usr/local/tomcat/webapps/xxl-job-admin.war ADD xxl-job-core/target/xxl-job-core.*.jar /usr/local/tomcat/webapps/ ADD xxl-job-executor-samples/xxl-job-executor-sample-springboot/target/xxl-job-executor-sample*..jar /usr/local/tomcat/webapps/ ADD xxl-job-executor-samples/xxl-job-executor-sample-spring/target/xxl-job-executor-sample-spring.*.war /usr/local/tomcat/webapps/executor.war diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index c75bc207..93e254c1 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1307,7 +1307,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 5、调度任务优先级; - 6、移除quartz依赖,重写调度模块:新增或恢复任务时将下次执行记录插入delayqueue,调度中心集群竞争分布式锁,成功节点批量加载到期delayqueue数据,批量执行。 - 7、springboot 和 docker镜像,并且推送docker镜像到中央仓库,更进一步实现产品开箱即用; -- 8、多数据库支持; +- 8、多数据库支持,在重写并移除Quartz的基础上,DAO层通过JPA实现,不限制数据库类型; - 9、执行器Log清理功能:调度中心Log删除时同步删除执行器中的Log文件; - 10、Bean模式任务,JobHandler自动从执行器中查询展示为下拉框,选择后自动填充任务名称等属性; - 11、API事件触发类型任务(更类似MQ消息)支持"动态传参、延时消费";该类型任务不走Quartz,单独建立MQ消息表,调度中心竞争触发;待定,该功能与 XXL-MQ 冲突,该场景建议用后者; @@ -1325,6 +1325,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 23、流程任务等,透传动态参数; - 24、任务状态与quartz解耦,降低quartz调度压力,仅NORMAL状态任务绑定quartz; - 25、任务支持切换执行器; +- 26、任务自动注册;待考虑,因为任务自动注册将会导致任务难以管理控制; ## 七、其他 diff --git a/pom.xml b/pom.xml index a396e513..9d41e562 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ org.apache.maven.plugins maven-war-plugin - 2.2 + 2.5 false @@ -133,7 +133,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 2.10.3 package diff --git a/xxl-job-admin/Dockerfile b/xxl-job-admin/Dockerfile index 4c46e314..f2c8c711 100644 --- a/xxl-job-admin/Dockerfile +++ b/xxl-job-admin/Dockerfile @@ -1,4 +1,4 @@ -FROM tomcat:latest +FROM tomcat:8.0-jre8-slim MAINTAINER xuxueli -ADD target/xxl-job-admin-*.war /usr/local/tomcat/webapps/xxl-job-admin.war \ No newline at end of file +ADD target/xxl-job-admin*.war /usr/local/tomcat/webapps/xxl-job-admin.war \ No newline at end of file diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java index d5ca8da1..3bd8f370 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java @@ -31,7 +31,7 @@ public class ExecutorRouteLFU extends ExecutorRouter { HashMap lfuItemMap = jobLfuMap.get(jobId); // Key排序可以用TreeMap+构造入参Compare;Value排序暂时只能通过ArrayList; if (lfuItemMap == null) { lfuItemMap = new HashMap(); - jobLfuMap.put(jobId, lfuItemMap); + jobLfuMap.putIfAbsent(jobId, lfuItemMap); // 避免重复覆盖 } for (String address: addressList) { if (!lfuItemMap.containsKey(address) || lfuItemMap.get(address) >1000000 ) { diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java index bea509e0..ed623b3e 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java @@ -37,7 +37,7 @@ public class ExecutorRouteLRU extends ExecutorRouter { * b、removeEldestEntry:新增元素时将会调用,返回true时会删除最老元素;可封装LinkedHashMap并重写该方法,比如定义最大容量,超出是返回true即可实现固定长度的LRU算法; */ lruItem = new LinkedHashMap<>(16, 0.75f, true); - jobLRUMap.put(jobId, lruItem); + jobLRUMap.putIfAbsent(jobId, lruItem); } // put diff --git a/xxl-job-admin/src/main/resources/i18n/message_en.properties b/xxl-job-admin/src/main/resources/i18n/message_en.properties index 9b63d4bc..a2ace427 100644 --- a/xxl-job-admin/src/main/resources/i18n/message_en.properties +++ b/xxl-job-admin/src/main/resources/i18n/message_en.properties @@ -185,7 +185,7 @@ jobgroup_field_addressType_limit=Manually registration type, the machine address jobgroup_field_registryList=machine address jobgroup_field_registryList_unvalid=registry machine address is illegal jobgroup_field_registryList_placeholder=Please enter the machine address, if there are more than one comma separated -jobgroup_field_appName_limit=Limit the beginning of a lowercase letter, consists of lowercase letters、number and underscores. +jobgroup_field_appName_limit=Limit the beginning of a lowercase letter, consists of lowercase letters、number and hyphen. jobgroup_field_appName_length=AppName length is limited to 4~64 jobgroup_field_title_length=Title length is limited to 4~12 jobgroup_field_order_digits=Please enter a positive integer