[Optimize]GroupTopic信息修改为实时获取 (#1196)

This commit is contained in:
EricZeng
2023-11-27 21:08:05 +08:00
committed by GitHub
parent 8346453aa3
commit b6ea4aec19
3 changed files with 9 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ public interface GroupManager {
String searchGroupKeyword, String searchGroupKeyword,
PaginationBaseDTO dto); PaginationBaseDTO dto);
PaginationResult<GroupTopicOverviewVO> pagingGroupTopicMembers(Long clusterPhyId, String groupName, PaginationBaseDTO dto); PaginationResult<GroupTopicOverviewVO> pagingGroupTopicMembers(Long clusterPhyId, String groupName, PaginationBaseDTO dto) throws Exception;
PaginationResult<GroupOverviewVO> pagingClusterGroupsOverview(Long clusterPhyId, ClusterGroupSummaryDTO dto); PaginationResult<GroupOverviewVO> pagingClusterGroupsOverview(Long clusterPhyId, ClusterGroupSummaryDTO dto);

View File

@@ -118,10 +118,15 @@ public class GroupManagerImpl implements GroupManager {
} }
@Override @Override
public PaginationResult<GroupTopicOverviewVO> pagingGroupTopicMembers(Long clusterPhyId, String groupName, PaginationBaseDTO dto) { public PaginationResult<GroupTopicOverviewVO> pagingGroupTopicMembers(Long clusterPhyId, String groupName, PaginationBaseDTO dto) throws Exception {
long startTimeUnitMs = System.currentTimeMillis(); long startTimeUnitMs = System.currentTimeMillis();
Group group = groupService.getGroupFromDB(clusterPhyId, groupName); ClusterPhy clusterPhy = clusterPhyService.getClusterByCluster(clusterPhyId);
if (clusterPhy == null) {
return PaginationResult.buildFailure(MsgConstant.getClusterPhyNotExist(clusterPhyId), dto);
}
Group group = groupService.getGroupFromKafka(clusterPhy, groupName);
//没有topicMember则直接返回 //没有topicMember则直接返回
if (group == null || ValidateUtils.isEmptyList(group.getTopicMembers())) { if (group == null || ValidateUtils.isEmptyList(group.getTopicMembers())) {

View File

@@ -77,7 +77,7 @@ public class ClusterGroupsController {
@GetMapping(value = "clusters/{clusterPhyId}/groups/{groupName}/topics-overview") @GetMapping(value = "clusters/{clusterPhyId}/groups/{groupName}/topics-overview")
public PaginationResult<GroupTopicOverviewVO> getGroupTopicsOverview(@PathVariable Long clusterPhyId, public PaginationResult<GroupTopicOverviewVO> getGroupTopicsOverview(@PathVariable Long clusterPhyId,
@PathVariable String groupName, @PathVariable String groupName,
PaginationBaseDTO dto) { PaginationBaseDTO dto) throws Exception {
return groupManager.pagingGroupTopicMembers(clusterPhyId, groupName, dto); return groupManager.pagingGroupTopicMembers(clusterPhyId, groupName, dto);
} }