You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Anand Hegde <an...@gmail.com> on 2012/06/11 14:03:48 UTC

Thrift serialization compression

I am using the thrift ruby gem and am doing the following

serializer = Thrift::Serializer.new()

                binary_string=serializer.serialize(my_thrift_obj)

and I am storing this binary_string in a file, but I noticed there is no
compression at all. Is there any way I can compress my_thrift_obj while
serializing?

Also, is there a way to serialize arbitrary ruby hashes to thrift objects?

Re: Thrift serialization compression

Posted by Bryan Duxbury <br...@gmail.com>.
Some Thrift languages support compressed transports. However, Serializer is
just for getting the raw bytes. You are free to use any other compression
algo you'd like on your serialized objects, though.

There is no way to thrift-serialize arbitrary Ruby objects or hashes.
Thrift is big on schema.

On Mon, Jun 11, 2012 at 5:03 AM, Anand Hegde <an...@gmail.com> wrote:

> I am using the thrift ruby gem and am doing the following
>
> serializer = Thrift::Serializer.new()
>
>                binary_string=serializer.serialize(my_thrift_obj)
>
> and I am storing this binary_string in a file, but I noticed there is no
> compression at all. Is there any way I can compress my_thrift_obj while
> serializing?
>
> Also, is there a way to serialize arbitrary ruby hashes to thrift objects?
>