I need to change the class by adding two new parameters. This class is serialized with Kryo. I currently save information related to this class, among other things, like RDD, every time I stop my thread. When I restart the stream, I load the previously saved information and use it to have consistency between when I stopped and when I restart.
Since the class I persist in need of these new parameters, I changed the class and the serializer, adding new kryo.writeObject(output, object, ObjectSerializer)and kryo.readObject(input, classOf[Object], ObjectSerializer)new parameters.
Now, when I restart my thread, I get an exception: "Discovered unregistered class ...".
This seems obvious because I'm trying to deserialize an object that is not contained in the information that I saved when I stopped the thread. If I delete this data and start the stream, as if it did not have a previous run, an exception will not occur.
Is there any way to avoid this exception? Maybe specifying some default values ββin the absence of these parameters?
thank
EDIT:
I found something useful that I had not seen before:
the Kryo 194 problem .
This guy implemented the version by simply inserting a long definition of which version of the deserializer he should use. This is a simple solution, but since the company that wrote the code I'm working on did not think about advanced compatibility, I think I will have to throw out all the data that was saved before the new serializer in the window.
, , .
2:
- .
CompatibleFieldSerializer, : CompatibleFieldSerializer
, , , .
, java.lang.NullPointerException.
- , . , , , .
- .