You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Christophe Taton (JIRA)" <ji...@apache.org> on 2014/01/27 03:26:37 UTC

[jira] [Updated] (AVRO-1443) SpecificRecord builders should share more functionality with GenericRecord builders

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

Christophe Taton updated AVRO-1443:
-----------------------------------

    Attachment: AVRO-1443.20140126-182111-0800.diff

With this change:
 - All builders (generic and specific) extend generic records
 - Specific record builders do NOT extend GenericRecordBuilder,
   but implement the generic record builders interface.
 - Introduce interfaces for indexed/generic record builders.
 - Introduce interfaces for immutable indexed/generic records.
 - Update velocity template to add the new methods required for builders, with some formatting tweak to make the generated easier to read.
 - Deleted FooBarSpecificRecord (apparently unused, no schema definition available).

Notes:
It turns out that making SpecificRecordBuilderBase a subclass of GenericRecordBuilder is fairly impractical.
Instead I added pure interfaces for generic record builders.
However, I am not happy with the name of these interface (IGenericRecordBuilder and IIndexedRecordBuilder). 

Tests are passing.

> SpecificRecord builders should share more functionality with GenericRecord builders
> -----------------------------------------------------------------------------------
>
>                 Key: AVRO-1443
>                 URL: https://issues.apache.org/jira/browse/AVRO-1443
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.5, 1.7.6
>            Reporter: Christophe Taton
>         Attachments: AVRO-1443.20140126-182111-0800.diff
>
>
> Ideally, wherever a generic record builder is expected, one should be able to supply a builder for a specific record.
> That could happen by making SpecificRecordBuilderBase (and SpecificErrorBuilderBase?) a subclass of GenericRecordBuilder.
> Since SpecificRecordBase implements GenericRecord, it should be possible with minimal effort.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)