Uploaded image for project: 'Avro'
  1. Avro
  2. AVRO-1457

ReadOnly ByteBuffer serialization state changes after writing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.4
    • Fix Version/s: 1.7.7
    • Component/s: None
    • Labels:
      None

      Description

      Using the GenericDatumWriter specifically, writing out an avro containing a read-only ByteBuffer changes state of the original object, making it unusable after the initial write. Potentially either the ByteBuffer needs to be copied prior to writing if read-only, or the offset needs to be reset after writing.

      I'll attach a simple test which shows the issue

        Attachments

        1. ByteBufferTest.java
          3 kB
          GregWhitsitt
        2. test.avdl
          0.3 kB
          GregWhitsitt
        3. AVRO-1457.patch
          4 kB
          Rob Turner

          Activity

            People

            • Assignee:
              robair Rob Turner
              Reporter:
              gw4722 GregWhitsitt
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: