Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # user >> Could specific records implement the generic API as well?


Copy link to this message
-
Re: Could specific records implement the generic API as well?
On Mon, Apr 15, 2013 at 12:46 PM, Scott Carey <[EMAIL PROTECTED]> wrote:

> Which aspect of the generic API are you most interested in?  The builder,
> getters, or setters?
>
Most people that use Specific records do so for compile time type safety,
> so adding 'set("foo", fooval)' is not desired for those users.   On the
> other hand it is certainly possible to add it.
>

I am interested in getters and setters at first.
For now, any code that intends to work with both generic and specific
record must use the IndexedRecord (and implement the accessors Doug
mentioned).
It would be useful in some cases to be able to consider specific records as
generic records too.

Now that you mention it too, I realize I also needed to use specific record
builders as generic record builders and could not, so that would be useful
too.

If you think it's a meaningful addition, I'm happy to make the change.

C.
> The code generated by the specific code generation utility uses templates,
> one can add a template that extends what is produced to include generic API
> bits.
>
> -Scott
>
> On 4/15/13 11:23 AM, "Christophe Taton" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> Is there a reason for specific records to not implement the generic API?
> I didn't find any obvious technical reason, but maybe I missed something.
> Thanks,
> C.
>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB