[
https://issues.apache.org/jira/browse/AVRO-726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12979796#action_12979796
]
Xiaolu Ye commented on AVRO-726:
--------------------------------
Hi Scott,
As said in the email, I'm more than happy to share what we've done. Here's the
summary:
1) Introduced SpecificRecordEx interface that extends SpecificRecord and added
setter/getter of primitive types in it.
2) All generated classes are derived from SpecificRecordEx with impl class has
setter/getter of primitive types auto-generated based on the schema
3) Auto generate interface class for record type with user friendly
setter/getter of proper types and maintain inheritance structure based on
supertypes definition in the schema
4) Support callback dispatch by introducing Cbk interface in SpecificRecordEx
with dispatch(Cbk) function. All derived interface has its own Cbk interface
derived from SpecificRecordEx.Cbk, and its impl class implements dispatch(Cbk)
to invoke the proper callback.
5) Auto generate Builder class for each impl class
If you think this is in the right direction of what you want, I'm more than
happy to supply a patch. Also interested to get your input for any enhancement.
Please let me know. I have taked out cyclical reference patch from my
implemenation based on comments from AVRO-695 that Moustapha will change its
impl.
Thanks,
Xiaolu
> Make GenericDatumReader/GenericDatumWriter data member protected so that it
> can be used by the derived classes
> --------------------------------------------------------------------------------------------------------------
>
> Key: AVRO-726
> URL: https://issues.apache.org/jira/browse/AVRO-726
> Project: Avro
> Issue Type: Improvement
> Components: java
> Affects Versions: 1.5.0
> Reporter: Xiaolu Ye
> Fix For: 1.5.0
>
>
> Currently, GenericDatumReader/GenericDatumWriter data members are private. Is
> it possible to make them protected so that we could extend those classes and
> create our own special DatumReader/Writer? The reason we want to do that is
> because we've created our own base SpecificRecordEx that implements
> SpecificRecord and added put/get for primitive types. We now want to extend
> the GenericDatumReader/GenericDatumWriter to use those primitive put/get
> functions to reduce box/unbox for better performance.
> Thanks,
> Xiaolu
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.