[
https://issues.apache.org/jira/browse/THRIFT-122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624942#action_12624942
]
Noble Paul commented on THRIFT-122:
-----------------------------------
bq.I think it should be a structure instead of a map. This is safer, faster,
and easier to reason about.
I wish we had that flexibility. The data is enormous. Each RequestHandler
creates it's own set of data. We do not create custom structures because there
will be 100's of them . It is nearly impossible to manage that. Just to avoid
custom structures we resort to this trick. sometimes the value is another
collection type and so on and so forth. So every time a new value is added we
do not have to generate classes and compile them and update server and client
for so many different languages
Because every user knows what is the associated value for a name is , it all
works well. So with just one class (one class each for each language
php/ruby/json) we manage reading and writing of any data spit out by our
various request handlers. It is an interesting usecase but It is very
convenient and works well. And we actually use it in our organization also and
I have seen this in many places.
> Allow heterogeneous collections
> -------------------------------
>
> Key: THRIFT-122
> URL: https://issues.apache.org/jira/browse/THRIFT-122
> Project: Thrift
> Issue Type: New Feature
> Reporter: Noble Paul
>
> Currently thrift only supports homogeneous collections . But , that is very
> restrictive for many languages which allows heterogeneous collections. It
> does not have to be supported in BinaryProtocol The new DenseProtocol may add
> support for this
> implementation details
> the IDL can allow syntax
> {code}
> list<?>
> set<?>
> map<?,?>
> map<?,the-type>
> map<the-type,?>
> {code}
> While writing down data use a type modifier to say whether key (1), value(2)
> or both(3) are wild cards
> for a List/Set use a type modifier 1 to specify that it is heterogeneous
> If it is a homogeneous collection do it the way it is done now.
> Or else
> add type information just before the data. So it adds an extra byte/element
> For ma
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.