You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2009/01/29 02:52:59 UTC

[jira] Resolved: (THRIFT-253) Enhance FieldMetaData

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

Bryan Duxbury resolved THRIFT-253.
----------------------------------

    Resolution: Fixed

OK, I made a few small edits (style), and moved the new test and build.xml changes to the right spots to play well with THRIFT-166. Committed.

> Enhance FieldMetaData
> ---------------------
>
>                 Key: THRIFT-253
>                 URL: https://issues.apache.org/jira/browse/THRIFT-253
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Piotr Kozikowski
>            Priority: Minor
>         Attachments: thrift-253-v1.patch, thrift-253-v2.patch, thrift-253-v3.patch, thrift-253-v4.patch, thrift-253-v5.patch
>
>
> Having more meta data would be useful in the FieldMetaData structure. Specifically, it should be enhanced to contain information about whether the field is a list, set, map, base type, or another thrift structure. If it's a container type, it should contain information about what types are in the container. For base types and other thrift structures, it should specify the type. There's many ways we could encode this information - here's a first proposal and I'm open to suggestions.The idea is to have a "FieldMetaData", which includes data about the field like field name, "required", "optional", etc. It also includes a "FieldValueMetaData" which would have a subclass for regular objects or for containers, which contain further meta data about the types within.
> // need a better name than "Necessity"
> enum Necessity {
>  REQUIRED, OPTIONAL, DEFAULT
> }
> interface FieldValueMetaData {
> }
> class FieldMetaData {
>  String fieldName;
>  Necessity necessity;
>  FieldValueMetaData valueMetaData;
> }
> class ListFieldMetaData implements FieldValueMetaData {
>  FieldValueMetaData type;
> }
> class SetFieldMetaData implements FieldValueMetaData {
>   FieldValueMetaData type;
> }
> class MapFieldMetaData implements FieldValueMetaData {
>  FieldValueMetaData keyType;
>  FieldValueMetaData valueType;
> }
> class ObjectFieldMetaData implements FieldValueMetaData {
>  Class type;
> }
>   
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.