refactor(executor-manager): 修改service命名避免冲突

This commit is contained in:
2024-01-22 09:55:37 +08:00
parent ff72583d5d
commit ffb3e15df5
2 changed files with 11 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
package com.lanyuanxiaoyao.service.executor.manager.controller; package com.lanyuanxiaoyao.service.executor.manager.controller;
import cn.hutool.core.util.StrUtil; 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 java.io.IOException;
import org.eclipse.collections.api.list.ImmutableList; import org.eclipse.collections.api.list.ImmutableList;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -17,13 +17,13 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("task") @RequestMapping("task")
public class TaskController { public class ExecutorTaskController {
private static final Logger logger = LoggerFactory.getLogger(TaskController.class); private static final Logger logger = LoggerFactory.getLogger(ExecutorTaskController.class);
private final TaskService taskService; private final ExecutorTaskService executorTaskService;
public TaskController(TaskService taskService) { public ExecutorTaskController(ExecutorTaskService executorTaskService) {
this.taskService = taskService; this.executorTaskService = executorTaskService;
} }
@GetMapping("scan") @GetMapping("scan")
@@ -48,7 +48,7 @@ public class TaskController {
if ((scanLog || scanBase) && StrUtil.isBlank(hdfs)) { if ((scanLog || scanBase) && StrUtil.isBlank(hdfs)) {
throw new RuntimeException("Hdfs path cannot be empty"); 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") @GetMapping("results")
@@ -56,6 +56,6 @@ public class TaskController {
@RequestParam("task_id") String taskId, @RequestParam("task_id") String taskId,
@RequestParam(value = "limit", defaultValue = "1000") Integer limit @RequestParam(value = "limit", defaultValue = "1000") Integer limit
) throws IOException { ) throws IOException {
return taskService.taskResult(taskId, limit); return executorTaskService.taskResult(taskId, limit);
} }
} }

View File

@@ -46,14 +46,14 @@ import static com.eshore.odcp.hudi.connector.Constants.MINUTE;
* @date 2024-01-10 * @date 2024-01-10
*/ */
@Service @Service
public class TaskService { public class ExecutorTaskService {
private static final Logger logger = LoggerFactory.getLogger(TaskService.class); private static final Logger logger = LoggerFactory.getLogger(ExecutorTaskService.class);
private final HadoopConfiguration hadoopConfiguration; private final HadoopConfiguration hadoopConfiguration;
private final ExecutorConfiguration executorConfiguration; private final ExecutorConfiguration executorConfiguration;
private final ObjectMapper mapper; private final ObjectMapper mapper;
public TaskService(HadoopConfiguration hadoopConfiguration, ExecutorConfiguration executorConfiguration, Jackson2ObjectMapperBuilder builder) { public ExecutorTaskService(HadoopConfiguration hadoopConfiguration, ExecutorConfiguration executorConfiguration, Jackson2ObjectMapperBuilder builder) {
this.hadoopConfiguration = hadoopConfiguration; this.hadoopConfiguration = hadoopConfiguration;
this.executorConfiguration = executorConfiguration; this.executorConfiguration = executorConfiguration;
this.mapper = builder.build(); this.mapper = builder.build();