Uploaded image for project: 'Bookkeeper'
  1. Bookkeeper
  2. BOOKKEEPER-1068

Expose ByteBuf in LedgerEntry to avoid data copy

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5.0
    • Component/s: None
    • Labels:
      None

      Description

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mmerli Matteo Merli
                Reporter:
                mmerli Matteo Merli
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: