fix(exporter): 修复查询未运行flink任务数量不正确
This commit is contained in:
@@ -39,8 +39,9 @@ public class ExporterController {
|
||||
@Cacheable(value = "un_running_flink_job", sync = true)
|
||||
public ImmutableList<FlinkJobIdAndName> unRunningFlinkJob() {
|
||||
ImmutableList<String> locks = zookeeperService.getChildren(NameHelper.ZK_SYNC_RUNNING_LOCK_PATH).collect(ZookeeperNode::getPath);
|
||||
return infoService.flinkJobList()
|
||||
.reject(job -> locks.contains(NameHelper.syncFlinkName(job.getId(), job.getName())))
|
||||
.collect(job -> new FlinkJobIdAndName(job.getId(), job.getName()));
|
||||
return infoService.simpleTableMetas()
|
||||
.collect(meta -> new FlinkJobIdAndName(meta.getFlinkJobId(), meta.getFlinkJobName()))
|
||||
.distinct()
|
||||
.reject(job -> locks.contains(NameHelper.syncRunningLockPath(job.getId())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,24 @@ public class FlinkJobIdAndName {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
FlinkJobIdAndName that = (FlinkJobIdAndName) o;
|
||||
|
||||
if (!id.equals(that.id)) return false;
|
||||
return name.equals(that.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = id.hashCode();
|
||||
result = 31 * result + name.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FlinkJobIdAndName{" +
|
||||
|
||||
Reference in New Issue
Block a user