[
https://issues.apache.org/jira/browse/THRIFT-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736985#action_12736985
]
David Reiss commented on THRIFT-144:
------------------------------------
Not sure if you would be interested in using this helper class
<http://commons.apache.org/lang/api-release/index.html>. Probably much less
important than the hash version, but I figured I'd throw it out there anyway.
> Generated classes should implement Comparable
> ---------------------------------------------
>
> Key: THRIFT-144
> URL: https://issues.apache.org/jira/browse/THRIFT-144
> Project: Thrift
> Issue Type: New Feature
> Components: Compiler (Java)
> Reporter: Bryan Duxbury
> Assignee: Bryan Duxbury
> Priority: Minor
> Fix For: 0.2
>
> Attachments: thrift-144.patch
>
>
> We use our Thrift types in Hadoop map/reduce, sometimes as keys. As such,
> they need to be compared to other keys to be sorted. Right now, the only way
> to compare two Thrift objects is to serialize them and do byte comparison.
> It'd be nice if we could compare two objects directly.
> The implementation of such a compareTo would look a lot like the equals()
> implementation already present, and delegate to the subtypes' compareTo
> methods appropriately. The ordering of the field declarations in the .thrift
> file would indicate the sort order between fields. In some situations this
> would make the sorting somewhat arbitrary, but it would be stable, and if you
> really needed the sorting to take into account fields in a specific order,
> you could order your fields appropriately.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.