HuangXingBo commented on a change in pull request #13292:
URL: https://github.com/apache/flink/pull/13292#discussion_r481066559



##########
File path: flink-python/pyflink/datastream/stream_execution_environment.py
##########
@@ -553,6 +553,29 @@ def set_python_executable(self, python_exec: str):
             .getEnvironmentConfig(self._j_stream_execution_environment)
         env_config.setString(jvm.PythonOptions.PYTHON_EXECUTABLE.key(), 
python_exec)
 
+    def add_jars(self, key: str, jars_path: str):
+        """
+        Adds the given jars path into the configuration of 
StreamExecutionEnvironment.
+
+        Note that users are able to configure two types of jars distinguished 
by key:
+            1. pipeline.jars:  A list of jar files that contain the 
user-defined function (UDF)
+               classes and all classes used from within the UDFs.
+            2. pipeline.classpaths: A list of URLs that are added to the 
classpath of each user code
+               classloader of the program. Paths must specify a protocol (e.g. 
file://) and be
+               accessible on all nodes
+
+        :param key: The key of jars type, must be one of 'pipeline.jars' and 
'pipeline.classpaths'.
+        :param jars_path: Path of jars that delimited by ';'.
+        """
+        jvm = get_gateway().jvm
+        jars_key = 
jvm.org.apache.flink.configuration.PipelineOptions.JARS.key()
+        classpaths_key = 
jvm.org.apache.flink.configuration.PipelineOptions.CLASSPATHS.key()
+        if key in [jars_key, classpaths_key]:

Review comment:
       Raise a exception if the key is not `pipeline.jars` or 
`pipeline.classpaths`

##########
File path: flink-python/pyflink/datastream/stream_execution_environment.py
##########
@@ -553,6 +553,29 @@ def set_python_executable(self, python_exec: str):
             .getEnvironmentConfig(self._j_stream_execution_environment)
         env_config.setString(jvm.PythonOptions.PYTHON_EXECUTABLE.key(), 
python_exec)
 
+    def add_jars(self, key: str, jars_path: str):

Review comment:
       Why not add two methods that `add_jars` for `pipeline.jars` and 
`add_class_paths` for `pipeline.classpaths`




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to