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

GenericDatumWriter does not support native ByteBuffers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.3
    • 1.7.0
    • None
    • None

    Description

      An exception is thrown when trying to encode bytes backed by a file.

      java.lang.UnsupportedOperationException: null
      at java.nio.ByteBuffer.arrayOffset(ByteBuffer.java:968) ~[na:1.6.0_31]
      at org.apache.avro.io.BinaryEncoder.writeBytes(BinaryEncoder.java:61) ~[avro-1.6.3.jar:1.6.3]

      Note arrayOffset is an optional method, see:
      http://docs.oracle.com/javase/6/docs/api/java/nio/ByteBuffer.html#arrayOffset%28%29

      FileChannel returns native ByteBuffer not HeapedByteBuffer

      See here:
      http://mail-archives.apache.org/mod_mbox/avro-user/201202.mbox/%3CCB57F421.6BFE2%25scott@richrelevance.com%3E

      Attachments

        1. AVRO-1081.patch
          13 kB
          Doug Cutting
        2. ByteBufferTest.java
          4 kB
          Robert Fuller
        3. ByteBufferTest.java
          4 kB
          Robert Fuller
        4. patch.diff.txt
          4 kB
          Robert Fuller
        5. patch.diff.txt
          4 kB
          Robert Fuller

        Activity

          People

            cutting Doug Cutting
            rfuller Robert Fuller
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: