You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Chia-Ping Tsai (Jira)" <ji...@apache.org> on 2020/08/30 09:56:00 UTC

[jira] [Assigned] (KAFKA-10433) Reuse the ByteBuffer in validating compressed records

     [ https://issues.apache.org/jira/browse/KAFKA-10433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chia-Ping Tsai reassigned KAFKA-10433:
--------------------------------------

    Assignee: Ismael Juma  (was: Chia-Ping Tsai)

> Reuse the ByteBuffer in validating compressed records 
> ------------------------------------------------------
>
>                 Key: KAFKA-10433
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10433
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Chia-Ping Tsai
>            Assignee: Ismael Juma
>            Priority: Major
>
> {code:java}
> for (batch <- batches) {
>   validateBatch(topicPartition, firstBatch, batch, origin, toMagic, brokerTopicStats)
>   uncompressedSizeInBytes += AbstractRecords.recordBatchHeaderSizeInBytes(toMagic, batch.compressionType())
>   val recordsIterator = if (inPlaceAssignment && firstBatch.magic >= RecordBatch.MAGIC_VALUE_V2)
>     batch.skipKeyValueIterator(BufferSupplier.NO_CACHING)
>   else
>     batch.streamingIterator(BufferSupplier.NO_CACHING)
> {code}
> It is hot method so reusing the ByteBuffer can reduce a bunch of memory usage if the compression type supports BufferSupplier.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)