Flink流:如何控制执行时间 [英] Flink streaming: how to control the execution time

查看:194
本文介绍了Flink流:如何控制执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

火花流提供了用于终止awaitTermination()的API.在t秒钟后,是否有任何类似的API可以正常关闭flink流?

Spark streaming provides API for termination awaitTermination(). Is there any similar API available to gracefully shut down flink streaming after some t seconds?

推荐答案

在执行流作业时,Flink中的驱动程序(即main方法)不会保持运行.您的程序应定义一个数据流,调用execute,然后终止.在Spark中,驱动程序保持运行(AFAIK),并且awaitTermination与之相关.

Your driver program (i.e. the main method) in Flink doesn't stay running while the streaming job executes. Your program should define a dataflow, call execute, and then terminate. In Spark, the driver program stays running (AFAIK), and awaitTermination relates to that.

请注意,除非您使用带有有限数量元素的绑定"数据源,否则Flink流数据流将继续无限期执行.您还可以取消或停止工作,甚至在停止时设置检查点,以便以后恢复.

Note that a Flink streaming dataflow continues to execute indefinitely, unless you're using a 'bounded' data source with a finite number of elements. You may also cancel or stop a job, and even take a checkpoint upon stopping to be resumed from later.

这篇关于Flink流:如何控制执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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