Skip to content

Commit b6ea4ae

Browse files
authored
[Optimize]GroupTopic信息修改为实时获取 (#1196)
1 parent 8346453 commit b6ea4ae

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

km-biz/src/main/java/com/xiaojukeji/know/streaming/km/biz/group/GroupManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PaginationResult<GroupTopicOverviewVO> pagingGroupMembers(Long clusterPhyId,
2626
String searchGroupKeyword,
2727
PaginationBaseDTO dto);
2828

29-
PaginationResult<GroupTopicOverviewVO> pagingGroupTopicMembers(Long clusterPhyId, String groupName, PaginationBaseDTO dto);
29+
PaginationResult<GroupTopicOverviewVO> pagingGroupTopicMembers(Long clusterPhyId, String groupName, PaginationBaseDTO dto) throws Exception;
3030

3131
PaginationResult<GroupOverviewVO> pagingClusterGroupsOverview(Long clusterPhyId, ClusterGroupSummaryDTO dto);
3232

km-biz/src/main/java/com/xiaojukeji/know/streaming/km/biz/group/impl/GroupManagerImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,15 @@ public PaginationResult<GroupTopicOverviewVO> pagingGroupMembers(Long clusterPhy
118118
}
119119

120120
@Override
121-
public PaginationResult<GroupTopicOverviewVO> pagingGroupTopicMembers(Long clusterPhyId, String groupName, PaginationBaseDTO dto) {
121+
public PaginationResult<GroupTopicOverviewVO> pagingGroupTopicMembers(Long clusterPhyId, String groupName, PaginationBaseDTO dto) throws Exception {
122122
long startTimeUnitMs = System.currentTimeMillis();
123123

124-
Group group = groupService.getGroupFromDB(clusterPhyId, groupName);
124+
ClusterPhy clusterPhy = clusterPhyService.getClusterByCluster(clusterPhyId);
125+
if (clusterPhy == null) {
126+
return PaginationResult.buildFailure(MsgConstant.getClusterPhyNotExist(clusterPhyId), dto);
127+
}
128+
129+
Group group = groupService.getGroupFromKafka(clusterPhy, groupName);
125130

126131
//没有topicMember则直接返回
127132
if (group == null || ValidateUtils.isEmptyList(group.getTopicMembers())) {

km-rest/src/main/java/com/xiaojukeji/know/streaming/km/rest/api/v3/cluster/ClusterGroupsController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public Result<Set<TopicPartitionKS>> getClusterPhyGroupPartitions(@PathVariable
7777
@GetMapping(value = "clusters/{clusterPhyId}/groups/{groupName}/topics-overview")
7878
public PaginationResult<GroupTopicOverviewVO> getGroupTopicsOverview(@PathVariable Long clusterPhyId,
7979
@PathVariable String groupName,
80-
PaginationBaseDTO dto) {
80+
PaginationBaseDTO dto) throws Exception {
8181
return groupManager.pagingGroupTopicMembers(clusterPhyId, groupName, dto);
8282
}
8383

0 commit comments

Comments
 (0)