From 4f1c6c7c318a6a6ed5456091df7e273d44c1ab8f Mon Sep 17 00:00:00 2001 From: "xueli.xue" Date: Thu, 29 Oct 2020 21:45:38 +0800 Subject: [PATCH] =?UTF-8?q?-=2019=E3=80=81[ING]=E4=BB=BB=E5=8A=A1=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E5=8F=82=E6=95=B0=E4=BC=98=E5=8C=96=EF=BC=9A=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=80=89=E6=8B=A9=20"Cron=E8=A7=A6=E5=8F=91"=E3=80=81?= =?UTF-8?q?"=E5=9B=BA=E5=AE=9A=E9=97=B4=E9=9A=94=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=A7=A6=E5=8F=91"=E3=80=81"=E6=8C=87=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=82=B9=E8=A7=A6=E5=8F=91"=E3=80=81"=E4=B8=8D?= =?UTF-8?q?=E9=80=89=E6=8B=A9"=20=E7=AD=89=EF=BC=9B=20-=2020=E3=80=81[ING]?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=20misfire=20=E7=AD=96=E7=95=A5=EF=BC=9A?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=E3=80=81=E8=A1=A5=E5=81=BF=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E3=80=81=E8=A1=A5=E5=81=BF=E6=9C=80=E8=BF=9110=E6=AC=A1?= =?UTF-8?q?=E2=80=A6=E2=80=A6=E7=AD=89=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 9 ++++--- doc/db/tables_xxl_job.sql | 6 +++-- .../core/scheduler/MisfireStrategyEnum.java | 20 +++++++++++++++ .../core/scheduler/ScheduleTypeEnum.java | 25 +++++++++++++++++++ 4 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 xxl-job-admin/src/main/java/com/xxl/job/admin/core/scheduler/MisfireStrategyEnum.java create mode 100644 xxl-job-admin/src/main/java/com/xxl/job/admin/core/scheduler/ScheduleTypeEnum.java diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 55f6dc44..8127872d 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -2062,9 +2062,11 @@ data: post-data - 16、调度中心组件加载顺序优化,修复极端情况下调度组件初始慢导致的调度失败问题; - 17、执行器注册线程优化,修复极端情况下初始化失败时导致NPE问题; - 18、执行器Commandhandler示例任务优化,修复极端情况下脚本进程挂起问题; -- 19、[规划中]分片任务:全部完成后才会出发后置节点; -- 20、[规划中]执行器注册,异步写入; -- 21、[规划中]任务触发参数优化:支持选择 "Cron触发"、"固定间隔时间触发"、"指定时间点触发"、"不选择" 等; +- 19、[ING]任务触发参数优化:支持选择 "Cron触发"、"固定间隔时间触发"、"指定时间点触发"、"不选择" 等; +- 20、[ING]任务 misfire 策略:忽略、补偿一次、补偿最近10次……等; +- 21、[规划中]分片任务:全部完成后才会出发后置节点; +- 22、[规划中]执行器注册,异步写入; + ### 7.32 版本 v2.3.0 Release Notes[规划中] - 1、[规划中]DAG流程任务 @@ -2104,7 +2106,6 @@ data: post-data - 23、AccessToken按照执行器维度设置;控制调度、回调; - 24、新增执行器描述属性;任务名称属性; - 25、自定义失败重试时间间隔; -- 26、任务 misfire 策略:忽略、补偿一次、补偿最近10次……等; ## 八、其他 diff --git a/doc/db/tables_xxl_job.sql b/doc/db/tables_xxl_job.sql index 09ac2147..9c16f139 100644 --- a/doc/db/tables_xxl_job.sql +++ b/doc/db/tables_xxl_job.sql @@ -16,6 +16,9 @@ CREATE TABLE `xxl_job_info` ( `update_time` datetime DEFAULT NULL, `author` varchar(64) DEFAULT NULL COMMENT '作者', `alarm_email` varchar(255) DEFAULT NULL COMMENT '报警邮件', + `schedule_type` varchar(50) NOT NULL DEFAULT 'NONE' COMMENT '调度类型', + `schedule_conf` varchar(128) DEFAULT NULL COMMENT '调度配置,值含义取决于调度类型', + `misfire_strategy` varchar(50) NOT NULL DEFAULT 'DO_NOTHING' COMMENT '过期任务处理机制', `executor_route_strategy` varchar(50) DEFAULT NULL COMMENT '执行器路由策略', `executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler', `executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数', @@ -111,9 +114,8 @@ CREATE TABLE `xxl_job_lock` ( PRIMARY KEY (`lock_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - INSERT INTO `xxl_job_group`(`id`, `app_name`, `title`, `address_type`, `address_list`, `update_time`) VALUES (1, 'xxl-job-executor-sample', '示例执行器', 0, NULL, '2018-11-03 22:21:31' ); -INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_cron`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`) VALUES (1, 1, '0 0 0 * * ? *', '测试任务1', '2018-11-03 22:21:31', '2018-11-03 22:21:31', 'XXL', '', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2018-11-03 22:21:31', ''); +INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_cron`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`) VALUES (1, 1, '0 0 0 * * ? *', '测试任务1', '2018-11-03 22:21:31', '2018-11-03 22:21:31', 'XXL', '', 'CRON', '0 0 0 * * ? *', 'DO_NOTHING', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2018-11-03 22:21:31', ''); INSERT INTO `xxl_job_user`(`id`, `username`, `password`, `role`, `permission`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL); INSERT INTO `xxl_job_lock` ( `lock_name`) VALUES ( 'schedule_lock'); diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/scheduler/MisfireStrategyEnum.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/scheduler/MisfireStrategyEnum.java new file mode 100644 index 00000000..5e3ee0ba --- /dev/null +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/scheduler/MisfireStrategyEnum.java @@ -0,0 +1,20 @@ +package com.xxl.job.admin.core.scheduler; + +/** + * @author xuxueli 2020-10-29 21:11:23 + */ +public enum MisfireStrategyEnum { + + /** + * do nothing + */ + DO_NOTHING, + + /** + * fire once now + */ + FIRE_ONCE_NOW; + + private int value; + +} diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/scheduler/ScheduleTypeEnum.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/scheduler/ScheduleTypeEnum.java new file mode 100644 index 00000000..d0b53f78 --- /dev/null +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/scheduler/ScheduleTypeEnum.java @@ -0,0 +1,25 @@ +package com.xxl.job.admin.core.scheduler; + +/** + * @author xuxueli 2020-10-29 21:11:23 + */ +public enum ScheduleTypeEnum { + + NONE, + + /** + * schedule by cron + */ + CRON, + + /** + * schedule by fixed rate (in seconds) + */ + FIX_RATE, + + /** + * schedule by fix delay (in seconds), after the last time + */ + FIX_DELAY; + +}