feat(executor-manager): 增加表数据查询10条采样任务
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user