Thrift
  1. Thrift
  2. THRIFT-894

Make default accessors for binary fields return byte[]; provide new accessors to get ByteBuffer version

    Details

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

      Description

      Folks have pointed out that it's not always best for users to interact with the ByteBuffers that are now backing binary fields in our structs. In truth, it seems like ByteBuffers are probably an expert means of access, with associated benefits and complexities.

      I think we should generate two different sets of accessors for binary fields: a default set, named like usual, that return and take byte[], and a second set, named something like "get_buffer_for_<field>" that returns the underlying ByteBuffer. The byte[] accessors can wrap around the ByteBuffer ones as necessary.

      1. thrift-894.patch
        4 kB
        Bryan Duxbury
      2. thrift-894-v2.patch
        6 kB
        Bryan Duxbury
      3. thrift-894-v3.patch
        6 kB
        Bryan Duxbury

        Activity

          People

          • Assignee:
            Bryan Duxbury
            Reporter:
            Bryan Duxbury
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development