avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Armbrust (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-873) SpecificDatumReader should allow users to specify the ClassLoader used.
Date Thu, 11 Aug 2011 03:35:27 GMT

     [ https://issues.apache.org/jira/browse/AVRO-873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Armbrust updated AVRO-873:
----------------------------------

    Attachment: specificDataClassLoader2.patch

Thanks for the feedback.  Here is an update patch.

> SpecificDatumReader should allow users to specify the ClassLoader used.
> -----------------------------------------------------------------------
>
>                 Key: AVRO-873
>                 URL: https://issues.apache.org/jira/browse/AVRO-873
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Michael Armbrust
>            Assignee: Michael Armbrust
>         Attachments: specificDataClassLoader2.patch
>
>
> Right now SpecificData resolves classes for SpecificRecords by calling Class.forName(),
which uses the ClassLoader used to load the SpecificData class. I believe this makes it impossible
to deserialize into SpecificRecords that are loaded using a different ClassLoader.
> One relatively simple way to fix this limitations involves:
> * Adding a constructor to SpecificData that allows the user to specify a ClassLoader.
> * Changing the current protected constructor of SpecificDatumReader that takes a SpecificData
to be public instead of protected.
> * Changing SpecificDatumReader to actually use the SpecificData that is passed into the
constructor.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message