jolshan commented on a change in pull request #11331:
URL: https://github.com/apache/kafka/pull/11331#discussion_r745053425



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java
##########
@@ -340,11 +340,9 @@ public FetchRequestData build() {
             // Add topic IDs to session if we can use them. If an ID is 
inconsistent, we will handle in the receiving broker.
             // If we switched from using topic IDs to not using them (or vice 
versa), that error will also be handled in the receiving broker.
             if (canUseTopicIds) {
-                Map<Uuid, Set<String>> newTopicNames = 
added.stream().collect(Collectors.groupingByConcurrent(TopicIdPartition::topicId,
-                        Collectors.mapping(topicIdPartition -> 
topicIdPartition.topicPartition().topic(), Collectors.toSet())));
-
-                // There should only be one topic name per topic ID.
-                newTopicNames.forEach((topicId, topicNamesSet) -> 
topicNamesSet.forEach(topicName -> sessionTopicNames.put(topicId, topicName)));
+                sessionTopicNames = topicNames;
+            } else {
+                sessionTopicNames = Collections.emptyMap();

Review comment:
       I think the session will already have an empty map or close but it don't 
think it makes a big difference with or without this change.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to