From f42db2aa7551e10198f2aab55b2e9da2d76a768e Mon Sep 17 00:00:00 2001 From: Aloys Zhang Date: Tue, 12 Nov 2024 11:57:08 +0800 Subject: [PATCH] [INLONG-11483][Manager] Support multiple scedule engine --- .../manager/dao/entity/ScheduleEntity.java | 2 ++ .../mappers/ScheduleEntityMapper.xml | 26 ++++++++++-------- .../dao/mapper/ScheduleEntityTest.java | 3 +++ .../pojo/group/InlongGroupRequest.java | 5 ++++ .../manager/pojo/schedule/ScheduleInfo.java | 11 +++++--- .../pojo/schedule/ScheduleInfoRequest.java | 11 +++++--- .../schedule/ScheduleClientFactory.java | 6 +---- .../schedule/ScheduleOperatorImpl.java | 8 +++--- .../resources/h2/apache_inlong_manager.sql | 1 + .../manager-web/sql/apache_inlong_manager.sql | 1 + .../manager-web/sql/changes-2.1.0.sql | 27 +++++++++++++++++++ 11 files changed, 75 insertions(+), 26 deletions(-) create mode 100644 inlong-manager/manager-web/sql/changes-2.1.0.sql diff --git a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/ScheduleEntity.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/ScheduleEntity.java index 6d301703fcc..cf3b96ba986 100644 --- a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/ScheduleEntity.java +++ b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/ScheduleEntity.java @@ -33,6 +33,8 @@ public class ScheduleEntity implements Serializable { private String inlongGroupId; // schedule type, support [normal, crontab], 0 for normal and 1 for crontab private Integer scheduleType; + // schedule engine type, support [Quartz, Airflow, Dolphinscheduler] + private String scheduleEngine; // time unit for offline task schedule interval, support [month, week, day, hour, minute, oneround] // Y=year, M=month, W=week, D=day, H=hour, I=minute, O=oneround private String scheduleUnit; diff --git a/inlong-manager/manager-dao/src/main/resources/mappers/ScheduleEntityMapper.xml b/inlong-manager/manager-dao/src/main/resources/mappers/ScheduleEntityMapper.xml index d719aa89884..33d25ad78a5 100644 --- a/inlong-manager/manager-dao/src/main/resources/mappers/ScheduleEntityMapper.xml +++ b/inlong-manager/manager-dao/src/main/resources/mappers/ScheduleEntityMapper.xml @@ -22,6 +22,7 @@ + @@ -42,25 +43,25 @@ - id, inlong_group_id, schedule_type, schedule_unit, schedule_interval, start_time, + id, inlong_group_id, schedule_type, schedule_engine, schedule_unit, schedule_interval, start_time, end_time, delay_time, self_depend, task_parallelism, crontab_expression, status, previous_status, is_deleted, creator, modifier, create_time, modify_time, version - insert into schedule_config (id, inlong_group_id, schedule_type, schedule_unit, - schedule_interval, start_time, end_time, delay_time, - self_depend, task_parallelism, crontab_expression, + insert into schedule_config (id, inlong_group_id, schedule_type, schedule_engine, + schedule_unit, schedule_interval, start_time, end_time, + delay_time, self_depend, task_parallelism, crontab_expression, status, previous_status, creator, modifier) values (#{id, jdbcType=INTEGER}, #{inlongGroupId, jdbcType=VARCHAR}, - #{scheduleType, jdbcType=INTEGER}, #{scheduleUnit, jdbcType=VARCHAR}, - #{scheduleInterval, jdbcType=INTEGER}, #{startTime, jdbcType=TIMESTAMP}, - #{endTime, jdbcType=TIMESTAMP}, #{delayTime, jdbcType=INTEGER}, - #{selfDepend, jdbcType=INTEGER}, #{taskParallelism, jdbcType=INTEGER}, - #{crontabExpression, jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, - #{previousStatus,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR}, - #{modifier,jdbcType=VARCHAR}) + #{scheduleType, jdbcType=INTEGER}, #{scheduleEngine, jdbcType=VARCHAR}, + #{scheduleUnit, jdbcType=VARCHAR}, #{scheduleInterval, jdbcType=INTEGER}, + #{startTime, jdbcType=TIMESTAMP}, #{endTime, jdbcType=TIMESTAMP}, + #{delayTime, jdbcType=INTEGER}, #{selfDepend, jdbcType=INTEGER}, + #{taskParallelism, jdbcType=INTEGER}, #{crontabExpression, jdbcType=VARCHAR}, + #{status,jdbcType=INTEGER}, #{previousStatus,jdbcType=INTEGER}, + #{creator,jdbcType=VARCHAR}, #{modifier,jdbcType=VARCHAR})