avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Carey <scottca...@apache.org>
Subject Re: Make a copy of an avro record
Date Mon, 12 Mar 2012 17:20:26 GMT
We should be generating Java 1.6 compatible code.

What version were you testing?

1.6.3 is near release, the RC is available here:
http://mail-archives.apache.org/mod_mbox/avro-dev/201203.mbox/%3C4F514F22.8
=070700@apache.org%3E

Does it have the same problem?



On 3/12/12 9:27 AM, "Jeremy Lewi" <jeremy@lewi.us> wrote:


>Thanks James and Doug. I was able to simply cast the output of
>SpecificData...deepCopy to my type and it seems to bypass the problematic
>methods decorated with @override.
>What about the potential incompatibility with earlier versions of java
>due to the change in semantics of @override? If this is really an issue
>this seems like it would affect a lot of users particularly people using
>Avro MapReduce on a cluster where upgrading java is not a trivial
>proposition. In my particular case, the reduce processing requires
>loading all values associated with the key into memory, which
>necessitates a deep copy because the iterable object passed to the
>reducer seems to be reusing the same instance.
>
>Using SpecificData.get().deepCopy(record) seems like a viable workaround.
>Nonetheless, it does seem a bit problematic if the compiler is generating
>code that is incompatible with earlier versions of java.
>
>J
>
>On Mon, Mar 12, 2012 at 9:05 AM, Doug Cutting <cutting@apache.org> wrote:
>
>On 03/11/2012 10:22 PM, James Baldassari wrote:
>> If you want to make a deep copy of a specific record, the easiest way is
>> probably to use the Builder API,
>> e.g. GraphNodeData.newBuilder(recordToCopy).build().
>
>
>SpecificData.get().deepCopy(record) should work too.
>
>Doug
>
>
>



Mime
View raw message