lianetm commented on code in PR #14690:
URL: https://github.com/apache/kafka/pull/14690#discussion_r1408357542


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManager.java:
##########
@@ -192,6 +221,26 @@ private NetworkClientDelegate.UnsentRequest 
makeHeartbeatRequest() {
         });
     }
 
+    private List<ConsumerGroupHeartbeatRequestData.TopicPartitions> 
buildTopicPartitionsList(Set<TopicIdPartition> topicIdPartitions) {
+        List<ConsumerGroupHeartbeatRequestData.TopicPartitions> result = new 
ArrayList<>();
+        Map<Uuid, List<Integer>> partitionsPerTopicId = new HashMap<>();
+        for (TopicIdPartition topicIdPartition : topicIdPartitions) {
+            Uuid topicId = topicIdPartition.topicId();
+            if (!partitionsPerTopicId.containsKey(topicId)) {
+                partitionsPerTopicId.put(topicId, new ArrayList<>());
+            }
+            
partitionsPerTopicId.get(topicId).add(topicIdPartition.partition());

Review Comment:
   Agree. It disappeared anyways after simplifying it all with the use of 
TopicPartitions.



-- 
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