jolshan commented on code in PR #15968:
URL: https://github.com/apache/kafka/pull/15968#discussion_r1643562963


##########
clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java:
##########
@@ -126,15 +134,15 @@ public ProduceRequest(ProduceRequestData 
produceRequestData, short version) {
     }
 
     // visible for testing
-    Map<TopicPartition, Integer> partitionSizes() {
+    Map<TopicIdPartition, Integer> partitionSizes() {
         if (partitionSizes == null) {
             // this method may be called by different thread (see the comment 
on data)
             synchronized (this) {
                 if (partitionSizes == null) {
-                    Map<TopicPartition, Integer> tmpPartitionSizes = new 
HashMap<>();
+                    Map<TopicIdPartition, Integer> tmpPartitionSizes = new 
HashMap<>();
                     data.topicData().forEach(topicData ->
                         topicData.partitionData().forEach(partitionData ->
-                            tmpPartitionSizes.compute(new 
TopicPartition(topicData.name(), partitionData.index()),
+                            tmpPartitionSizes.compute(new 
TopicIdPartition(topicData.topicId(), partitionData.index(), topicData.name()),

Review Comment:
   will we ever need the name and ID for this data structure? I know fetch had 
something where we pass in a map to convert IDs to names if needed.
   
   Just want to make sure folks won't use this info expecting the name to be 
there. If we don't think it is needed, maybe just include a comment about it. 



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