问题描述
我想确切地知道
水印值什么时候设为
Long.MaxValue
?(取消 SourceFunction 时?通过 cli 和网络面板取消作业?...)
When will watermark value be set as
Long.MaxValue
? (On canceling a SourceFunction? Cancel a job through cli & web-panel? ... )
这对应用程序意味着什么?(工作结束?工作失败?没有重新/开始?)
What does it means for an application? (End of the job? Job failure? with no re/start?)
又该如何处理呢?(清除所有状态?计时器呢?正如我所见,在此状态下注册一个新计时器将使应用程序永远运行!如果我应该能够在最后一个水印中保留一个状态以便在以后的时间/运行中恢复,我应该如何保持计时器状态?)
And how should it be handled? (clearing all the states? what about timers? As I saw registering a new timer on this state will make application to run forever! If I should be able to persist a state in last-watermark to recover from it in later time/run, how I should persist a timer-state?)
推荐答案
当您的 SourceFunction
退出 run
方法时,会发出最后一个水印,这意味着您已经消耗了所有输入.
The last watermark is emitted when your SourceFunction
exits the run
method and it means you have consumed all input.
鉴于此,您不需要清除,因为一旦水印到达所有接收器,作业将被标记为已完成.
Given this you should not need to clear as the job will be marked as finished once the watermark reaches all sinks.
这篇关于Apache Flink:什么时候会触发最后一个水印(通过“Long.MaxValue"值)?以及应该如何处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!