You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Nathan Leung <nc...@gmail.com> on 2014/03/02 01:50:32 UTC

Serializing Maps other than HashMap

Hi,

I noticed on the page about serialization (
https://github.com/nathanmarz/storm/wiki/Serialization) that storm only
registers HashMap and HashSet for serialization with Kryo.  The reason I
noticed is I noticed that in some cases when I have a class that contains a
member of type Map, storm defaults to Java serialization.  When I changed
the class member type to HashMap, it uses Kryo.  However, I'd prefer to
keep it as Map so that the member field is not as specific.  In order to
keep this as a Map (and use Kryo instead of java serialization), do I need
to register a custom serializer for the Map interface?

Thanks,
Nathan

Re: Serializing Maps other than HashMap

Posted by Nathan Leung <nc...@gmail.com>.
Hi Richards,

Thanks for the tip. I was actually planning on doing that as well. I read
more on kryo and found that it does not support registering a super type or
interface, so it makes sense that there is no serializer registered for the
map interface.

-Nathan
On Mar 2, 2014 2:50 AM, "Richards Peter" <hb...@gmail.com> wrote:

> Could you do some testing by disabling fallback to java serialization.
> There is a property in storm config object or map through which you can
> disable fallback to java serialization.
>
> This exercise will let you know what all classes need to be registered for
> kryo serialization. I also faced a similar issue in my project due to
> fallback to java serialization. At that time this exercise gave me the
> right directions to proceed.
>
> Richards Peter
>

Re: Serializing Maps other than HashMap

Posted by Richards Peter <hb...@gmail.com>.
Could you do some testing by disabling fallback to java serialization.
There is a property in storm config object or map through which you can
disable fallback to java serialization.

This exercise will let you know what all classes need to be registered for
kryo serialization. I also faced a similar issue in my project due to
fallback to java serialization. At that time this exercise gave me the
right directions to proceed.

Richards Peter