且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Flink 中加载外部 jars

更新时间:2022-04-20 23:00:13

你可以用你的内部代码/逻辑创建一个最小的 jar,并确保你依赖的所有 jar 在 /lib 中可用 文件夹(根据 Arthur 的建议).这将导致从 JobManager 获取 jar 的时间最短.此 Flink 文档 说应该可以(在某些情况下)避免加载任何动态 jar,但我从未尝试过.

You can create a minimal jar with just your internal code/logic, and ensure that all of the jars you depend on are available in the /lib folder (as per Arthur's suggestion). That will result in minimal time fetching the jar from the JobManager. This Flink documentation says it should be possible (in some situations) to avoid having to load any dynamic jars, but I've never tried that.