public final class PythonDriverEnvUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PythonDriverEnvUtils.PythonEnvironment
Wraps Python exec environment.
|
Modifier and Type | Field and Description |
---|---|
static String |
PYFLINK_PY_ARCHIVES |
static String |
PYFLINK_PY_EXECUTABLE |
static String |
PYFLINK_PY_FILES |
static String |
PYFLINK_PY_REQUIREMENTS |
Constructor and Description |
---|
PythonDriverEnvUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
createSymbolicLinkForPyflinkLib(Path libPath,
Path symbolicLinkPath)
Creates symbolLink in working directory for pyflink lib.
|
static PythonDriverEnvUtils.PythonEnvironment |
preparePythonEnvironment(org.apache.flink.client.python.PythonDriverOptions pythonDriverOptions,
String tmpDir)
Prepares PythonEnvironment to start python process.
|
static Process |
startPythonProcess(PythonDriverEnvUtils.PythonEnvironment pythonEnv,
List<String> commands)
Starts python process.
|
@VisibleForTesting public static final String PYFLINK_PY_FILES
@VisibleForTesting public static final String PYFLINK_PY_REQUIREMENTS
@VisibleForTesting public static final String PYFLINK_PY_EXECUTABLE
@VisibleForTesting public static final String PYFLINK_PY_ARCHIVES
public static PythonDriverEnvUtils.PythonEnvironment preparePythonEnvironment(org.apache.flink.client.python.PythonDriverOptions pythonDriverOptions, String tmpDir) throws IOException, InterruptedException
pythonDriverOptions
- The Python driver options.tmpDir
- The temporary directory which files will be copied to.IOException
InterruptedException
public 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(PythonDriverEnvUtils.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.