diff --git a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/annotation/CompatibleImplementation.java b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/annotation/CompatibleImplementation.java index 9a16bcbf1d..3ab9a5a575 100644 --- a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/annotation/CompatibleImplementation.java +++ b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/annotation/CompatibleImplementation.java @@ -41,7 +41,7 @@ import static java.lang.annotation.ElementType.TYPE; /** - * 兼容历史版本的实现 + * 用来标识兼容历史版本的实现 */ @Documented @Retention(RetentionPolicy.RUNTIME) diff --git a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/annotation/PersistenceObject.java b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/annotation/PersistenceObject.java index 14cd6fec0f..2b5cc59e9a 100644 --- a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/annotation/PersistenceObject.java +++ b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/annotation/PersistenceObject.java @@ -33,7 +33,7 @@ import java.lang.annotation.Target; /** - * 用于表示某个持久对象,该对象会被持久化到DB中,所以对于该对象的改动需要谨慎,避免破坏性的修改(比如修改字段名) + * 用于标识持久化的对象。该对象会被持久化到DB中,所以对于该对象的改动需要谨慎,避免破坏性的修改(比如修改字段名) */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) diff --git a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/JobExecuteArchiveManage.java b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/JobExecuteArchiveManage.java index 25a7b36751..3b81e60799 100644 --- a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/JobExecuteArchiveManage.java +++ b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/JobExecuteArchiveManage.java @@ -26,10 +26,10 @@ import com.tencent.bk.job.backup.archive.impl.FileSourceTaskLogArchivist; import com.tencent.bk.job.backup.archive.impl.GseFileAgentTaskArchivist; +import com.tencent.bk.job.backup.archive.impl.GseFileExecuteObjTaskArchivist; import com.tencent.bk.job.backup.archive.impl.GseScriptAgentTaskArchivist; +import com.tencent.bk.job.backup.archive.impl.GseScriptExecuteObjTaskArchivist; import com.tencent.bk.job.backup.archive.impl.GseTaskArchivist; -import com.tencent.bk.job.backup.archive.impl.GseTaskIpLogArchivist; -import com.tencent.bk.job.backup.archive.impl.GseTaskLogArchivist; import com.tencent.bk.job.backup.archive.impl.OperationLogArchivist; import com.tencent.bk.job.backup.archive.impl.RollingConfigArchivist; import com.tencent.bk.job.backup.archive.impl.StepInstanceArchivist; @@ -46,9 +46,9 @@ import com.tencent.bk.job.backup.dao.ExecuteRecordDAO; import com.tencent.bk.job.backup.dao.impl.FileSourceTaskLogRecordDAO; import com.tencent.bk.job.backup.dao.impl.GseFileAgentTaskRecordDAO; +import com.tencent.bk.job.backup.dao.impl.GseFileExecuteObjTaskRecordDAO; import com.tencent.bk.job.backup.dao.impl.GseScriptAgentTaskRecordDAO; -import com.tencent.bk.job.backup.dao.impl.GseTaskIpLogRecordDAO; -import com.tencent.bk.job.backup.dao.impl.GseTaskLogRecordDAO; +import com.tencent.bk.job.backup.dao.impl.GseScriptExecuteObjTaskRecordDAO; import com.tencent.bk.job.backup.dao.impl.GseTaskRecordDAO; import com.tencent.bk.job.backup.dao.impl.OperationLogRecordDAO; import com.tencent.bk.job.backup.dao.impl.RollingConfigRecordDAO; @@ -87,11 +87,11 @@ public class JobExecuteArchiveManage implements SmartLifecycle { private final TaskInstanceVariableRecordDAO taskInstanceVariableRecordDAO; private final OperationLogRecordDAO operationLogRecordDAO; private final FileSourceTaskLogRecordDAO fileSourceTaskLogRecordDAO; - private final GseTaskLogRecordDAO gseTaskLogRecordDAO; - private final GseTaskIpLogRecordDAO gseTaskIpLogRecordDAO; private final GseTaskRecordDAO gseTaskRecordDAO; private final GseScriptAgentTaskRecordDAO gseScriptAgentTaskRecordDAO; private final GseFileAgentTaskRecordDAO gseFileAgentTaskRecordDAO; + private final GseScriptExecuteObjTaskRecordDAO gseScriptExecuteObjTaskRecordDAO; + private final GseFileExecuteObjTaskRecordDAO gseFileExecuteObjTaskRecordDAO; private final StepInstanceRollingTaskRecordDAO stepInstanceRollingTaskRecordDAO; private final RollingConfigRecordDAO rollingConfigRecordDAO; private final TaskInstanceHostRecordDAO taskInstanceHostRecordDAO; @@ -112,11 +112,11 @@ public JobExecuteArchiveManage(TaskInstanceRecordDAO taskInstanceRecordDAO, TaskInstanceVariableRecordDAO taskInstanceVariableRecordDAO, OperationLogRecordDAO operationLogRecordDAO, FileSourceTaskLogRecordDAO fileSourceTaskLogRecordDAO, - GseTaskLogRecordDAO gseTaskLogRecordDAO, - GseTaskIpLogRecordDAO gseTaskIpLogRecordDAO, GseTaskRecordDAO gseTaskRecordDAO, GseScriptAgentTaskRecordDAO gseScriptAgentTaskRecordDAO, GseFileAgentTaskRecordDAO gseFileAgentTaskRecordDAO, + GseScriptExecuteObjTaskRecordDAO gseScriptExecuteObjTaskRecordDAO, + GseFileExecuteObjTaskRecordDAO gseFileExecuteObjTaskRecordDAO, StepInstanceRollingTaskRecordDAO stepInstanceRollingTaskRecordDAO, RollingConfigRecordDAO rollingConfigRecordDAO, TaskInstanceHostRecordDAO taskInstanceHostRecordDAO, @@ -124,6 +124,8 @@ public JobExecuteArchiveManage(TaskInstanceRecordDAO taskInstanceRecordDAO, ArchiveProgressService archiveProgressService, ArchiveDBProperties archiveDBProperties, ExecutorService archiveExecutor) { + this.gseScriptExecuteObjTaskRecordDAO = gseScriptExecuteObjTaskRecordDAO; + this.gseFileExecuteObjTaskRecordDAO = gseFileExecuteObjTaskRecordDAO; log.info("Init JobExecuteArchiveManage! archiveConfig: {}", archiveDBProperties); this.archiveDBProperties = archiveDBProperties; this.archiveProgressService = archiveProgressService; @@ -137,8 +139,6 @@ public JobExecuteArchiveManage(TaskInstanceRecordDAO taskInstanceRecordDAO, this.taskInstanceVariableRecordDAO = taskInstanceVariableRecordDAO; this.operationLogRecordDAO = operationLogRecordDAO; this.fileSourceTaskLogRecordDAO = fileSourceTaskLogRecordDAO; - this.gseTaskLogRecordDAO = gseTaskLogRecordDAO; - this.gseTaskIpLogRecordDAO = gseTaskIpLogRecordDAO; this.gseTaskRecordDAO = gseTaskRecordDAO; this.gseScriptAgentTaskRecordDAO = gseScriptAgentTaskRecordDAO; this.gseFileAgentTaskRecordDAO = gseFileAgentTaskRecordDAO; @@ -277,10 +277,6 @@ private void archive(long maxNeedArchiveTaskInstanceId, long maxNeedArchiveStepI addStepInstanceScriptArchiveTask(maxNeedArchiveStepInstanceId, countDownLatch); // file_source_task_log addFileSourceTaskLogArchiveTask(maxNeedArchiveStepInstanceId, countDownLatch); - // gse_task_log - addGseTaskLogArchiveTask(maxNeedArchiveStepInstanceId, countDownLatch); - // gse_task_ip_log - addGseTaskIpLogArchiveTask(maxNeedArchiveStepInstanceId, countDownLatch); // task_instance_variable addTaskInstanceVariableArchiveTask(maxNeedArchiveTaskInstanceId, countDownLatch); // step_instance_variable @@ -299,6 +295,10 @@ private void archive(long maxNeedArchiveTaskInstanceId, long maxNeedArchiveStepI addRollingConfigArchiveTask(maxNeedArchiveTaskInstanceId, countDownLatch); // task_instance_host addTaskInstanceHostArchiveTask(maxNeedArchiveTaskInstanceId, countDownLatch); + // gse_script_execute_obj_task + addGseScriptExecuteObjTaskArchiveTask(maxNeedArchiveTaskInstanceId, countDownLatch); + // gse_file_execute_obj_task + addGseFileExecuteObjTaskArchiveTask(maxNeedArchiveTaskInstanceId, countDownLatch); log.info("Archive task submitted. Waiting for complete..."); countDownLatch.await(); @@ -379,30 +379,6 @@ private void addFileSourceTaskLogArchiveTask(Long maxNeedArchiveStepInstanceId, .archive()); } - private void addGseTaskLogArchiveTask(Long maxNeedArchiveStepInstanceId, CountDownLatch countDownLatch) { - archiveExecutor.execute(() -> - new GseTaskLogArchivist( - gseTaskLogRecordDAO, - executeArchiveDAO, - archiveProgressService, - archiveDBProperties, - maxNeedArchiveStepInstanceId, - countDownLatch) - .archive()); - } - - private void addGseTaskIpLogArchiveTask(Long maxNeedArchiveStepInstanceId, CountDownLatch countDownLatch) { - archiveExecutor.execute(() -> - new GseTaskIpLogArchivist( - gseTaskIpLogRecordDAO, - executeArchiveDAO, - archiveProgressService, - archiveDBProperties, - maxNeedArchiveStepInstanceId, - countDownLatch) - .archive()); - } - private void addTaskInstanceVariableArchiveTask(Long maxNeedArchiveTaskInstanceId, CountDownLatch countDownLatch) { archiveExecutor.execute(() -> new TaskInstanceVariableArchivist( @@ -475,6 +451,32 @@ private void addGseFileAgentTaskArchiveTask(Long maxNeedArchiveStepInstanceId, C .archive()); } + private void addGseScriptExecuteObjTaskArchiveTask(Long maxNeedArchiveTaskInstanceId, + CountDownLatch countDownLatch) { + archiveExecutor.execute(() -> + new GseScriptExecuteObjTaskArchivist( + gseScriptExecuteObjTaskRecordDAO, + executeArchiveDAO, + archiveProgressService, + archiveDBProperties, + maxNeedArchiveTaskInstanceId, + countDownLatch) + .archive()); + } + + private void addGseFileExecuteObjTaskArchiveTask(Long maxNeedArchiveTaskInstanceId, + CountDownLatch countDownLatch) { + archiveExecutor.execute(() -> + new GseFileExecuteObjTaskArchivist( + gseFileExecuteObjTaskRecordDAO, + executeArchiveDAO, + archiveProgressService, + archiveDBProperties, + maxNeedArchiveTaskInstanceId, + countDownLatch) + .archive()); + } + private void addStepInstanceRollingTaskArchiveTask(Long maxNeedArchiveStepInstanceId, CountDownLatch countDownLatch) { archiveExecutor.execute(() -> diff --git a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseTaskIpLogArchivist.java b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseFileExecuteObjTaskArchivist.java similarity index 72% rename from src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseTaskIpLogArchivist.java rename to src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseFileExecuteObjTaskArchivist.java index 6c7faf48e3..a64a1d4774 100644 --- a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseTaskIpLogArchivist.java +++ b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseFileExecuteObjTaskArchivist.java @@ -27,23 +27,23 @@ import com.tencent.bk.job.backup.archive.AbstractArchivist; import com.tencent.bk.job.backup.config.ArchiveDBProperties; import com.tencent.bk.job.backup.dao.ExecuteArchiveDAO; -import com.tencent.bk.job.backup.dao.impl.GseTaskIpLogRecordDAO; +import com.tencent.bk.job.backup.dao.impl.GseFileExecuteObjTaskRecordDAO; import com.tencent.bk.job.backup.service.ArchiveProgressService; -import com.tencent.bk.job.execute.model.tables.records.GseTaskIpLogRecord; +import com.tencent.bk.job.execute.model.tables.records.GseFileExecuteObjTaskRecord; import java.util.concurrent.CountDownLatch; /** - * gse_task_ip_log 表归档 + * gse_file_execute_obj_task 表归档 */ -public class GseTaskIpLogArchivist extends AbstractArchivist { +public class GseFileExecuteObjTaskArchivist extends AbstractArchivist { - public GseTaskIpLogArchivist(GseTaskIpLogRecordDAO executeRecordDAO, - ExecuteArchiveDAO executeArchiveDAO, - ArchiveProgressService archiveProgressService, - ArchiveDBProperties archiveDBProperties, - Long maxNeedArchiveId, - CountDownLatch countDownLatch) { + public GseFileExecuteObjTaskArchivist(GseFileExecuteObjTaskRecordDAO executeRecordDAO, + ExecuteArchiveDAO executeArchiveDAO, + ArchiveProgressService archiveProgressService, + ArchiveDBProperties archiveDBProperties, + Long maxNeedArchiveId, + CountDownLatch countDownLatch) { super(executeRecordDAO, executeArchiveDAO, archiveProgressService, diff --git a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseTaskLogArchivist.java b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseScriptExecuteObjTaskArchivist.java similarity index 70% rename from src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseTaskLogArchivist.java rename to src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseScriptExecuteObjTaskArchivist.java index 88b7691098..b18d14fc06 100644 --- a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseTaskLogArchivist.java +++ b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/archive/impl/GseScriptExecuteObjTaskArchivist.java @@ -27,29 +27,29 @@ import com.tencent.bk.job.backup.archive.AbstractArchivist; import com.tencent.bk.job.backup.config.ArchiveDBProperties; import com.tencent.bk.job.backup.dao.ExecuteArchiveDAO; -import com.tencent.bk.job.backup.dao.impl.GseTaskLogRecordDAO; +import com.tencent.bk.job.backup.dao.impl.GseScriptExecuteObjTaskRecordDAO; import com.tencent.bk.job.backup.service.ArchiveProgressService; -import com.tencent.bk.job.execute.model.tables.records.GseTaskLogRecord; +import com.tencent.bk.job.execute.model.tables.records.GseScriptExecuteObjTaskRecord; import java.util.concurrent.CountDownLatch; /** - * gse_task_log 表归档 + * gse_script_execute_obj_task 表归档 */ -public class GseTaskLogArchivist extends AbstractArchivist { +public class GseScriptExecuteObjTaskArchivist extends AbstractArchivist { - public GseTaskLogArchivist(GseTaskLogRecordDAO executeRecordDAO, - ExecuteArchiveDAO executeArchiveDAO, - ArchiveProgressService archiveProgressService, - ArchiveDBProperties archiveDBProperties, - Long maxNeedArchiveId, - CountDownLatch countDownLatch) { + public GseScriptExecuteObjTaskArchivist(GseScriptExecuteObjTaskRecordDAO executeRecordDAO, + ExecuteArchiveDAO executeArchiveDAO, + ArchiveProgressService archiveProgressService, + ArchiveDBProperties archiveDBProperties, + Long maxNeedArchiveId, + CountDownLatch countDownLatch) { super(executeRecordDAO, executeArchiveDAO, archiveProgressService, archiveDBProperties, maxNeedArchiveId, countDownLatch); - this.deleteIdStepSize = 10_000; + this.deleteIdStepSize = 1_000; } } diff --git a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/config/ArchiveConfiguration.java b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/config/ArchiveConfiguration.java index 29e218348b..54fb370ac8 100644 --- a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/config/ArchiveConfiguration.java +++ b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/config/ArchiveConfiguration.java @@ -30,9 +30,9 @@ import com.tencent.bk.job.backup.dao.impl.ExecuteArchiveDAOImpl; import com.tencent.bk.job.backup.dao.impl.FileSourceTaskLogRecordDAO; import com.tencent.bk.job.backup.dao.impl.GseFileAgentTaskRecordDAO; +import com.tencent.bk.job.backup.dao.impl.GseFileExecuteObjTaskRecordDAO; import com.tencent.bk.job.backup.dao.impl.GseScriptAgentTaskRecordDAO; -import com.tencent.bk.job.backup.dao.impl.GseTaskIpLogRecordDAO; -import com.tencent.bk.job.backup.dao.impl.GseTaskLogRecordDAO; +import com.tencent.bk.job.backup.dao.impl.GseScriptExecuteObjTaskRecordDAO; import com.tencent.bk.job.backup.dao.impl.GseTaskRecordDAO; import com.tencent.bk.job.backup.dao.impl.OperationLogRecordDAO; import com.tencent.bk.job.backup.dao.impl.RollingConfigRecordDAO; @@ -139,22 +139,6 @@ public OperationLogRecordDAO operationLogRecordDAO( return new OperationLogRecordDAO(context, archiveDBProperties); } - @Bean(name = "gseTaskLogRecordDAO") - public GseTaskLogRecordDAO gseTaskLogRecordDAO( - @Qualifier("job-execute-dsl-context") DSLContext context, - ArchiveDBProperties archiveDBProperties) { - log.info("Init GseTaskLogRecordDAO"); - return new GseTaskLogRecordDAO(context, archiveDBProperties); - } - - @Bean(name = "gseTaskIpLogRecordDAO") - public GseTaskIpLogRecordDAO gseTaskIpLogRecordDAO( - @Qualifier("job-execute-dsl-context") DSLContext context, - ArchiveDBProperties archiveDBProperties) { - log.info("Init GseTaskIpLogRecordDAO"); - return new GseTaskIpLogRecordDAO(context, archiveDBProperties); - } - @Bean(name = "fileSourceTaskLogRecordDAO") public FileSourceTaskLogRecordDAO fileSourceTaskLogRecordDAO( @Qualifier("job-execute-dsl-context") DSLContext context, @@ -187,6 +171,22 @@ public GseFileAgentTaskRecordDAO gseFileAgentTaskRecordDAO( return new GseFileAgentTaskRecordDAO(context, archiveDBProperties); } + @Bean(name = "gseScriptExecuteObjTaskRecordDAO") + public GseScriptExecuteObjTaskRecordDAO gseScriptExecuteObjTaskRecordDAO( + @Qualifier("job-execute-dsl-context") DSLContext context, + ArchiveDBProperties archiveDBProperties) { + log.info("Init GseScriptExecuteObjTaskRecordDAO"); + return new GseScriptExecuteObjTaskRecordDAO(context, archiveDBProperties); + } + + @Bean(name = "gseFileExecuteObjTaskRecordDAO") + public GseFileExecuteObjTaskRecordDAO gseFileExecuteObjTaskRecordDAO( + @Qualifier("job-execute-dsl-context") DSLContext context, + ArchiveDBProperties archiveDBProperties) { + log.info("Init GseFileExecuteObjTaskRecordDAO"); + return new GseFileExecuteObjTaskRecordDAO(context, archiveDBProperties); + } + @Bean(name = "stepInstanceRollingTaskRecordDAO") public StepInstanceRollingTaskRecordDAO stepInstanceRollingTaskRecordDAO( @Qualifier("job-execute-dsl-context") DSLContext context, @@ -240,11 +240,11 @@ public JobExecuteArchiveManage jobExecuteArchiveManage( ObjectProvider taskInstanceVariableRecordDAOObjectProvider, ObjectProvider operationLogRecordDAOObjectProvider, ObjectProvider fileSourceTaskLogRecordDAOObjectProvider, - ObjectProvider gseTaskLogRecordDAOObjectProvider, - ObjectProvider gseTaskIpLogRecordDAOObjectProvider, ObjectProvider gseTaskRecordDAOObjectProvider, ObjectProvider gseScriptAgentTaskRecordDAOObjectProvider, ObjectProvider gseFileAgentTaskRecordDAOObjectProvider, + ObjectProvider gseScriptExecuteObjTaskRecordDAOObjectProvider, + ObjectProvider gseFileExecuteObjTaskRecordDAOObjectProvider, ObjectProvider stepInstanceRollingTaskRecordDAOObjectProvider, ObjectProvider rollingConfigRecordDAOObjectProvider, ObjectProvider taskInstanceHostRecordDAOObjectProvider, @@ -264,11 +264,11 @@ public JobExecuteArchiveManage jobExecuteArchiveManage( taskInstanceVariableRecordDAOObjectProvider.getIfAvailable(), operationLogRecordDAOObjectProvider.getIfAvailable(), fileSourceTaskLogRecordDAOObjectProvider.getIfAvailable(), - gseTaskLogRecordDAOObjectProvider.getIfAvailable(), - gseTaskIpLogRecordDAOObjectProvider.getIfAvailable(), gseTaskRecordDAOObjectProvider.getIfAvailable(), gseScriptAgentTaskRecordDAOObjectProvider.getIfAvailable(), gseFileAgentTaskRecordDAOObjectProvider.getIfAvailable(), + gseScriptExecuteObjTaskRecordDAOObjectProvider.getIfAvailable(), + gseFileExecuteObjTaskRecordDAOObjectProvider.getIfAvailable(), stepInstanceRollingTaskRecordDAOObjectProvider.getIfAvailable(), rollingConfigRecordDAOObjectProvider.getIfAvailable(), taskInstanceHostRecordDAOObjectProvider.getIfAvailable(), diff --git a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseFileExecuteObjTaskRecordDAO.java b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseFileExecuteObjTaskRecordDAO.java new file mode 100644 index 0000000000..6462f458f8 --- /dev/null +++ b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseFileExecuteObjTaskRecordDAO.java @@ -0,0 +1,30 @@ +package com.tencent.bk.job.backup.dao.impl; + +import com.tencent.bk.job.backup.config.ArchiveDBProperties; +import com.tencent.bk.job.execute.model.tables.GseFileExecuteObjTask; +import com.tencent.bk.job.execute.model.tables.records.GseFileExecuteObjTaskRecord; +import org.jooq.DSLContext; +import org.jooq.Table; +import org.jooq.TableField; + +/** + * gse_file_execute_obj_task DAO + */ +public class GseFileExecuteObjTaskRecordDAO extends AbstractExecuteRecordDAO { + + private static final GseFileExecuteObjTask TABLE = GseFileExecuteObjTask.GSE_FILE_EXECUTE_OBJ_TASK; + + public GseFileExecuteObjTaskRecordDAO(DSLContext context, ArchiveDBProperties archiveDBProperties) { + super(context, archiveDBProperties); + } + + @Override + public Table getTable() { + return TABLE; + } + + @Override + public TableField getArchiveIdField() { + return TABLE.TASK_INSTANCE_ID; + } +} diff --git a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseScriptExecuteObjTaskRecordDAO.java b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseScriptExecuteObjTaskRecordDAO.java new file mode 100644 index 0000000000..cec2793589 --- /dev/null +++ b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseScriptExecuteObjTaskRecordDAO.java @@ -0,0 +1,30 @@ +package com.tencent.bk.job.backup.dao.impl; + +import com.tencent.bk.job.backup.config.ArchiveDBProperties; +import com.tencent.bk.job.execute.model.tables.GseScriptExecuteObjTask; +import com.tencent.bk.job.execute.model.tables.records.GseScriptExecuteObjTaskRecord; +import org.jooq.DSLContext; +import org.jooq.Table; +import org.jooq.TableField; + +/** + * gse_script_execute_obj_task DAO + */ +public class GseScriptExecuteObjTaskRecordDAO extends AbstractExecuteRecordDAO { + + private static final GseScriptExecuteObjTask TABLE = GseScriptExecuteObjTask.GSE_SCRIPT_EXECUTE_OBJ_TASK; + + public GseScriptExecuteObjTaskRecordDAO(DSLContext context, ArchiveDBProperties archiveDBProperties) { + super(context, archiveDBProperties); + } + + @Override + public Table getTable() { + return TABLE; + } + + @Override + public TableField getArchiveIdField() { + return TABLE.TASK_INSTANCE_ID; + } +} diff --git a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseTaskIpLogRecordDAO.java b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseTaskIpLogRecordDAO.java deleted file mode 100644 index fe59b64105..0000000000 --- a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseTaskIpLogRecordDAO.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.tencent.bk.job.backup.dao.impl; - -import com.tencent.bk.job.backup.config.ArchiveDBProperties; -import com.tencent.bk.job.execute.model.tables.GseTaskIpLog; -import com.tencent.bk.job.execute.model.tables.records.GseTaskIpLogRecord; -import org.jooq.DSLContext; -import org.jooq.Table; -import org.jooq.TableField; - -/** - * gse_task_ip_log DAO - */ -public class GseTaskIpLogRecordDAO extends AbstractExecuteRecordDAO { - - private static final GseTaskIpLog TABLE = GseTaskIpLog.GSE_TASK_IP_LOG; - - public GseTaskIpLogRecordDAO(DSLContext context, ArchiveDBProperties archiveDBProperties) { - super(context, archiveDBProperties); - } - - @Override - public Table getTable() { - return TABLE; - } - - @Override - public TableField getArchiveIdField() { - return TABLE.STEP_INSTANCE_ID; - } -} diff --git a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseTaskLogRecordDAO.java b/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseTaskLogRecordDAO.java deleted file mode 100644 index 40202a81a3..0000000000 --- a/src/backend/job-backup/service-job-backup/src/main/java/com/tencent/bk/job/backup/dao/impl/GseTaskLogRecordDAO.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.tencent.bk.job.backup.dao.impl; - -import com.tencent.bk.job.backup.config.ArchiveDBProperties; -import com.tencent.bk.job.execute.model.tables.GseTaskLog; -import com.tencent.bk.job.execute.model.tables.records.GseTaskLogRecord; -import org.jooq.DSLContext; -import org.jooq.Table; -import org.jooq.TableField; - -/** - * gse_task_log DAO - */ -public class GseTaskLogRecordDAO extends AbstractExecuteRecordDAO { - - private static final GseTaskLog TABLE = GseTaskLog.GSE_TASK_LOG; - - public GseTaskLogRecordDAO(DSLContext context, ArchiveDBProperties archiveDBProperties) { - super(context, archiveDBProperties); - } - - @Override - public Table getTable() { - return TABLE; - } - - @Override - public TableField getArchiveIdField() { - return TABLE.STEP_INSTANCE_ID; - } -} diff --git a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/model/StepExecutionResultQuery.java b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/model/StepExecutionResultQuery.java index dfc613c933..75814ea195 100644 --- a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/model/StepExecutionResultQuery.java +++ b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/model/StepExecutionResultQuery.java @@ -25,7 +25,6 @@ package com.tencent.bk.job.execute.model; import com.tencent.bk.job.common.constant.Order; -import com.tencent.bk.job.execute.model.tables.GseTaskIpLog; import lombok.Builder; import lombok.Getter; import lombok.Setter; @@ -42,15 +41,12 @@ @Builder public class StepExecutionResultQuery { public static final String ORDER_FIELD_TOTAL_TIME = "totalTime"; - public static final String ORDER_FIELD_CLOUD_AREA_ID = "cloudAreaId"; public static final String ORDER_FIELD_EXIT_CODE = "exitCode"; private static final Map ORDER_FIELD_IN_DB = new HashMap<>(); static { - ORDER_FIELD_IN_DB.put(ORDER_FIELD_TOTAL_TIME, GseTaskIpLog.GSE_TASK_IP_LOG.TOTAL_TIME.getName()); - ORDER_FIELD_IN_DB.put(ORDER_FIELD_EXIT_CODE, GseTaskIpLog.GSE_TASK_IP_LOG.EXIT_CODE.getName()); - // 表中不包含cloud_area_id字段,可以使用IP达到相同的目的 - ORDER_FIELD_IN_DB.put(ORDER_FIELD_CLOUD_AREA_ID, GseTaskIpLog.GSE_TASK_IP_LOG.IP.getName()); + ORDER_FIELD_IN_DB.put(ORDER_FIELD_TOTAL_TIME, "total_time"); + ORDER_FIELD_IN_DB.put(ORDER_FIELD_EXIT_CODE, "exit_code"); } /**