use of org.apache.flink.python.env.process.ProcessPythonEnvironmentManager in project flink by apache.
the class PythonTestUtils method createTestProcessEnvironmentManager.
public static ProcessPythonEnvironmentManager createTestProcessEnvironmentManager() {
Map<String, String> env = new HashMap<>();
env.put(PythonEnvironmentManagerUtils.PYFLINK_UDF_RUNNER_DIR, "");
return new ProcessPythonEnvironmentManager(new PythonDependencyInfo(new HashMap<>(), null, null, new HashMap<>(), "python"), new String[] { System.getProperty("java.io.tmpdir") }, env, new JobID());
}
use of org.apache.flink.python.env.process.ProcessPythonEnvironmentManager 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()));
}
}
Aggregations