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

Doug Cutting commented on AVRO-1268:
------------------------------------

A test of generated specific code should live in the compiler module, not in 
the core avro module, even if it's testing code that's in the core avro module. 
 Otherwise we won't end up re-generating the code when the compiler's changed.  
(The compiler output tests are an exception, since tests will fail if they're 
not updated when the compiler changes.)  Those tests that currently use 
FooBarSpecificRecord should be moved.  (The compiler has in fact changed since 
FooBarSpecificRecord.java was last generated, illustrating the problem.)

As for performance, arrays and maps might be improved by factoring the 
getClassProp outside of the loop.  So the methods might become something like:
  - Class getJavaClass(Schema);
  - Object readElement(Class, ...);

It would be good to benchmark strings and arrays of strings too.  Your second 
benchmark above should be identical to the first, since no strings exist in 
FooBarSpecificRecord, right?  Maybe we need to run more iterations, since we 
might just be seeing run-to-run variations?
                
> Add java-class, java-key-class and java-element-class support for stringable 
> types to SpecificData
> --------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-1268
>                 URL: https://issues.apache.org/jira/browse/AVRO-1268
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.4
>            Reporter: Alexandre Normand
>            Assignee: Alexandre Normand
>            Priority: Minor
>             Fix For: 1.7.5
>
>         Attachments: AVRO-1268.patch, AVRO-1268.patch
>
>
> Stringable types are java classes that can be serialized through strings 
> (which require a single string constructor and a valid toString() 
> implementation). ReflectData currently has support from stringable types but 
> it would be desirable to get this feature with SpecificData. 
> The work involves changes to the SpecificCompiler (depends on {{@java-class}} 
> support in AVRO-1267) to generate the specific sources with the proper java 
> type as well as moving the ReflectDatumReader and ReflectDatumWriter to read 
> the java-class/java-key-class and java-element-class properties. 

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