From ffb3e15df5779cf8fbf90b4e8d90e5a9e7e21079 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Mon, 22 Jan 2024 09:55:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(executor-manager):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9service=E5=91=BD=E5=90=8D=E9=81=BF=E5=85=8D=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntroller.java => ExecutorTaskController.java} | 16 ++++++++-------- ...TaskService.java => ExecutorTaskService.java} | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) rename service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/controller/{TaskController.java => ExecutorTaskController.java} (82%) rename service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/service/{TaskService.java => ExecutorTaskService.java} (97%) diff --git a/service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/controller/TaskController.java b/service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/controller/ExecutorTaskController.java similarity index 82% rename from service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/controller/TaskController.java rename to service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/controller/ExecutorTaskController.java index 417989e..3ce8b0d 100644 --- a/service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/controller/TaskController.java +++ b/service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/controller/ExecutorTaskController.java @@ -1,7 +1,7 @@ package com.lanyuanxiaoyao.service.executor.manager.controller; import cn.hutool.core.util.StrUtil; -import com.lanyuanxiaoyao.service.executor.manager.service.TaskService; +import com.lanyuanxiaoyao.service.executor.manager.service.ExecutorTaskService; import java.io.IOException; import org.eclipse.collections.api.list.ImmutableList; import org.slf4j.Logger; @@ -17,13 +17,13 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @RequestMapping("task") -public class TaskController { - private static final Logger logger = LoggerFactory.getLogger(TaskController.class); +public class ExecutorTaskController { + private static final Logger logger = LoggerFactory.getLogger(ExecutorTaskController.class); - private final TaskService taskService; + private final ExecutorTaskService executorTaskService; - public TaskController(TaskService taskService) { - this.taskService = taskService; + public ExecutorTaskController(ExecutorTaskService executorTaskService) { + this.executorTaskService = executorTaskService; } @GetMapping("scan") @@ -48,7 +48,7 @@ public class TaskController { if ((scanLog || scanBase) && StrUtil.isBlank(hdfs)) { throw new RuntimeException("Hdfs path cannot be empty"); } - return taskService.scanAvro(key, hdfs, pulsar, pulsarTopic, scanSource, scanQueue, scanLog, scanBase, scanTarget); + return executorTaskService.scanAvro(key, hdfs, pulsar, pulsarTopic, scanSource, scanQueue, scanLog, scanBase, scanTarget); } @GetMapping("results") @@ -56,6 +56,6 @@ public class TaskController { @RequestParam("task_id") String taskId, @RequestParam(value = "limit", defaultValue = "1000") Integer limit ) throws IOException { - return taskService.taskResult(taskId, limit); + return executorTaskService.taskResult(taskId, limit); } } diff --git a/service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/service/TaskService.java b/service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/service/ExecutorTaskService.java similarity index 97% rename from service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/service/TaskService.java rename to service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/service/ExecutorTaskService.java index 659793f..4611a9f 100644 --- a/service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/service/TaskService.java +++ b/service-executor/service-executor-manager/src/main/java/com/lanyuanxiaoyao/service/executor/manager/service/ExecutorTaskService.java @@ -46,14 +46,14 @@ import static com.eshore.odcp.hudi.connector.Constants.MINUTE; * @date 2024-01-10 */ @Service -public class TaskService { - private static final Logger logger = LoggerFactory.getLogger(TaskService.class); +public class ExecutorTaskService { + private static final Logger logger = LoggerFactory.getLogger(ExecutorTaskService.class); private final HadoopConfiguration hadoopConfiguration; private final ExecutorConfiguration executorConfiguration; private final ObjectMapper mapper; - public TaskService(HadoopConfiguration hadoopConfiguration, ExecutorConfiguration executorConfiguration, Jackson2ObjectMapperBuilder builder) { + public ExecutorTaskService(HadoopConfiguration hadoopConfiguration, ExecutorConfiguration executorConfiguration, Jackson2ObjectMapperBuilder builder) { this.hadoopConfiguration = hadoopConfiguration; this.executorConfiguration = executorConfiguration; this.mapper = builder.build();