Flink Statefun引导和状态过期

huangapple go评论58阅读模式
英文:

Flink Statefun Bootstrap and State expiration

问题

根据此页面,在使用 Flink Statefun v2.1.0 时,我们可以为状态设置 TTL。

我们还可以根据此页面来引导状态。

第一个问题是,引导文档中完全没有提到状态过期。在具有TTL的状态上执行引导的正确方法是什么?有没有示例可供参考?

第二个问题是,如果我将某些状态设置为在写入后的1天内过期,然后使用6个月的数据对该状态进行引导,会发生什么?

整个引导状态是否会在真正的1天后过期?

如果是这样的话,我该怎么做才能在1天后使其过期,而只保留1天的数据?

英文:

According to this page we have the ability to set TTL for state when using Flink Statefun v2.1.0.

We also have the ability to bootstrap state, according to this page.

First question is, bootstrap documentation does not mention state expiration at all. What is the correct way to do bootstrapping on states that have TTL? Can someone point me to an example?

The second question is, what happens if I set some state as expire after writing in 1 day and then bootstrap that state using 6 months worth data?

Is the whole bootstrapped state going to expire after literally 1 day?

If so, what can I do to have it expire 1 day worth of data after 1 day passes?

答案1

得分: 0

是的,如果自从加载数据以来数据没有被修改,那么所有数据将在一天后被删除。

为了每天过期一天的数据:在引导状态后,您可以发送一个延迟消息给自己,设定在一天后发送。当它到达时,删除最旧的数据并发送另一个延迟消息。

英文:

Yes, if that data hasn't been modified since it was loaded, it will all be deleted after one day.

To expire one day's worth of data every day: After bootstrapping the state, you could send yourself a delayed message, set to be delivered one day later. When it arrives, delete the oldest data and send another delayed message.

huangapple
  • 本文由 发表于 2020年7月25日 01:16:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/63078427.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定