dianfu commented on a change in pull request #11768: [FLINK-16943][python]
Support set the configuration option "pipeline.jars" in PyFlink.
URL: https://github.com/apache/flink/pull/11768#discussion_r409497954
##########
File path: flink-python/pyflink/util/utils.py
##########
@@ -98,3 +98,30 @@ def is_local_deployment(j_configuration):
JDeploymentOptions = jvm.org.apache.flink.configuration.DeploymentOptions
return j_configuration.containsKey(JDeploymentOptions.TARGET.key()) \
and j_configuration.getString(JDeploymentOptions.TARGET.key(), None)
== "local"
+
+
+def add_jars_to_context_class_loader(jar_urls):
+ """
+ Add jars to Python gateway server for local compilation and local
execution (i.e. minicluster).
+ There are many component in Flink which won't be added to classpath by
default. e.g. Kafka
+ connector, JDBC connector, CSV format etc. This utility function can be
used to hot load the
+ jars.
+
+ :param jar_urls: The list of jar urls.
+ """
+ gateway = get_gateway()
+ # validate and normalize
+ jar_urls = [gateway.jvm.java.net.URL(url).toString() for url in jar_urls]
+ context_classloader =
gateway.jvm.Thread.currentThread().getContextClassLoader()
+ existed_urls = []
Review comment:
existing_urls
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services