You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/12/05 08:33:37 UTC

[GitHub] [flink] WeiZhong94 commented on a change in pull request #10126: [FLINK-14590][python] Unify the working directory of Java process and Python process when submitting python jobs via "flink run -py"

WeiZhong94 commented on a change in pull request #10126: [FLINK-14590][python] Unify the working directory of Java process and Python process when submitting python jobs via "flink run -py"
URL: https://github.com/apache/flink/pull/10126#discussion_r354166574
 
 

 ##########
 File path: flink-python/src/main/java/org/apache/flink/client/python/PythonDriverEnvUtils.java
 ##########
 @@ -85,28 +84,24 @@ public void run() {
 	 * Prepares PythonEnvironment to start python process.
 	 *
 	 * @param pythonLibFiles The dependent Python files.
+	 * @param tmpDir The temporary directory which files will be copied to.
 	 * @return PythonEnvironment the Python environment which will be executed in Python process.
 	 */
-	public static PythonEnvironment preparePythonEnvironment(List<Path> pythonLibFiles)
-		throws IOException, InterruptedException {
+	public static PythonEnvironment preparePythonEnvironment(
+				List<Path> pythonLibFiles,
+				String tmpDir) throws IOException, InterruptedException {
 		PythonEnvironment env = new PythonEnvironment();
 
-		// 1. setup temporary local directory for the user files
-		String tmpDir = System.getProperty("java.io.tmpdir") +
-			File.separator + "pyflink" + File.separator + UUID.randomUUID();
 
 Review comment:
   The Java system property is unwritable, constructing the temp directory inside the util class  brings great difficulties to the unit tests of it. Move it to `PythonDriver` will make the util is easy to test.

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


With regards,
Apache Git Services