部分后台任务获取Topic列表时不走缓存

This commit is contained in:
zengqiao
2021-04-22 16:06:37 +08:00
parent 59df5b24fe
commit d6559be3fc
5 changed files with 19 additions and 2 deletions

View File

@@ -22,6 +22,8 @@ import java.util.Map;
public interface TopicManagerService {
List<TopicDO> listAll();
List<TopicDO> getByClusterIdFromCache(Long clusterId);
List<TopicDO> getByClusterId(Long clusterId);
TopicDO getByTopicName(Long clusterId, String topicName);

View File

@@ -95,6 +95,14 @@ public class TopicManagerServiceImpl implements TopicManagerService {
return new ArrayList<>();
}
@Override
public List<TopicDO> getByClusterIdFromCache(Long clusterId) {
if (clusterId == null) {
return new ArrayList<>();
}
return topicDao.getByClusterIdFromCache(clusterId);
}
@Override
public List<TopicDO> getByClusterId(Long clusterId) {
if (clusterId == null) {

View File

@@ -381,7 +381,7 @@ public class TopicServiceImpl implements TopicService {
return new ArrayList<>();
}
List<TopicDO> topicDOList = topicManagerService.getByClusterId(clusterId);
List<TopicDO> topicDOList = topicManagerService.getByClusterIdFromCache(clusterId);
if (ValidateUtils.isNull(topicDOList)) {
topicDOList = new ArrayList<>();
}