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

Tristan Stevens commented on AVRO-1413:
---------------------------------------

Good shout - confusing my languages there...

I think there should be a way of getting at the schema for any given 
SpecificRecord without having to instantiate it (and ideally without faffing 
about with reflection - which of course is do-able).

Perhaps instead the schema should be made available from an instance of the 
builder - at the moment it is protected in RecordBuilderBase but a public 
accessor could be put on to there to allow someone to query the schema:

public Schema getSchema() { return schema; }

Similarly, should the builder provide a way of obtaining the class of the type 
of Records that it is able to build? something along the lines of in 
RecordBuilderBase:

public Class getRecordClass() { return T.class);

> Provide static abstract getClassSchema on SpecificRecordBase (as per 
> AVRO-1223)
> -------------------------------------------------------------------------------
>
>                 Key: AVRO-1413
>                 URL: https://issues.apache.org/jira/browse/AVRO-1413
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.5
>            Reporter: Tristan Stevens
>            Priority: Trivial
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> AVRO-1223 added support for static getClassSchema() to generated Record 
> classes, this should be added to the abstract superclass SpecificRecordBase 
> and also to the interface SpecificRecord in order to enable this method to be 
> used on any generated Records.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to