feature(web): 增加时间线 Rollback 和 Clean 的查询
This commit is contained in:
@@ -3,8 +3,10 @@ package com.lanyuanxiaoyao.service.web.controller;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.PageResponse;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.hudi.HudiCleanerPlan;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.hudi.HudiCompactionPlan;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.hudi.HudiInstant;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.hudi.HudiRollbackPlan;
|
||||
import com.lanyuanxiaoyao.service.forest.service.HudiService;
|
||||
import com.lanyuanxiaoyao.service.web.controller.base.AmisCrudResponse;
|
||||
import com.lanyuanxiaoyao.service.web.controller.base.AmisResponse;
|
||||
@@ -116,4 +118,34 @@ public class HudiController extends BaseController {
|
||||
}
|
||||
throw new Exception("Flink job id and alias or hdfs cannot be blank");
|
||||
}
|
||||
|
||||
@GetMapping("read_rollback_plan")
|
||||
public AmisResponse<HudiRollbackPlan> readRollbackPlan(
|
||||
@RequestParam(value = "flink_job_id", required = false) Long flinkJobId,
|
||||
@RequestParam(value = "alias", required = false) String alias,
|
||||
@RequestParam(value = "hdfs", required = false) String hdfs,
|
||||
@RequestParam("instant") String instant
|
||||
) throws Exception {
|
||||
if (StrUtil.isNotBlank(hdfs)) {
|
||||
return AmisResponse.responseSuccess(hudiService.readRollbackPlanHdfs(hdfs, instant));
|
||||
} else if (ObjectUtil.isNotNull(flinkJobId) && StrUtil.isNotBlank(alias)) {
|
||||
return AmisResponse.responseSuccess(hudiService.readRollbackPlan(flinkJobId, alias, instant));
|
||||
}
|
||||
throw new Exception("Flink job id and alias or hdfs cannot be blank");
|
||||
}
|
||||
|
||||
@GetMapping("read_cleaner_plan")
|
||||
public AmisResponse<HudiCleanerPlan> readCleanerPlan(
|
||||
@RequestParam(value = "flink_job_id", required = false) Long flinkJobId,
|
||||
@RequestParam(value = "alias", required = false) String alias,
|
||||
@RequestParam(value = "hdfs", required = false) String hdfs,
|
||||
@RequestParam("instant") String instant
|
||||
) throws Exception {
|
||||
if (StrUtil.isNotBlank(hdfs)) {
|
||||
return AmisResponse.responseSuccess(hudiService.readCleanerPlanHdfs(hdfs, instant));
|
||||
} else if (ObjectUtil.isNotNull(flinkJobId) && StrUtil.isNotBlank(alias)) {
|
||||
return AmisResponse.responseSuccess(hudiService.readCleanerPlan(flinkJobId, alias, instant));
|
||||
}
|
||||
throw new Exception("Flink job id and alias or hdfs cannot be blank");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user