0

I'm currently developing a stream processing application, one of the functionality is to take events that happen in the time zone [time of submitting the job, time of submitting the job + T ].

how can access to that particular variable (time of submitting the job) with stream processing APIs in Flink?

Thank you.

4

1 回答 1

1

一种可能的方法是使用 Flink 的ParameterTool

https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/best_practices.html#getting-your-configuration-values-into-the-parametertool

ParameterTool parameters = ParameterTool.fromArgs(args);

// set up the execution environment
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.getConfig().setGlobalJobParameters(parameters);

您可以通过 CLI 参数传递时间戳,也可以简单地在 java 代码中获取系统时间。有了GlobalJobParameters,您可以通过 . 访问任何运营商中的时间context

于 2020-05-25T07:55:31.720 回答