avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben McCann (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1247) Fix bug when using custom classloader
Date Sun, 10 Feb 2013 00:11:12 GMT

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

Ben McCann updated AVRO-1247:
-----------------------------

    Description: 
I created a SpecificResponder with a SpecificData which contains my custom classloader (Play
Framework's custom classloader actually). However, it's a real pain to do because SpecificResponder.getDatumReader
and SpecificResponder.getDatumWriter don't use the SpecificData that I passed in. When creating
a new object those two methods should use the SpecificData object that was passed in the constructor.

{code}
  @Override
  protected DatumWriter<Object> getDatumWriter(Schema schema) {
    // It currently uses SpecificData.INSTANCE which makes using a different ClassLoader very
difficult
    // return new SpecificDatumWriter<Object>(schema);
    return new SpecificDatumWriter<Object>(schema, data);
  }

  @Override
  protected DatumReader<Object> getDatumReader(Schema actual, Schema expected) {
    // It currently uses SpecificData.INSTANCE which makes using a different ClassLoader very
difficult
    // return new SpecificDatumReader<Object>(actual, expected, data);
    return new SpecificDatumReader<Object>(actual, expected, data);
  }
{/code}

  was:
I created a SpecificResponder with a SpecificData which contains my custom classloader (Play
Framework's custom classloader actually). However, it's a real pain to do because SpecificResponder.getDatumReader
and SpecificResponder.getDatumWriter don't use the SpecificData that I passed in. When creating
a new object those two methods should use the SpecificData object that was passed in the constructor.

    @Override
    protected DatumWriter<Object> getDatumWriter(Schema schema) {
      // It currently uses SpecificData.INSTANCE which makes using a different ClassLoader
very difficult
      // return new SpecificDatumWriter<Object>(schema);
      return new SpecificDatumWriter<Object>(schema, data);
    }
    
    @Override
    protected DatumReader<Object> getDatumReader(Schema actual, Schema expected) {
      // It currently uses SpecificData.INSTANCE which makes using a different ClassLoader
very difficult
      // return new SpecificDatumReader<Object>(actual, expected, data);
      return new SpecificDatumReader<Object>(actual, expected, data);
    }


    
> Fix bug when using custom classloader
> -------------------------------------
>
>                 Key: AVRO-1247
>                 URL: https://issues.apache.org/jira/browse/AVRO-1247
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.3
>            Reporter: Ben McCann
>              Labels: patch
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> I created a SpecificResponder with a SpecificData which contains my custom classloader
(Play Framework's custom classloader actually). However, it's a real pain to do because SpecificResponder.getDatumReader
and SpecificResponder.getDatumWriter don't use the SpecificData that I passed in. When creating
a new object those two methods should use the SpecificData object that was passed in the constructor.
> {code}
>   @Override
>   protected DatumWriter<Object> getDatumWriter(Schema schema) {
>     // It currently uses SpecificData.INSTANCE which makes using a different ClassLoader
very difficult
>     // return new SpecificDatumWriter<Object>(schema);
>     return new SpecificDatumWriter<Object>(schema, data);
>   }
>   @Override
>   protected DatumReader<Object> getDatumReader(Schema actual, Schema expected)
{
>     // It currently uses SpecificData.INSTANCE which makes using a different ClassLoader
very difficult
>     // return new SpecificDatumReader<Object>(actual, expected, data);
>     return new SpecificDatumReader<Object>(actual, expected, data);
>   }
> {/code}

--
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

Mime
View raw message