chia7712 commented on a change in pull request #10269:
URL: https://github.com/apache/kafka/pull/10269#discussion_r589633902



##########
File path: core/src/main/scala/kafka/server/KafkaApis.scala
##########
@@ -3368,8 +3396,16 @@ object KafkaApis {
   private[server] def sizeOfThrottledPartitions(versionId: Short,
                                                 unconvertedResponse: 
FetchResponse,
                                                 quota: 
ReplicationQuotaManager): Int = {
-    FetchResponse.sizeOf(versionId, unconvertedResponse.responseData.entrySet
-      .iterator.asScala.filter(element => 
quota.isThrottled(element.getKey)).asJava)
+    val topicResponses = new 
util.ArrayList[FetchResponseData.FetchableTopicResponse]()

Review comment:
       > The previous version did not.
   
   It created copy before since we have to add a collection to auto-generated 
data to calculate the size. see 
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/requests/FetchResponse.java#L133




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

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


Reply via email to