gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerhard Gossen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GORA-361) AvroUtils.deepClonePersistent needs flush BinaryEncoder
Date Mon, 21 Jul 2014 16:32:39 GMT
Gerhard Gossen created GORA-361:

             Summary: AvroUtils.deepClonePersistent needs flush BinaryEncoder
                 Key: GORA-361
                 URL: https://issues.apache.org/jira/browse/GORA-361
             Project: Apache Gora
          Issue Type: Bug
          Components: gora-core
    Affects Versions: 0.4
            Reporter: Gerhard Gossen

Calling AvroUtils.deepClonePersistent on a smallish object (e.g. an unfetched Nutch WebPage)
results in the following exception:

java.lang.RuntimeException: Unable to deserialize avro object from byte buffer - please report
this issue to the Gora bugtracker or your administrator.
        at org.apache.gora.util.AvroUtils.deepClonePersistent(AvroUtils.java:125)

The method clones its argument by writing it to a wrapped byte array and deserializing it
from there. However, the output is buffered in the BinaryEncoder and doesn't appear in the
OutputStream. Adding {{enc.flush()}} after {{writer.write}} seems to fix the bug.

The attached patch contains a test that demonstrates the bug.

This message was sent by Atlassian JIRA

View raw message