You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Cyrus Katrak (JIRA)" <ji...@apache.org> on 2009/09/23 01:17:16 UTC
[jira] Created: (THRIFT-589) Add Field Name to Field ID Mapping
Add Field Name to Field ID Mapping
----------------------------------
Key: THRIFT-589
URL: https://issues.apache.org/jira/browse/THRIFT-589
Project: Thrift
Issue Type: Improvement
Components: Compiler (Java)
Affects Versions: 0.2
Reporter: Cyrus Katrak
Attachments: thrift589.patch
The reflection stuff in java thrift is quite useful, but to use it you must know the field id (not the name) of the field you are working with.
Given a field name, you can obtain the corresponding ID by iterating through the metaDataMap, but it's not ideal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (THRIFT-589) Add Field Name to Field ID Mapping
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury resolved THRIFT-589.
----------------------------------
Resolution: Fixed
Fix Version/s: 0.2
Assignee: Cyrus Katrak
I just committed this. Thanks for the patch, Cyrus!
> Add Field Name to Field ID Mapping
> ----------------------------------
>
> Key: THRIFT-589
> URL: https://issues.apache.org/jira/browse/THRIFT-589
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (Java)
> Affects Versions: 0.2
> Reporter: Cyrus Katrak
> Assignee: Cyrus Katrak
> Fix For: 0.2
>
> Attachments: thrift589-2.patch, thrift589-3.patch, thrift589.patch
>
>
> The reflection stuff in java thrift is quite useful, but to use it you must know the field id (not the name) of the field you are working with.
> Given a field name, you can obtain the corresponding ID by iterating through the metaDataMap, but it's not ideal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-589) Add Field Name to Field ID Mapping
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761620#action_12761620 ]
Bryan Duxbury commented on THRIFT-589:
--------------------------------------
This generally looks pretty good. I would like to see you generate the map with the FIELD_NAME constants instead of the ids directly, though.
> Add Field Name to Field ID Mapping
> ----------------------------------
>
> Key: THRIFT-589
> URL: https://issues.apache.org/jira/browse/THRIFT-589
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (Java)
> Affects Versions: 0.2
> Reporter: Cyrus Katrak
> Attachments: thrift589-2.patch, thrift589.patch
>
>
> The reflection stuff in java thrift is quite useful, but to use it you must know the field id (not the name) of the field you are working with.
> Given a field name, you can obtain the corresponding ID by iterating through the metaDataMap, but it's not ideal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-589) Add Field Name to Field ID Mapping
Posted by "Cyrus Katrak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cyrus Katrak updated THRIFT-589:
--------------------------------
Attachment: thrift589.patch
> Add Field Name to Field ID Mapping
> ----------------------------------
>
> Key: THRIFT-589
> URL: https://issues.apache.org/jira/browse/THRIFT-589
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (Java)
> Affects Versions: 0.2
> Reporter: Cyrus Katrak
> Attachments: thrift589.patch
>
>
> The reflection stuff in java thrift is quite useful, but to use it you must know the field id (not the name) of the field you are working with.
> Given a field name, you can obtain the corresponding ID by iterating through the metaDataMap, but it's not ideal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-589) Add Field Name to Field ID Mapping
Posted by "Cyrus Katrak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cyrus Katrak updated THRIFT-589:
--------------------------------
Newest patch adds tests.
compile:
[javac] Compiling 54 source files to /home/yellowcake/co/thrift/lib/java/build
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
dist:
[mkdir] Created dir: /home/yellowcake/co/thrift/lib/java/build/META-INF
[copy] Copying 1 file to /home/yellowcake/co/thrift/lib/java/build/META-INF
[copy] Copying 1 file to /home/yellowcake/co/thrift/lib/java/build/META-INF
[jar] Building jar: /home/yellowcake/co/thrift/lib/java/libthrift.jar
compile-test:
[javac] Compiling 45 source files to /home/yellowcake/co/thrift/lib/java/build/test
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] Compiling 1 source file to /home/yellowcake/co/thrift/lib/java/build/test
[javac] Note: /home/yellowcake/co/thrift/lib/java/gen-javabean/thrift/test/OneOfEachBeans.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] Compiling 17 source files to /home/yellowcake/co/thrift/lib/java/build/test
test:
[java] In JSON Proto test
[java] Writing ooe
[java] Reading ooe
[java] Comparing ooe
[java] Writing hm
[java] Reading hm
[java] Comparing hm
[java] Writing base
[java] Reading base
[java] Comparing base
[java] Size in compact protocol: 116
[java] Size in compact protocol: 145
[java] Size in compact protocol: 331
[java] Size in compact protocol: 625
[java] <TestUnion i32_field:25>
BUILD SUCCESSFUL
> Add Field Name to Field ID Mapping
> ----------------------------------
>
> Key: THRIFT-589
> URL: https://issues.apache.org/jira/browse/THRIFT-589
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (Java)
> Affects Versions: 0.2
> Reporter: Cyrus Katrak
> Attachments: thrift589-2.patch, thrift589.patch
>
>
> The reflection stuff in java thrift is quite useful, but to use it you must know the field id (not the name) of the field you are working with.
> Given a field name, you can obtain the corresponding ID by iterating through the metaDataMap, but it's not ideal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-589) Add Field Name to Field ID Mapping
Posted by "Cyrus Katrak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cyrus Katrak updated THRIFT-589:
--------------------------------
Patch taken against r817892
> Add Field Name to Field ID Mapping
> ----------------------------------
>
> Key: THRIFT-589
> URL: https://issues.apache.org/jira/browse/THRIFT-589
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (Java)
> Affects Versions: 0.2
> Reporter: Cyrus Katrak
> Attachments: thrift589.patch
>
>
> The reflection stuff in java thrift is quite useful, but to use it you must know the field id (not the name) of the field you are working with.
> Given a field name, you can obtain the corresponding ID by iterating through the metaDataMap, but it's not ideal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-589) Add Field Name to Field ID Mapping
Posted by "Cyrus Katrak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cyrus Katrak updated THRIFT-589:
--------------------------------
Attachment: thrift589-3.patch
> Add Field Name to Field ID Mapping
> ----------------------------------
>
> Key: THRIFT-589
> URL: https://issues.apache.org/jira/browse/THRIFT-589
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (Java)
> Affects Versions: 0.2
> Reporter: Cyrus Katrak
> Attachments: thrift589-2.patch, thrift589-3.patch, thrift589.patch
>
>
> The reflection stuff in java thrift is quite useful, but to use it you must know the field id (not the name) of the field you are working with.
> Given a field name, you can obtain the corresponding ID by iterating through the metaDataMap, but it's not ideal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-589) Add Field Name to Field ID Mapping
Posted by "Cyrus Katrak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cyrus Katrak updated THRIFT-589:
--------------------------------
Attachment: thrift589-2.patch
> Add Field Name to Field ID Mapping
> ----------------------------------
>
> Key: THRIFT-589
> URL: https://issues.apache.org/jira/browse/THRIFT-589
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (Java)
> Affects Versions: 0.2
> Reporter: Cyrus Katrak
> Attachments: thrift589-2.patch, thrift589.patch
>
>
> The reflection stuff in java thrift is quite useful, but to use it you must know the field id (not the name) of the field you are working with.
> Given a field name, you can obtain the corresponding ID by iterating through the metaDataMap, but it's not ideal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-589) Add Field Name to Field ID Mapping
Posted by "Cyrus Katrak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cyrus Katrak updated THRIFT-589:
--------------------------------
Changes made, now using the FIELD_NAME constants
test:
[java] In JSON Proto test
[java] Writing ooe
[java] Reading ooe
[java] Comparing ooe
[java] Writing hm
[java] Reading hm
[java] Comparing hm
[java] Writing base
[java] Reading base
[java] Comparing base
[java] Size in compact protocol: 116
[java] Size in compact protocol: 145
[java] Size in compact protocol: 331
[java] Size in compact protocol: 625
[java] <TestUnion i32_field:25>
BUILD SUCCESSFUL
> Add Field Name to Field ID Mapping
> ----------------------------------
>
> Key: THRIFT-589
> URL: https://issues.apache.org/jira/browse/THRIFT-589
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (Java)
> Affects Versions: 0.2
> Reporter: Cyrus Katrak
> Attachments: thrift589-2.patch, thrift589-3.patch, thrift589.patch
>
>
> The reflection stuff in java thrift is quite useful, but to use it you must know the field id (not the name) of the field you are working with.
> Given a field name, you can obtain the corresponding ID by iterating through the metaDataMap, but it's not ideal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.