Skip to content

Commit

Permalink
[Refactor][Admin] Change dependency implementation to dependency inte…
Browse files Browse the repository at this point in the history
…rface (#3105)

Co-authored-by: 00225658 <[email protected]>
  • Loading branch information
18216499322 and 00225658 authored Jan 31, 2024
1 parent e5f21db commit 8bc6356
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions dinky-admin/src/main/java/org/dinky/service/TaskService.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.dinky.explainer.lineage.LineageResult;
import org.dinky.gateway.enums.SavePointType;
import org.dinky.gateway.result.SavePointResult;
import org.dinky.job.JobConfig;
import org.dinky.job.JobResult;
import org.dinky.mybatis.service.ISuperService;

Expand Down Expand Up @@ -281,4 +282,11 @@ public interface TaskService extends ISuperService<Task> {
* @return A {@link LineageResult} object representing the found task lineage.
*/
LineageResult getTaskLineage(Integer id);

/**
* Build the job submit config with the given task
* @param task
* @return
*/
JobConfig buildJobSubmitConfig(TaskDTO task);
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public JobResult executeJob(TaskDTO task, Boolean stream) throws Exception {
return jobResult;
}

// Submit and export task
@Override
@ProcessStep(type = ProcessStepType.SUBMIT_BUILD_CONFIG)
public JobConfig buildJobSubmitConfig(TaskDTO task) {
if (Asserts.isNull(task.getType())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.dinky.gateway.enums.GatewayType;
import org.dinky.job.JobManager;
import org.dinky.job.JobResult;
import org.dinky.service.TaskService;
import org.dinky.service.impl.TaskServiceImpl;

import java.util.List;
Expand Down Expand Up @@ -69,7 +70,7 @@ public boolean stop() {
}

protected JobManager getJobManager() {
TaskServiceImpl taskService = SpringUtil.getBean(TaskServiceImpl.class);
TaskService taskService = SpringUtil.getBean(TaskServiceImpl.class);
return JobManager.build(taskService.buildJobSubmitConfig(task));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.dinky.gateway.enums.GatewayType;
import org.dinky.job.JobManager;
import org.dinky.job.JobResult;
import org.dinky.service.TaskService;
import org.dinky.service.impl.TaskServiceImpl;
import org.dinky.utils.JsonUtils;

Expand Down Expand Up @@ -68,7 +69,7 @@ public JobResult execute() throws Exception {
}

protected JobManager getJobManager() {
TaskServiceImpl taskService = SpringUtil.getBean(TaskServiceImpl.class);
TaskService taskService = SpringUtil.getBean(TaskServiceImpl.class);
return JobManager.build(taskService.buildJobSubmitConfig(task));
}

Expand Down

0 comments on commit 8bc6356

Please sign in to comment.