在路线图上演进 TTL? [英] Evolving TTL On The Roadmap?

查看:30
本文介绍了在路线图上演进 TTL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Flink 1.8 版引入了对进化状态模式的支持.我的问题是 Flink 是否会引入对进化时间(TTL)状态的支持.现在,您无法将 TTL 添加到未配置 TTL 的现有状态并期望能够恢复状态.我很好奇 Flink 未来是否打算开放这种可能性?我现在看到的唯一解决方法是在我的所有状态上启用 TTL,然后只设置到期时间,这样一些令人难以置信的高值让我可以灵活地在以后使用 TTL 功能,如果我仍然对它感兴趣的话.当然,到期时间基于有意义的业务逻辑,而不仅仅是一些极高的数字.

Flink version 1.8 introduced the support for evolving state schema. My question is will Flink introduce support of evolving time to live (TTL) to state. Right now you can't add TTL to an existing state not configured with TTL and expect to be able to restore state. I'm curious if Flink intends to open this possibility up in the future? The only work around I see might now is to enable TTL on all my state and then just set the expiration so something unbelievable high which gives me the flexibility to use the TTL features later down the line if I am still interested in it. Of course with a expiration that is based on meaningful business logic and not just some extremely high number.

生存时间来源:https://ci.apache.org/projects/flink/flink-docs-stable/dev/stream/state/state.html#state-time-to-live-ttl

进化状态模式来源:https://ci.apache.org/projects/flink/flink-docs-stable/dev/stream/state/schema_evolution.html

推荐答案

我不记得在邮件列表中对此有任何讨论,也找不到关于此主题的任何 JIRA 票证.

I can't recall any discussion of this on the mailing lists, nor can I find any JIRA tickets on this topic.

您提出的解决方法并不理想,因为您将支付状态 TTL 的成本(包括定时器空间和检查过期状态的处理工作),但收益甚微.

The workaround you've proposed isn't ideal, because you will pay the cost for state TTL (both the space for the timers and the processing effort of checking for expired state), with little benefit.

您可能会做的是使用 State Processor API 将您的数据迁移到新的状态描述符.您可以使用现有的状态描述符从状态快照(保存点或检查点)读取数据,然后使用更新的状态描述符将状态写入新的保存点.

What you might do instead is to use the State Processor API to migrate your data to new state descriptors. You would use the existing state descriptor to read the data from a state snapshot (savepoint or checkpoint), and then use an updated state descriptor to write the state out to a new savepoint.

这篇关于在路线图上演进 TTL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆