[
https://issues.apache.org/jira/browse/FLINK-15436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17005903#comment-17005903
]
Yun Tang commented on FLINK-15436:
----------------------------------
[~xiemeilong], I still cannot get your points and try to give my understanding
of your request below:
Previously, you have declared a class named as {{PojoClass1}}:
{code:java}
public Class PojoClass1{
public long field1;
public int field2;
}
{code}
Currently, you want to update the field to a new {{PojoClass1}} in which the
{{field3}} is the newly-added transient filed:
{code:java}
public Class PojoClass1{
public long field1;
public int field2;
public transient field3;
}
{code}
First of all, I don't understand why we need to declare a transient field
explicitly in state class. Because when you deserialize the class every time,
the transient field would be set as default value for its type, as [defined by
Java|https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html].
If you just want to add a field, [state
evolution|https://ci.apache.org/projects/flink/flink-docs-stable/dev/stream/state/schema_evolution.html]
or [state processor
API|https://ci.apache.org/projects/flink/flink-docs-stable/dev/libs/state_processor_api.html]
could be a nice choice.
Last but not least, a hook when state recovery might not be a clear concept.
The time to deserialize class for heap-based state backend and out-of-core
state backend (e.g. RocksDB) is different, you can refer to [this
slide|https://www.slideshare.net/FlinkForward/flink-forward-berlin-2018-tzuli-gordon-tai-upgrading-apache-flink-applications-state-of-the-union]
for more details.
> Add a hook of deserialized for pojo state object.
> ---------------------------------------------------
>
> Key: FLINK-15436
> URL: https://issues.apache.org/jira/browse/FLINK-15436
> Project: Flink
> Issue Type: Wish
> Components: API / Type Serialization System
> Reporter: xiemeilong
> Priority: Major
>
> I need to do some recovery work when state deserialized back, for example , I
> want to construct a not serializable object to do some custom logic depends
> on the state and only update it on the state updated.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)