Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public Mono<ResponseEntity<ConsumerGroupsPageResponseDTO>> getConsumerGroupsPage
Optional.ofNullable(page).filter(i -> i > 0).orElse(1),
Optional.ofNullable(perPage).filter(i -> i > 0).orElse(defaultConsumerGroupsPageSize),
search,
fts,
Optional.ofNullable(orderBy).orElse(ConsumerGroupOrderingDTO.NAME),
Optional.ofNullable(sortOrderDto).orElse(SortOrderDTO.ASC)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ public Mono<ConsumerGroupsPage> getConsumerGroupsPage(
int pageNum,
int perPage,
@Nullable String search,
Boolean fts,
ConsumerGroupOrderingDTO orderBy,
SortOrderDTO sortOrderDto) {
return adminClientService.get(cluster).flatMap(ac ->
ac.listConsumerGroups()
.map(listing -> filterGroups(listing, search)
.map(listing -> filterGroups(listing, search, fts)
)
.flatMapIterable(lst -> lst)
.filterWhen(cg -> accessControlService.isConsumerGroupAccessible(cg.groupId(), cluster.getName()))
Expand All @@ -169,9 +170,11 @@ public Mono<ConsumerGroupsPage> getConsumerGroupsPage(
(allGroups.size() / perPage) + (allGroups.size() % perPage == 0 ? 0 : 1))))));
}

private Collection<ConsumerGroupListing> filterGroups(Collection<ConsumerGroupListing> groups, String search) {
ClustersProperties.ClusterFtsProperties fts = clustersProperties.getFts();
ConsumerGroupFilter filter = new ConsumerGroupFilter(groups, fts.isEnabled(), fts.getConsumers());
private Collection<ConsumerGroupListing> filterGroups(Collection<ConsumerGroupListing> groups, String search,
Boolean useFts) {
ClustersProperties.ClusterFtsProperties ftsProperties = clustersProperties.getFts();
boolean fts = ftsProperties.use(useFts);
ConsumerGroupFilter filter = new ConsumerGroupFilter(groups, fts, ftsProperties.getConsumers());
return filter.find(search);
}

Expand Down
Loading