Hi all! Currently using flink version 1.19.1 and I...
# troubleshooting
h
Hi all! Currently using flink version 1.19.1 and I'm working on replacing the deprecated method
registerTypeWithKryoSerializer
for protobuf serializers, and as said in the documentation: _`Register data types and serializers through hard codes is deprecated, because you need to modify the codes when upgrading job version. Instance-type serializer definition where serializers are serialized and written into the snapshot and deserialized for use is deprecated as well. Use class-type serializer definition by PipelineOptions.SERIALIZATION_CONFIG instead, where only the class name is written into the snapshot and new instance of the serializer is created for use.`_ so I did the following:
Copy code
val serializers = listOf(
            "com.example.MyClass: {type: kryo, kryo-type: registered, class: com.twitter.chill.protobuf.ProtobufSerializer}"
        )
executionConfig.toConfiguration().set(PipelineOptions.SERIALIZATION_CONFIG, serializer)
but then I get the following problem with a list present in the protobuf model:
Copy code
Caused by: java.lang.UnsupportedOperationException
at java.util.Collections$UnmodifiableCollection.add(Unknown Source) ~[?:?]
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109) ~[flink-dist-1.19.1.jar:1.19.1]
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:22) ~[flink-dist-1.19.1.jar:1.19.1]
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:679) ~[flink-dist-1.19.1.jar:1.19.1]
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:106) ~[flink-dist-1.19.1.jar:1.19.1]
Notes: • Already tried adding a default serializer for UnmodifiableCollection like:
Copy code
java.util.Collections$UnmodifiableCollection: {type: kryo, kryo-type: registered, class: de.javakaffee.kryoserializers.UnmodifiableCollectionsSerializer}
• With
registerTypeWithKryoSerializer
everything is working correctly Any ideas? Thanks for the help!