thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Duxbury <br...@rapleaf.com>
Subject Re: [thrift] Serialization
Date Fri, 06 Jun 2008 20:04:04 GMT
If you need to store heterogeneous collections of items, as you  
probably would like to in a distributed hashmap, you should just make  
the type of stored objects binary, and then handle the serialization/ 
deserialization at the application level. This will make your hashmap  
implementation very general and simple, too.

-Bryan

On Jun 6, 2008, at 11:51 AM, Johan Stuyts wrote:

> Hi Marcus,
>
> I am moving this discussion to the Thrift user list at Apache  
> (incubator), because this list will be closed in the future. You  
> can join this list by sending an e-mail with subject  
> 'subscribe' (without the quotes) to:
> thrift-user-request@incubator.apache.org
>
>> The nature of a hashmap is that it stores objects which could be  
>> typed (or
>> not) so the "normal" way of doing this is to just use plain Java
>> serialization when you need to distribute the objects.
>>
>> I fear that the objects must be strongly typed and defined as  
>> structs right?
>
> Correct. And Thrift only supports homogenous collections, i.e. it  
> is not possible to put different types, or even subclasses of types  
> in a container. This limitation is there to allow protocols to send  
> only minimal information across the wire, unlike for example Java  
> serialization which always includes all metadata.
>
> -- 
> Kind regards,
>
> Johan Stuyts


Mime
View raw message