Hi I have several implementations of my Model trait, trait Model { neither one of them are serializable, but are used in the state definition. So I implemented custom serializer import com.esotericsoftware.kryo.io.{Input, Output} And added the following // Add custom serializer To configure it. I can see checkpoint messages at the output console, but I never hist a break point in serializer. Any suggestions? |
Hello,
I assume you're passing the class of your serializer in a StateDescriptor constructor. If so, you could add a breakpoint in Statedescriptor#initializeSerializerUnlessSet, and check what typeInfo is created and which serializer is created as a result. One thing you could try right away is registering your serializer for the Model implementations, instead of the trait. Regards, Chesnay On 14.07.2017 15:50, Boris Lublinsky wrote:
|
Thanks for the reply, but I am not using it for managed state, but rather for the raw state In my implementation I have the following class DataProcessorKeyed extends CoProcessFunction[WineRecord, ModelToServe, Double]{ Where current and new model are instances of the trait for which I implement serializer According to documentation https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/stream/state.html#raw-and-managed-state “Raw State is state that operators keep in their own data structures. When checkpointed, they only write a sequence of bytes into the checkpoint. Flink knows nothing about the state’s data structures and sees only the raw bytes.” So I was assuming that I need to provide serializer for this. Am I missing something?
|
Raw state can only be used when
implementing an operator, not a function.
For functions you have to use Managed Operator State. Your function will have to implement the CheckpointedFunction interface, and create a ValueStateDescriptor that you register in initializeState. On 19.07.2017 15:28, Boris Lublinsky wrote:
|
Free forum by Nabble | Edit this page |