Using TaggedFieldSerializer ( or any other to mantain backwards compatibility )

94 views
Skip to first unread message

Aldo Bucchi

unread,
Jul 25, 2014, 3:51:29 AM7/25/14
to chill...@googlegroups.com
Hi,

Is it possible to use TaggedFieldSerializer or CompatibleFieldSerializer with Chill?
I am storing some objects long term and we will be adding fields to the classes ( not removing or chancing types ).
Any other idea on how to handle this is more than welcome ;)

Thanks!
A



Brian KimJohnson

unread,
Jan 2, 2015, 3:30:09 PM1/2/15
to chill...@googlegroups.com
Greetings,

I am also looking for information about how to change the default serializer to CompatibleFieldSerializer.  Any examples or pointers would be appreciated.


Brian

ilca...@gmail.com

unread,
Sep 17, 2015, 9:50:04 AM9/17/15
to chill-user
You have to use scala meta annotations so that the @Tag is in the resulting field and not in the constructor param

case class Person(@(Tag @field)(1) name: String, @(Tag @field)(2) age: Int)

and register the serializer

kryo.register(classOf[Person], new TaggedFieldSerializer(kryo, classOf[Person]))

john.su...@dowjones.com

unread,
Oct 21, 2015, 3:13:43 PM10/21/15
to chill-user
This is working for me right now:

  kryo.setDefaultSerializer(classOf[CompatibleFieldSerializer[_]])


I know your query has been around for a while. Hope this helps anyway. Best, John

Reply all
Reply to author
Forward
0 new messages