[
https://issues.apache.org/jira/browse/AVRO-1268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13605850#comment-13605850
]
Alexandre Normand commented on AVRO-1268:
-----------------------------------------
Doug, I'd like to come back on [your
comment|https://issues.apache.org/jira/browse/AVRO-1268?focusedCommentId=13597518&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13597518]
on the #readString optimization. I think I'm missing a piece or I'm
misunderstanding.
The {{data.STRING_PROP}} property is set on individual string fields so we
can't really read it just once at the initialization of the
{{GenerateDatumReader}}, can't we? We could read it in #read before calling
#readString but that would end up having the same performance. That is, unless
we keep track of states as we pile up calls to #read on the reader instance and
reuse that on subsequent reads using the same reader (we wouldn't have any
performance gains on readers being used for single read operations but
performance is probably not important in such use cases). Is that what you were
referring to with your suggestion to "pre-compute a state tree could be walked
in parallel to the schema where all lookups would be pre-computed"?
> 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-needs-work.patch, AVRO-1268.patch,
> AVRO-1268.patch, AVRO-1268.sh, GenericStringsPerf.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