Skip to content

Interfaces for supporting zero copy into Protobuf (HasByteBuffer & Detachable) #7387

@voidzcy

Description

@voidzcy

APIs for supporting zero-copy protobuf deserialization from ByteBuffers to protobuf messages. The marshaller can wrap ByteBuffer as ByteSting with UnsafeByteOperations, concatenate ByteStrings into a single RopeByteString and then create a CodedInputStream from it.

New interfaces for the inbound InputStream to allow the marshaller:

  • HasByteBuffer: access the underlying ByteBuffers directly without copying bytes
  • Detachable: keep the ByteBuffers around until the application code is done with using the protobuf messages.

More details and an example marshaller implementation can be seen in #8102 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    experimental APIIssue tracks stabilizing an experimental API

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions