Guava immutable collection kryo serialization

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Guava immutable collection kryo serialization

Shaosu Liu

Hi,

How do I do Guava Immutable collections serialization in Flink?

I am getting errorĀ 

Caused by: java.io.NotSerializableException: de.javakaffee.kryoserializers.guava.ImmutableMapSerializer

when I register ImmutableMap to be serialized by the ImmutableMapSerializer. I am using the latest version of 0.38.

--
Cheers,
Shaosu
Reply | Threaded
Open this post in threaded view
|

Re: Guava immutable collection kryo serialization

Stefan Richter
Hi,

to answer this question, it would be helpful if you could provide the stacktrace of your exception and the code you use to register the serializer.

Best,
Stefan

Am 21.07.2016 um 05:28 schrieb Shaosu Liu <[hidden email]>:


Hi,

How do I do Guava Immutable collections serialization in Flink?

I am getting error 

Caused by: java.io.NotSerializableException: de.javakaffee.kryoserializers.guava.ImmutableMapSerializer

when I register ImmutableMap to be serialized by the ImmutableMapSerializer. I am using the latest version of 0.38.

--
Cheers,
Shaosu

Reply | Threaded
Open this post in threaded view
|

Re: Guava immutable collection kryo serialization

Stephan Ewen
Hi!

Custom Kryo Serializers can be shipped either as objects (must be serializable) or as classes (can be non serializable, must have a default constructor).

For non-serializable serializers, try to use: ExecutionConfig.registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass)

Stephan


On Thu, Jul 21, 2016 at 10:36 AM, Stefan Richter <[hidden email]> wrote:
Hi,

to answer this question, it would be helpful if you could provide the stacktrace of your exception and the code you use to register the serializer.

Best,
Stefan

Am 21.07.2016 um 05:28 schrieb Shaosu Liu <[hidden email]>:


Hi,

How do I do Guava Immutable collections serialization in Flink?

I am getting errorĀ 

Caused by: java.io.NotSerializableException: de.javakaffee.kryoserializers.guava.ImmutableMapSerializer

when I register ImmutableMap to be serialized by the ImmutableMapSerializer. I am using the latest version of 0.38.

--
Cheers,
Shaosu