The exception thrown is as follows. I realize that it is trying to read the
long value. How do I signal to kryo that it is OK and that he object can
have a default value

Caused by: java.io.EOFException: No more bytes left.
    at org.apache.flink.api.java.typeutils.runtime.NoFetchingInput.require(
NoFetchingInput.java:80)
    at com.esotericsoftware.kryo.io.Input.readVarLong(Input.java:690)
    at com.esotericsoftware.kryo.io.Input.readLong(Input.java:685)
    at com.esotericsoftware.kryo.serializers.
DefaultSerializers$LongSerializer.read(DefaultSerializers.java:133)
    at com.esotericsoftware.kryo.serializers.
DefaultSerializers$LongSerializer.read(DefaultSerializers.java:123)
    at com.esotericsoftware.kryo.Kryo.readObjectOrNull(Kryo.java:730)
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField
.java:113)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.read(
FieldSerializer.java:528)
    at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:761)
    at org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer
.deserialize(KryoSerializer.java:354)
    at org.apache.flink.api.common.typeutils.CompositeSerializer
.deserialize(CompositeSerializer.java:156)
    at org.apache.flink.contrib.streaming.state.RocksDBValueState.value(
RocksDBValueState.java:89)

On Thu, Sep 15, 2022 at 7:10 PM Vishal Santoshi <vishal.santo...@gmail.com>
wrote:

> << How do I make sure that when reconstituting the state, kryo does not
> complain? It tries to map the previous state to the new definition of Class
> A and complains that it cannot read the value for `String b`.
>
> >> How do I make sure that when reconstituting the state, kryo does not
> complain? It tries to map the previous state to the new definition of Class
> A and complains that it cannot read the value for `long b`.
>
> Sorry a typo
>
>
> On Thu, Sep 15, 2022 at 7:04 PM Vishal Santoshi <vishal.santo...@gmail.com>
> wrote:
>
>> I have state in rocksDB that represents say
>>
>> class A {
>>   String a
>> }
>>
>> I now change my class and add another variable
>>
>>
>> Class A {
>>   String a;
>>   long b = 0;
>> }
>>
>> How do I make sure that when reconstituting the state, kryo does not
>> complain? It tries to map the previous state to the new definition of Class
>> A and complains that it cannot read the value for `String b`.
>>
>> Unfortunately the state is not using POJO serializer.
>>
>> Thanks and Regards.
>>
>> Vishal
>>
>>
>>
>>
>>

Reply via email to