Search in sources :

Example 1 with PythonEnv

use of org.apache.flink.table.functions.python.PythonEnv in project flink by apache.

the class AbstractExternalPythonFunctionOperator method createPythonEnvironmentManager.

@Override
protected ProcessPythonEnvironmentManager createPythonEnvironmentManager() {
    PythonDependencyInfo dependencyInfo = PythonDependencyInfo.create(pythonConfig, getRuntimeContext().getDistributedCache());
    PythonEnv pythonEnv = getPythonEnv();
    if (pythonEnv.getExecType() == PythonEnv.ExecType.PROCESS) {
        return new ProcessPythonEnvironmentManager(dependencyInfo, getContainingTask().getEnvironment().getTaskManagerInfo().getTmpDirectories(), new HashMap<>(System.getenv()), getRuntimeContext().getJobId());
    } else {
        throw new UnsupportedOperationException(String.format("Execution type '%s' is not supported.", pythonEnv.getExecType()));
    }
}
Also used : PythonDependencyInfo(org.apache.flink.python.env.PythonDependencyInfo) ProcessPythonEnvironmentManager(org.apache.flink.python.env.process.ProcessPythonEnvironmentManager) PythonEnv(org.apache.flink.table.functions.python.PythonEnv)

Aggregations

PythonDependencyInfo (org.apache.flink.python.env.PythonDependencyInfo)1 ProcessPythonEnvironmentManager (org.apache.flink.python.env.process.ProcessPythonEnvironmentManager)1 PythonEnv (org.apache.flink.table.functions.python.PythonEnv)1