public final class PythonEnvUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PythonEnvUtils.PythonEnvironment
Wraps Python exec environment.
|
Constructor and Description |
---|
PythonEnvUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
createSymbolicLinkForPyflinkLib(Path libPath,
Path symbolicLinkPath)
Creates symbolLink in working directory for pyflink lib.
|
static List<Path> |
getLibFiles(String libDir)
Gets pyflink dependent libs in specified directory.
|
static PythonEnvUtils.PythonEnvironment |
preparePythonEnvironment(List<Path> pythonLibFiles)
Prepares PythonEnvironment to start python process.
|
static Process |
startPythonProcess(PythonEnvUtils.PythonEnvironment pythonEnv,
List<String> commands)
Starts python process.
|
public static PythonEnvUtils.PythonEnvironment preparePythonEnvironment(List<Path> pythonLibFiles) throws IOException
pythonLibFiles
- The dependent Python files.IOException
public static List<Path> getLibFiles(String libDir)
libDir
- The lib directorypublic static void createSymbolicLinkForPyflinkLib(Path libPath, Path symbolicLinkPath) throws IOException
libPath
- the pyflink lib file path.symbolicLinkPath
- the symbolic link to pyflink lib.IOException
public static Process startPythonProcess(PythonEnvUtils.PythonEnvironment pythonEnv, List<String> commands) throws IOException
pythonEnv
- the python Environment which will be in a process.commands
- the commands that python process will execute.IOException
- Thrown if an error occurred when python process start.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.