Hi :wave: I have protobuf models that generate jav...
# troubleshooting
h
Hi 👋 I have protobuf models that generate java classes, and after registering kryo serializer with the
com.twitter.chill.protobuf.ProtobufSerializer
, I'm still getting the following log:
Copy code
INFO  org.apache.flink.api.java.typeutils.TypeExtractor            [] - class com.org.example.MyOuterClass$MyClass does not contain a setter for field oneOfXXX_
INFO  org.apache.flink.api.java.typeutils.TypeExtractor            [] - Class class com.org.example.MyOuterClass$MyClass cannot be used as a POJO type because not all fields are valid POJO fields, and must be processed as GenericType. Please read the Flink documentation on "Data Types & Serialization" for details of the effect on performance and schema evolution.
Any ideas how can I get rid of these logs? Thanks in advance 🙇
l
Which version of Flink are you using? The Flink documentation lists what it expects for POJOs - you can first check to see if all of your types being used are following the expectations. The documentation also points out a test util class that could be used to validate that the classes you’re passing around aroud POJOs:
You can test whether your class adheres to the POJO requirements via
org.apache.flink.types.PojoTestUtils#assertSerializedAsPojo()
from the
flink-test-utils
. If you additionally want to ensure that no field of the POJO will be serialized with Kryo, use
assertSerializedAsPojoWithoutKryo()
instead.
h
I'm using 1.19.1 version
But since the classes are generated I cannot change it to be a POJO
l
But since the classes are generated I cannot change it to be a POJO
Do you use the generated classes to create events/messages that are processed by operators prior to being sent to the sink? If so, then maybe you can create a POJO for internal use in the app, and then map a message/event to the protobuf version when it is sent to the sink.
h
Hi, I did that where I only converted to the protobuf generated class on the sink but still getting those logs