Package org.apache.flink.python.env
Class AbstractPythonEnvironmentManager
java.lang.Object
org.apache.flink.python.env.AbstractPythonEnvironmentManager
- All Implemented Interfaces:
AutoCloseable,PythonEnvironmentManager
- Direct Known Subclasses:
EmbeddedPythonEnvironmentManager,ProcessPythonEnvironmentManager
@Internal
public abstract class AbstractPythonEnvironmentManager
extends Object
implements PythonEnvironmentManager
The base class of python environment manager which is used to create the PythonEnvironment object
used to execute Python functions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classPython lease resource which includes environment variables and working directory of execution python environment. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractPythonEnvironmentManager(PythonDependencyInfo dependencyInfo, String[] tmpDirectories, Map<String, String> systemEnv, org.apache.flink.api.common.JobID jobID) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()constructEnvironmentVariables(String baseDirectory) Constructs the environment variables which is used to launch the python UDF worker.voidopen()Initialize the environment manager.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.python.env.PythonEnvironmentManager
createEnvironment
-
Field Details
-
resource
-
dependencyInfo
-
PYTHON_REQUIREMENTS_DIR
- See Also:
-
PYTHON_REQUIREMENTS_FILE
- See Also:
-
PYTHON_REQUIREMENTS_CACHE
- See Also:
-
PYTHON_REQUIREMENTS_INSTALL_DIR
- See Also:
-
PYTHON_WORKING_DIR
- See Also:
-
PYTHON_FILES_DIR
- See Also:
-
PYTHON_ARCHIVES_DIR
- See Also:
-
PYFLINK_GATEWAY_DISABLED
- See Also:
-
-
Constructor Details
-
AbstractPythonEnvironmentManager
public AbstractPythonEnvironmentManager(PythonDependencyInfo dependencyInfo, String[] tmpDirectories, Map<String, String> systemEnv, org.apache.flink.api.common.JobID jobID)
-
-
Method Details
-
open
Description copied from interface:PythonEnvironmentManagerInitialize the environment manager.- Specified by:
openin interfacePythonEnvironmentManager- Throws:
Exception
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getBaseDirectory
-
getPythonEnv
-
constructEnvironmentVariables
@VisibleForTesting public Map<String,String> constructEnvironmentVariables(String baseDirectory) throws IOException Constructs the environment variables which is used to launch the python UDF worker.- Returns:
- The environment variables which contain the paths of the python dependencies.
- Throws:
IOException
-