feat(executor-task): 使用Flink SQL查询表总数、业务最后操作时间
This commit is contained in:
@@ -38,6 +38,10 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.vandermeer</groupId>
|
||||
<artifactId>asciitable</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-client</artifactId>
|
||||
|
||||
@@ -52,12 +52,12 @@ public class ExecutorTaskController {
|
||||
return executorTaskService.scanAvro(key, hdfs, pulsar, pulsarTopic, scanSource, scanQueue, scanLog, scanBase, scanTarget, filterFields);
|
||||
}
|
||||
|
||||
@GetMapping("latest_op_ts")
|
||||
@GetMapping("table_summary")
|
||||
public String latestOpTs(@RequestParam("hdfs") String hdfs) throws Exception {
|
||||
if (StrUtil.isBlank(hdfs)) {
|
||||
throw new RuntimeException("Hdfs path cannot be empty");
|
||||
}
|
||||
return executorTaskService.scanLatestOpTs(hdfs);
|
||||
return executorTaskService.tableSummary(hdfs);
|
||||
}
|
||||
|
||||
@GetMapping("results")
|
||||
|
||||
@@ -209,9 +209,9 @@ public class ExecutorTaskService {
|
||||
return applicationId.toString();
|
||||
}
|
||||
|
||||
public String scanLatestOpTs(String hdfs) throws Exception {
|
||||
public String tableSummary(String hdfs) throws Exception {
|
||||
String taskId = taskId();
|
||||
Configuration configuration = generateConfiguration(taskId, StrUtil.format("latest_op_ts {}", hdfs));
|
||||
Configuration configuration = generateConfiguration(taskId, StrUtil.format("summary {}", hdfs));
|
||||
configuration.set(TaskManagerOptions.MANAGED_MEMORY_SIZE, MemorySize.parse("1024m"));
|
||||
MapBuilder<String, Object> builder = MapUtil.builder();
|
||||
|
||||
@@ -219,7 +219,7 @@ public class ExecutorTaskService {
|
||||
|
||||
ApplicationId applicationId = Runner.run(
|
||||
configuration,
|
||||
"com.lanyuanxiaoyao.service.executor.task.LatestOperationTimeScan",
|
||||
"com.lanyuanxiaoyao.service.executor.task.TableSummary",
|
||||
new String[]{
|
||||
TaskConstants.TASK_CONTEXT_OPTION,
|
||||
mapper.writeValueAsString(
|
||||
|
||||
Reference in New Issue
Block a user