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


##########
clients/src/main/java/org/apache/kafka/common/record/RecordsUtil.java:
##########
@@ -89,10 +89,11 @@ protected static ConvertedRecords<MemoryRecords> 
downConvert(Iterable<? extends
                 buffer = Utils.ensureCapacity(buffer, buffer.position() + 
recordBatchAndRecords.batch.sizeInBytes());
                 recordBatchAndRecords.batch.writeTo(buffer);
             } else {
-                MemoryRecordsBuilder builder = convertRecordBatch(toMagic, 
buffer, recordBatchAndRecords);
-                buffer = builder.buffer();
-                temporaryMemoryBytes += builder.uncompressedBytesWritten();
-                numRecordsConverted += builder.numRecords();
+                try (MemoryRecordsBuilder builder = 
convertRecordBatch(toMagic, buffer, recordBatchAndRecords)) {

Review Comment:
   > I'll go ahead and close the PR.
   
   yes and thanks for your contribution. Please feel free to ping me if you 
have other PRs needs to be reviewed.



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