refactor(info-query): 优化参数

This commit is contained in:
2023-12-27 17:07:46 +08:00
parent d0f10db702
commit 6b564bb7ea
2 changed files with 6 additions and 5 deletions

View File

@@ -3,21 +3,22 @@ package com.lanyuanxiaoyao.service.configuration.entity.info;
import com.eshore.odcp.hudi.connector.entity.FlinkJob; import com.eshore.odcp.hudi.connector.entity.FlinkJob;
import com.eshore.odcp.hudi.connector.entity.TableMeta; import com.eshore.odcp.hudi.connector.entity.TableMeta;
import java.util.List; import java.util.List;
import org.eclipse.collections.api.list.ImmutableList;
/** /**
* flink job 和 table meta * flink job 和 table meta
* *
* @author lanyuanxiaoyao * @author lanyuanxiaoyao
* @date 2023-04-24 * @date 2023-12-27
*/ */
public class JobAndMetas { public class JobAndMetas {
private FlinkJob job; private FlinkJob job;
private List<TableMeta> metas; private ImmutableList<TableMeta> metas;
public JobAndMetas() { public JobAndMetas() {
} }
public JobAndMetas(FlinkJob job, List<TableMeta> metas) { public JobAndMetas(FlinkJob job, ImmutableList<TableMeta> metas) {
this.job = job; this.job = job;
this.metas = metas; this.metas = metas;
} }
@@ -26,7 +27,7 @@ public class JobAndMetas {
return job; return job;
} }
public List<TableMeta> getMetas() { public ImmutableList<TableMeta> getMetas() {
return metas; return metas;
} }

View File

@@ -210,7 +210,7 @@ public class InfoService {
@Cacheable(value = "job-metas", sync = true) @Cacheable(value = "job-metas", sync = true)
@Retryable(Throwable.class) @Retryable(Throwable.class)
public ImmutableList<JobAndMetas> jobAndMetas() { public ImmutableList<JobAndMetas> jobAndMetas() {
return databaseService.findAllFlinkJob().collect(job -> new JobAndMetas(job, databaseService.findTableMeta(job.getId()).toList())); return databaseService.findAllFlinkJob().collect(job -> new JobAndMetas(job, databaseService.findTableMeta(job.getId())));
} }
@Cacheable(value = "flink-jobs", sync = true) @Cacheable(value = "flink-jobs", sync = true)