0

I have an existing domain model which I would like not to change to work with Hazelcast. For this, I want to use StreamSerializer interface and Kryo. I have taken a look at https://github.com/hazelcast/hazelcast-book-examples/blob/master/chapter-serialization/kryo-serializer/src/main/java/PersonKryoSerializer.java example (or similar http://blog.hazelcast.com/2013/10/16/kryo-serializer/), but I wonder how to go ahead and add some more serializers for other classes.

Is it advisable to create a new StreamSerializer class, again with the ThreadLocal construct? This means, that again a new Kryo object will be created, is this ok? Or is it better to have only 1 Kryo object in the whole application?

Some of the classes do not have default constructors, how do I fit that in?

Wim Deblauwe
  • 25,113
  • 20
  • 133
  • 211

1 Answers1

0

I would go for creating a superclass holding the Kryo objects (and the thradlocal) and create a subclass per entity above it.

noctarius
  • 5,979
  • 19
  • 20