You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Matteo Merli (JIRA)" <ji...@apache.org> on 2017/05/15 23:00:08 UTC

[jira] [Created] (BOOKKEEPER-1068) Expose ByteBuf in LedgerEntry to avoid data copy

Matteo Merli created BOOKKEEPER-1068:
----------------------------------------

             Summary: Expose ByteBuf in LedgerEntry to avoid data copy
                 Key: BOOKKEEPER-1068
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-1068
             Project: Bookkeeper
          Issue Type: Improvement
            Reporter: Matteo Merli
            Assignee: Matteo Merli
             Fix For: 4.5.0


To avoid copying the entries payloads when writing/reading on a ledger and having to allocate a lot of byte[] on the JVM heap, we need to accept Netty ByteBuf buffer.

By passing a ByteBuf, an application can use a pooled buffer, pointing to direct memory, to the {{LedgerHandle.addEntry()}} and have the same buffer forwarded on the connection sockets to the bookies.

The same thing on the read side, {{LedgerEntry}} exposes an additional {{getEntryBuffer()}} method that can be used to get the underlying buffer and possibly forward that to some other connection, with zero-copy behavior (excluding getting data in-out of the kernel).





--
This message was sent by Atlassian JIRA
(v6.3.15#6346)