HuangXingBo 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_r347348659
##########
File path:
flink-python/src/main/java/org/apache/flink/client/python/PythonEnvUtils.java
##########
@@ -93,65 +91,60 @@ public void run() {
* Prepares PythonEnvironment to start python process.
*
* @param pythonLibFiles The dependent Python files.
+ * @param tmpDir The temporary directory files copied to.
* @return PythonEnvironment the Python environment which will be
executed in Python process.
*/
- public static PythonEnvironment preparePythonEnvironment(List<Path>
pythonLibFiles) throws IOException {
+ public static PythonEnvironment preparePythonEnvironment(
+ List<Path> pythonLibFiles,
+ String tmpDir) throws IOException {
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();
+ tmpDir = new File(tmpDir).getAbsolutePath();
+ // 1. setup temporary local directory for the user files
Path tmpDirPath = new Path(tmpDir);
FileSystem fs = tmpDirPath.getFileSystem();
- if (fs.exists(tmpDirPath)) {
Review comment:
What's the reason of removing the code of deleting existing tmp directory
----------------------------------------------------------------
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