您好,具体设置如下:
public static final MapStateDescriptor quantityJudgeStateDescriptor = new
MapStateDescriptor<>(
"quantityJudgeMapState",
String.class,
Integer.class);
mistakeUpgradeRuleState =
getRuntimeContext().getMapState(Descriptors.quantityJudgeStateDescriptor);
// 设置状态TTL为 1天
StateTtlConfig stateTtlConfig = StateTtlConfig.newBuilder(Time.days(1)).build();
Descriptors.quantityJudgeStateDescriptor.enableTimeToLive(stateTtlConfig);
| |
Jason_H
|
|
[email protected]
|
---- 回复的原邮件 ----
| 发件人 | Hangxiang Yu<[email protected]> |
| 发送日期 | 2022年8月24日 13:12 |
| 收件人 | <[email protected]> |
| 主题 | Re: flink自动重启出错 |
是DS作业吗?可以share下使用state的部分吗?
On Sat, Aug 20, 2022 at 3:35 PM Jason_H <[email protected]> wrote:
您好,改过任务,但是 是以新的任务启动的,改动很大,并不依赖之前老的任务
| |
Jason_H
|
|
[email protected]
|
---- 回复的原邮件 ----
| 发件人 | Michael Ran<[email protected]> |
| 发送日期 | 2022年8月20日 15:31 |
| 收件人 | [email protected]<[email protected]> |
| 主题 | 回复:flink自动重启出错 |
改过任务吗?
| |
[email protected]
|
|
邮箱:[email protected]
|
---- 回复的原邮件 ----
| 发件人 | Jason_H<[email protected]> |
| 日期 | 2022年08月19日 11:52 |
| 收件人 | flink中文邮件组<[email protected]> |
| 抄送至 | |
| 主题 | flink自动重启出错 |
cause by: java.lang.RuntimeException: Error while getting state
org.apache.flink.util.StateMigrationException: For heap backends, the new
state serializer must not be incompatible with the old state serializer
大家好,我最近遇到一个很奇怪的问题,我的作业自动重启的时候报这个错,我上网查了一下,说是状态不兼容,但是我的作业都是新的作业启动的,没有根据之前的ck恢复,然后跑一段时间就报这个错,它是自动重启的时候,就报这个错了,这个有遇到过吗?有没有什么解决办法?
强调:作业是新的,没有基于之前的作业的ck进行重启。
| |
Jason_H
|
|
[email protected]
|
--
Best,
Hangxiang.