[ 
https://issues.apache.org/jira/browse/AVRO-1353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13731257#comment-13731257
 ] 

Marshall Bockrath-Vandegrift commented on AVRO-1353:
----------------------------------------------------

Reworking, but running into a few issues:

> SpecificData has a getClassLoader() method that's currently used for this. 
> Generalizing it to a base class sounds like the thing to do. So this is 
> another method that should migrate to the new abstract base class or to 
> GenericData in the meantime.

I'm finding that I also need to add a setClassLoader() method, because the 
standard reflection utilities can only invoke a no-argument constructor.  That 
means the classLoader member becomes non-final, which impacts thread-safety...

How bad is it to tread deeper into the reflection mire, so as to invoke the 
GenericData (subclass) constructor with a ClassLoader argument?  Alternatively, 
what about including an avro-mapred DataModelFactory interface, instances of 
which can be Configurable?  Then serialization creates an instance of the 
factory, which returns instances of the GenericData subclass.
                
> Configurable Hadoop serialization in-memory representations
> -----------------------------------------------------------
>
>                 Key: AVRO-1353
>                 URL: https://issues.apache.org/jira/browse/AVRO-1353
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.5
>            Reporter: Marshall Bockrath-Vandegrift
>         Attachments: avro-1353-2.patch, avro-1353.patch
>
>
> As discussed on the Avro Users mailing list [1], it would be useful to allow 
> configuration of the DatumReader/Writer implementations used by Hadoop Avro 
> serialization, especially for non-Java JVM languages.
> [1] 
> http://mail-archives.apache.org/mod_mbox/avro-user/201305.mbox/%3C87ehdh14qn.fsf%40zeno.atl.damballa%3E

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to