[ 
https://issues.apache.org/jira/browse/KAFKA-8628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16878238#comment-16878238
 ] 

ASF GitHub Bot commented on KAFKA-8628:
---------------------------------------

cmccabe commented on pull request #7032: KAFKA-8628: Auto-generated Kafka RPC 
code should be able to use zero-copy ByteBuffers
URL: https://github.com/apache/kafka/pull/7032
 
 
   It is often more efficient to deal with large fields of type "bytes" as 
ByteBuffer objects, rather than Java arrays.  ByteBuffers can be used in a 
"zero-copy" fashion, where they simply serve as pointers into already allocated 
memory.  This avoids the need to copy the data, as would be necessary when 
using a regular Java byte array.
   
   There is a drawback to using zero-copy ByteBuffers, though: when they are 
used, the ByteBuffer from which we deserialized the request must remain valid 
until we're done with the request.  So the underlying buffer cannot be reused 
during this period.  Therefore, we don't want all bytes fields to show up as 
ByteBuffers.
   
   This change adds a "style" field to the RPC specifications which allows 
specifying that a "bytes" field should be deserialized as a zero-copy 
ByteBuffer rather than as a byte array.
 
----------------------------------------------------------------
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]


> Auto-generated Kafka RPC code should be able to use zero-copy ByteBuffers
> -------------------------------------------------------------------------
>
>                 Key: KAFKA-8628
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8628
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Colin P. McCabe
>            Assignee: Colin P. McCabe
>            Priority: Major
>
> Auto-generated Kafka RPC code should be able to use zero-copy ByteBuffers



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to