[
https://issues.apache.org/jira/browse/THRIFT-122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexander Shigin updated THRIFT-122:
------------------------------------
Attachment: thrift-any-type.patch
I finally can show some working implementation of 'any' type for python and
C++. There is a huge additional work:
- use shared_ptr in C++ library;
- makes -Wall happy (gcc complains about unused *Register);
- make better any_cast for C++;
- make an any support for dense, debug and json protocols;
- add some documentation;
- extend test suite and make it a bit more beauty;
- implement any type for python's AcceleratedBinaryProtocol.
Here is a brief description of serialization of any:
- any : type-id data;
- if type-id is struct data consist of md5 fingerprint of structure and data of
the structure.
If you use child class of some auto generated thrift file, you can re-register
your class, so your class'll be deserialized and you don't need copy your data.
And the main problem: makes support for other languages. I think it's really
ease for ruby and perl (it only takes 123 lines for python), but I know nothing
about java and cocoa.
> Allow heterogeneous collections
> -------------------------------
>
> Key: THRIFT-122
> URL: https://issues.apache.org/jira/browse/THRIFT-122
> Project: Thrift
> Issue Type: New Feature
> Reporter: Noble Paul
> Attachments: thrift-any-type.patch
>
>
> 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.