FLINK-通过REST API提交Flink作业时如何传递自定义参数

发布于 2025-02-12 00:31:45 字数 529 浏览 1 评论 0原文

我需要在Flink作业中提供一个解密的密码,以将其连接到Redis。但是,Redis密码只能在本地机器上解密。因此,我的计划是首先在本地解密,然后在通过REST API提交工作时尝试将其传递给Flink。 (我不允许将解密的密码写入属性文件。)

这是可能的吗?我注意到我可以在 programargs programargslist 监视/rest_api.html#jars-jarid-run“ rel =“ nofollow noreferrer”> json post request 。但是,我找不到在程序中访问这些参数的任何方法。

我已经检查了streamExecutionEnvironment.getExecutionEnvironment()。getConfig(),但是参数并未保存在那里。

有什么方法可以访问我在作业中提交的参数?还是有更好的方法可以实现相同的目标?

I need to provide a decrypted password in a Flink job to connect it to redis. But the redis password can only be decrypted on a local machine. So my plan is to decrypt it locally first and then try to pass it to Flink when submitting the job through REST API. (I'm not allowed to write the decrypted password to the properties file.)

Is this possible? I noticed that I can specify programArgs and programArgsList in the JSON POST request. However, I'm not finding any means to access these parameters inside my program.

I have checked StreamExecutionEnvironment.getExecutionEnvironment().getConfig(), but the parameters are not saved there.

Is there any way to access the parameters which I submitted with the job? Or are there better ways to achieve the same goal?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只有一腔孤勇 2025-02-19 00:31:45

它们是Java程序参数:

public static void main (String[] args) {

}

您将在args数组中将它们放在。该文档在此处提到: https://nightlies.apache.org/flink/flink/flink-docs-stable/docs/dev/datastream/application_parameters/#from-the-from-the-command-line-line-line-arguments

They are Java program arguments:

public static void main (String[] args) {

}

You'll have them in the args array. The documentation mentions it in here: https://nightlies.apache.org/flink/flink-docs-stable/docs/dev/datastream/application_parameters/#from-the-command-line-arguments

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文