public class PythonEnvironmentFactory extends Object
PythonStreamExecutionEnvironments.
This class is a replacement for static factory methods defined in StreamExecutionEnvironment and allows
us to pass state from the PythonStreamBinder instance
to the created execution environment without having to rely on static fields.
| Constructor and Description |
|---|
PythonEnvironmentFactory(String localTmpPath,
org.apache.flink.core.fs.Path tmpDistributedDir,
String scriptName) |
| Modifier and Type | Method and Description |
|---|---|
PythonStreamExecutionEnvironment |
create_local_execution_environment(org.apache.flink.configuration.Configuration config)
Creates a
LocalStreamEnvironment. |
PythonStreamExecutionEnvironment |
create_local_execution_environment(int parallelism,
org.apache.flink.configuration.Configuration config)
A thin wrapper layer over
StreamExecutionEnvironment.createLocalEnvironment(int, Configuration). |
PythonStreamExecutionEnvironment |
create_remote_execution_environment(String host,
int port,
org.apache.flink.configuration.Configuration config,
String... jar_files)
A thin wrapper layer over
StreamExecutionEnvironment.createRemoteEnvironment(
String, int, Configuration, String...). |
PythonStreamExecutionEnvironment |
create_remote_execution_environment(String host,
int port,
int parallelism,
String... jar_files)
A thin wrapper layer over
StreamExecutionEnvironment.createRemoteEnvironment(
String, int, int, String...). |
PythonStreamExecutionEnvironment |
create_remote_execution_environment(String host,
int port,
String... jar_files)
A thin wrapper layer over
StreamExecutionEnvironment.createRemoteEnvironment(String, int, String...). |
PythonStreamExecutionEnvironment |
get_execution_environment()
A thin wrapper layer over
StreamExecutionEnvironment.getExecutionEnvironment(). |
public PythonStreamExecutionEnvironment get_execution_environment()
StreamExecutionEnvironment.getExecutionEnvironment(). In addition it takes
care for required Jython serializers registration.public PythonStreamExecutionEnvironment create_local_execution_environment(org.apache.flink.configuration.Configuration config)
LocalStreamEnvironment. The local execution environment
will run the program in a multi-threaded fashion in the same JVM as the
environment was created in. The default parallelism of the local
environment is the number of hardware contexts (CPU cores / threads),
unless it was specified differently by PythonStreamExecutionEnvironment.set_parallelism(int).config - Pass a custom configuration into the clusterpublic PythonStreamExecutionEnvironment create_local_execution_environment(int parallelism, org.apache.flink.configuration.Configuration config)
StreamExecutionEnvironment.createLocalEnvironment(int, Configuration).parallelism - The parallelism for the local environment.config - Pass a custom configuration into the clusterpublic PythonStreamExecutionEnvironment create_remote_execution_environment(String host, int port, String... jar_files)
StreamExecutionEnvironment.createRemoteEnvironment(String, int, String...).host - The host name or address of the master (JobManager), where the
program should be executed.port - The port of the master (JobManager), where the program should
be executed.jar_files - The JAR files with code that needs to be shipped to the
cluster. If the program uses user-defined functions,
user-defined input formats, or any libraries, those must be
provided in the JAR files.public PythonStreamExecutionEnvironment create_remote_execution_environment(String host, int port, org.apache.flink.configuration.Configuration config, String... jar_files)
StreamExecutionEnvironment.createRemoteEnvironment(
String, int, Configuration, String...).host - The host name or address of the master (JobManager), where the
program should be executed.port - The port of the master (JobManager), where the program should
be executed.config - The configuration used by the client that connects to the remote cluster.jar_files - The JAR files with code that needs to be shipped to the
cluster. If the program uses user-defined functions,
user-defined input formats, or any libraries, those must be
provided in the JAR files.public PythonStreamExecutionEnvironment create_remote_execution_environment(String host, int port, int parallelism, String... jar_files)
StreamExecutionEnvironment.createRemoteEnvironment(
String, int, int, String...).host - The host name or address of the master (JobManager), where the
program should be executed.port - The port of the master (JobManager), where the program should
be executed.parallelism - The parallelism to use during the execution.jar_files - The JAR files with code that needs to be shipped to the
cluster. If the program uses user-defined functions,
user-defined input formats, or any libraries, those must be
provided in the JAR files.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.