feat(web): 增加一个停止全部压缩任务的小工具

This commit is contained in:
2024-01-29 15:47:25 +08:00
parent c6c4021930
commit 4b2585984c
4 changed files with 62 additions and 0 deletions

View File

@@ -35,4 +35,7 @@ public interface ScheduleService {
@Get("/table")
void scheduleTableRecommend(@Query("flink_job_id") Long flinkJobId, @Query("alias") String alias, @Query("recommend") String recommendCluster);
@Get("/stop_all")
void stopAll(@Query("flink_job_id") Long flinkJobId, @Query("alias") String alias, @Query("disable_meta") Boolean disableMeta);
}

View File

@@ -68,4 +68,15 @@ public class ScheduleController extends BaseController {
}
return AmisResponse.responseSuccess();
}
@GetMapping("stop_all")
public AmisResponse<Object> stopAll(
@RequestParam("flink_job_id") Long flinkJobId,
@RequestParam("alias") String alias,
@RequestParam(value = "disable_meta", required = false) Boolean disableMeta
) throws TableNotFoundException {
checkTableExists(infoService, flinkJobId, alias);
scheduleService.stopAll(flinkJobId, alias, disableMeta);
return AmisResponse.responseSuccess();
}
}

View File

@@ -66,6 +66,18 @@ public class TaskController {
return AmisResponse.responseSuccess();
}
@GetMapping("latest_op_ts")
public AmisResponse<Object> latestOpTs(@RequestParam("hdfs") String hdfs) {
if (StrUtil.isBlank(hdfs)) {
throw new RuntimeException("Hdfs cannot be blank");
}
ExecutorProvider.EXECUTORS.submit(() -> {
String applicationId = taskService.latestOpTs(hdfs);
logger.info("Task: {}", applicationId);
});
return AmisResponse.responseSuccess();
}
@GetMapping("results")
public AmisMapResponse results(@RequestParam("task_id") String taskId) {
return AmisResponse.responseMapData()

View File

@@ -215,6 +215,42 @@ function toolTab() {
}
]
},
{
type: 'form',
title: '停止所有压缩任务',
api: {
method: 'get',
url: '${base}/schedule/stop_all',
data: {
flink_job_id: '${flinkJobId|default:undefined}',
alias: '${alias|default:undefined}',
disable_meta: "${disableMeta|default:undefined}",
}
},
...formReloadFlinkJobIdTextInputAndAliasTextInput("163e043e-8cee-41fd-b5a4-0442ac682aec"),
body: [
{
type: 'group',
body: [
{
...flinkJobIdTextInput("163e043e-8cee-41fd-b5a4-0442ac682aec", true),
columnRatio: 5
},
{
...aliasTextInput("163e043e-8cee-41fd-b5a4-0442ac682aec", true),
columnRatio: 5
},
{
name: 'disableMeta',
type: 'checkbox',
label: '是否禁用表',
option: '表status设为n',
columnRatio: 2
}
]
},
]
},
]
}
}