chia7712 commented on code in PR #16277:
URL: https://github.com/apache/kafka/pull/16277#discussion_r1637123570


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java:
##########
@@ -1033,10 +1033,18 @@ public Deque<ProducerBatch> getDeque(TopicPartition tp) 
{
      * Get the deque for the given topic-partition, creating it if necessary.
      */
     private Deque<ProducerBatch> getOrCreateDeque(TopicPartition tp) {
-        TopicInfo topicInfo = topicInfoMap.computeIfAbsent(tp.topic(), k -> 
new TopicInfo(logContext, k, batchSize));
+        TopicInfo topicInfo = topicInfoMap.computeIfAbsent(tp.topic(),
+                k -> new TopicInfo(createBuiltInPartitioner(logContext, k, 
batchSize)));
         return topicInfo.batches.computeIfAbsent(tp.partition(), k -> new 
ArrayDeque<>());
     }
 
+    /**
+     * Subclass can custom {@link BuiltInPartitioner}

Review Comment:
   this comment is a bit redundant, since it just describe what the code. It 
would be better to explain why we need this method rather than inline it. Or we 
can remove the docs



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to