You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "LinShunKang (via GitHub)" <gi...@apache.org> on 2023/05/13 08:31:24 UTC

[GitHub] [kafka] LinShunKang commented on pull request #12685: KAFKA-14945: Add Serializer#serializeToByteBuffer() to reduce memory copying

LinShunKang commented on PR #12685:
URL: https://github.com/apache/kafka/pull/12685#issuecomment-1546596937

   > LGTM overall. I wish the murmur code was somehow generalized so that there wasn't two versions of it. We'll just have to be careful that it doesn't diverge.
   
   Thank you for your reviewing!
   
   Utils#murmur2(byte[]) and Utils#murmur2(ByteBuffer) are only used for Partitioners, so we can:
   1. Modify all Partitioners to use Utils#murmur2(ByteBuffer)
   2. Add @Deprecated annotation for Utils#murmur2(byte[])
   3. Invoke Utils#murmur2(ByteBuffer.wrap(byte[])) in Utils#murmur2(byte[])
   
   In order to accomplish the first step mentioned above, we should add a method called WindowedSerializer#serializeBaseKeyToByteBuffer(String topic, Windowed data) and utilize this method in the WindowedStreamPartitioner#partition() function.


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org