public class PythonEnvironmentFactory extends Object
PythonStreamExecutionEnvironment
s.
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,
Path tmpDistributedDir,
String scriptName) |
public PythonStreamExecutionEnvironment get_execution_environment()
StreamExecutionEnvironment.getExecutionEnvironment()
. In addition it takes
care for required Jython serializers registration.public PythonStreamExecutionEnvironment create_local_execution_environment(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, 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, 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–2019 The Apache Software Foundation. All rights reserved.