feat(info-query): 增加更新pulsar backlog数据的接口
This commit is contained in:
@@ -17,6 +17,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import static com.lanyuanxiaoyao.service.common.Constants.HALF_HOUR;
|
||||
import static com.lanyuanxiaoyao.service.common.Constants.MINUTE;
|
||||
|
||||
/**
|
||||
@@ -46,7 +47,7 @@ public class PulsarMetrics extends Metrics {
|
||||
backlogMap = Maps.mutable.empty();
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = MINUTE, initialDelay = MINUTE)
|
||||
@Scheduled(fixedDelay = HALF_HOUR, initialDelay = MINUTE)
|
||||
@Override
|
||||
void update() {
|
||||
infoService.tableMetaList()
|
||||
@@ -71,6 +72,7 @@ public class PulsarMetrics extends Metrics {
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
Long backlog = pulsarService.backlog(name, meta.getTopic(), NameHelper.pulsarSubscriptionName(meta.getJob().getId(), meta.getAlias(), hudiServiceProperties.getSignature()));
|
||||
backlogCache.set(backlog);
|
||||
infoService.savePulsarBacklog(meta.getJob().getId(), meta.getAlias(), backlog);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user