was able to make it work with
adding a serializer

import de.javakaffee.kryoserializers.protobuf.ProtobufSerializer
environment.config.registerTypeWithKryoSerializer(EventMetaData::class.java,
ProtobufSerializer::class.java)

and then modifying the proto buff schema so it takes the nonlazy
implementation
repeated string redacted_field_something = 2[lazy=false];

And then when moving the mapping to the output class, transforming the list
to a mutable one so it doesn't fail with some of the methods that It calls

some.event.redacted_field_something.toMutableList()


On Wed, Aug 14, 2024 at 8:14 AM Sebastian Zapata <sebitaszapat...@gmail.com>
wrote:

> Hi everyone wanted to check if somebody else has found an issue like
> this?, and could maybe have some pointer or has encountered this before
>
> my kyro serializer is failing to serialize
> com.google.protobuf.UnmodifiableLazyStringList
>
> I am tyring to read a protobuf message with the data streaming API, but
> it's having issue serializing a class that has a field
> repeated string redacted_of_something = 2;
>
> serialization is being configure like this
> val environment = StreamExecutionEnvironment.getExecutionEnvironment()
> environment.config.enableForceAvro()
> val unmodColl =
> Class.forName("java.util.Collections\$UnmodifiableCollection")
> environment.config.addDefaultKryoSerializer(unmodColl,
> UnmodifiableCollectionsSerializer::class.java)
>
> When I don't send the problematic field (an array of strings), everything
> works fine, but when I do, the application fails. This is the stack
> trace.(attached)
> .....
> Caused by: java.lang.NullPointerException
> at
> com.google.protobuf.UnmodifiableLazyStringList.size(UnmodifiableLazyStringList.java:47)
>
>
> so far i have try defining custom serializer for my problematic proto buff
> generate classes with
> environment.config.registerTypeWithKryoSerializer(EventMetaData::class.java,
> JavaSerializer::class.java) , ProtobufSerializer
>
> inspecting the code i can see the UnmodifiableLazyStringList is the
> generate class for the repeated string redacted_of_something and doesn't
> have a parse method
>
> any idea aprreciate
>
>
>
>

Reply via email to