avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: using custom builders
Date Wed, 06 Jun 2012 17:16:18 GMT
On 06/05/2012 05:01 PM, Joel VanderWerf wrote:
> This may be what I'm looking for:
> org.apache.avro.specific.SpecificData
> The getClass() method perhaps can be overridden to map incoming record
> class names to java classes. Not sure if this is the right way to do it
> though. There's also a getClassName() which might be a better method to
> override.
> Any thoughts?

Overriding one of the two of these sounds like the right thing. 
getClass() is implemented in terms of getClassName(), so if getClass() 
otherwise does what you want and supplying a different class name is 
sufficient then just override getClassName().  If you need to instead 
override getClass() then you'll probably want to invoke super.getClass() 
for non-record schemas.

I hope this helps.


View raw message