60-008-024-使用-命令-flink如何动态支持依赖jar包提交

1.视界

在这里插入图片描述

2.概述

​ 通常我们在编写一个flink的作业的时候,肯定会有依赖的jar包。flink官方希望你将所有的依赖和业务逻辑打成一个fat jar,这样方便提交,因为flink认为你应该对自己的业务逻辑做好单元测试,而不应该把这部分测试工作频繁提交到集群去做。但事实是我们往往不愿意打一个fat jar,我们希望将业务逻辑独立出来,依赖动态提交。可惜的是,flink并不支持这种提交模式。

flink官方的文档中提供了-C这个选项,来支持提交classpath,我们当时以为这个会有作用,后来再研读源码和实际测试的情况看来,不行,-C不是这么用的。

	-C,--classpath , Adds a URL to each user code classloader on all nodes in the cluster. 
	The paths must specify a protocol (e.g. file://) and be accessible on all nodes (e.g. 
	by means of a NFS share). You can use this option multiple times for specifying more than 
	one URL. The protocol must be supported by the {@link

​ 如上,是flink官

猜你喜欢

转载自blog.csdn.net/qq_21383435/article/details/104814432