feat(executor-manager): 增加表数据查询10条采样任务

This commit is contained in:
v-zhangjc9
2024-06-03 16:17:41 +08:00
parent 8aba2475be
commit 6f2fce4359
6 changed files with 121 additions and 4 deletions

View File

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

View File

@@ -95,11 +95,11 @@ function taskTab() {
},
{
type: 'form',
title: '综合查询 (总数、最后操作时间)',
title: '综合查询',
actions: [
{
type: 'submit',
label: '提交任务',
type: 'action',
label: '总数&最后操作时间',
actionType: 'ajax',
api: {
method: 'get',
@@ -109,6 +109,18 @@ function taskTab() {
}
}
},
{
type: 'action',
label: '最后10条记录',
actionType: 'ajax',
api: {
method: 'get',
url: '${base}/task/table_sampling',
data: {
hdfs: '${hdfs|default:undefined}',
}
}
},
],
body: [
{