Class RemoteStreamEnvironment
- java.lang.Object
-
- org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
- org.apache.flink.streaming.api.environment.RemoteStreamEnvironment
-
- All Implemented Interfaces:
AutoCloseable
@Public public class RemoteStreamEnvironment extends StreamExecutionEnvironment
AStreamExecutionEnvironment
for executing on a cluster.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
cacheFile, checkpointCfg, config, configuration, transformations
-
-
Constructor Summary
Constructors Constructor Description RemoteStreamEnvironment(String host, int port, String... jarFiles)
Creates a new RemoteStreamEnvironment that points to the master (JobManager) described by the given host name and port.RemoteStreamEnvironment(String host, int port, org.apache.flink.configuration.Configuration clientConfiguration, String... jarFiles)
Creates a new RemoteStreamEnvironment that points to the master (JobManager) described by the given host name and port.RemoteStreamEnvironment(String host, int port, org.apache.flink.configuration.Configuration clientConfiguration, String[] jarFiles, URL[] globalClasspaths)
Creates a new RemoteStreamEnvironment that points to the master (JobManager) described by the given host name and port.RemoteStreamEnvironment(String host, int port, org.apache.flink.configuration.Configuration clientConfiguration, String[] jarFiles, URL[] globalClasspaths, SavepointRestoreSettings savepointRestoreSettings)
Creates a new RemoteStreamEnvironment that points to the master (JobManager) described by the given host name and port.RemoteStreamEnvironment(org.apache.flink.core.execution.PipelineExecutorServiceLoader executorServiceLoader, String host, int port, org.apache.flink.configuration.Configuration clientConfiguration, String[] jarFiles, URL[] globalClasspaths, SavepointRestoreSettings savepointRestoreSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.api.common.JobExecutionResult
execute(StreamGraph streamGraph)
Triggers the program execution.String
getHost()
Gets the hostname of the master (JobManager), where the program will be executed.int
getPort()
Gets the port of the master (JobManager), where the program will be executed.String
toString()
-
Methods inherited from class org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
addOperator, addSource, addSource, addSource, addSource, areExplicitEnvironmentsAllowed, clean, clearJobListeners, close, configure, configure, createInput, createInput, createLocalEnvironment, createLocalEnvironment, createLocalEnvironment, createLocalEnvironment, createLocalEnvironmentWithWebUI, createRemoteEnvironment, createRemoteEnvironment, createRemoteEnvironment, disableOperatorChaining, enableChangelogStateBackend, enableCheckpointing, enableCheckpointing, enableCheckpointing, execute, execute, executeAsync, executeAsync, executeAsync, fromCollection, fromCollection, fromCollection, fromCollection, fromData, fromData, fromData, fromData, fromData, fromElements, fromElements, fromParallelCollection, fromParallelCollection, fromSequence, fromSource, fromSource, generateSequence, generateStreamGraph, getBufferTimeout, getCachedFiles, getCheckpointConfig, getCheckpointingConsistencyMode, getCheckpointingMode, getCheckpointInterval, getConfig, getConfiguration, getDefaultLocalParallelism, getDefaultSavepointDirectory, getExecutionEnvironment, getExecutionEnvironment, getExecutionPlan, getJobListeners, getMaxParallelism, getParallelism, getStreamGraph, getStreamGraph, getTransformations, getUserClassloader, initializeContextEnvironment, invalidateClusterDataset, isChainingEnabled, isChainingOfOperatorsWithDifferentMaxParallelismEnabled, isChangelogStateBackendEnabled, isForceUnalignedCheckpoints, isUnalignedCheckpointsEnabled, listCompletedClusterDatasets, readFile, readFile, readFile, readFile, readFileStream, registerCachedFile, registerCachedFile, registerCacheTransformation, registerCollectIterator, registerJobListener, registerSlotSharingGroup, resetContextEnvironment, setBufferTimeout, setDefaultLocalParallelism, setDefaultSavepointDirectory, setDefaultSavepointDirectory, setDefaultSavepointDirectory, setMaxParallelism, setParallelism, setRuntimeMode, socketTextStream, socketTextStream, socketTextStream, socketTextStream, socketTextStream
-
-
-
-
Constructor Detail
-
RemoteStreamEnvironment
public RemoteStreamEnvironment(String host, int port, String... jarFiles)
Creates a new RemoteStreamEnvironment that points to the master (JobManager) described by the given host name and port.- Parameters:
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.jarFiles
- 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.
-
RemoteStreamEnvironment
public RemoteStreamEnvironment(String host, int port, org.apache.flink.configuration.Configuration clientConfiguration, String... jarFiles)
Creates a new RemoteStreamEnvironment that points to the master (JobManager) described by the given host name and port.- Parameters:
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.clientConfiguration
- The configuration used to parametrize the client that connects to the remote cluster.jarFiles
- 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.
-
RemoteStreamEnvironment
public RemoteStreamEnvironment(String host, int port, org.apache.flink.configuration.Configuration clientConfiguration, String[] jarFiles, URL[] globalClasspaths)
Creates a new RemoteStreamEnvironment that points to the master (JobManager) described by the given host name and port.- Parameters:
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.clientConfiguration
- The configuration used to parametrize the client that connects to the remote cluster.jarFiles
- 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.globalClasspaths
- The paths of directories and JAR files that are added to each user code classloader on all nodes in the cluster. Note that the paths must specify a protocol (e.g. file://) and be accessible on all nodes (e.g. by means of a NFS share). The protocol must be supported by theURLClassLoader
.
-
RemoteStreamEnvironment
@PublicEvolving public RemoteStreamEnvironment(String host, int port, org.apache.flink.configuration.Configuration clientConfiguration, String[] jarFiles, URL[] globalClasspaths, SavepointRestoreSettings savepointRestoreSettings)
Creates a new RemoteStreamEnvironment that points to the master (JobManager) described by the given host name and port.- Parameters:
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.clientConfiguration
- The configuration used to parametrize the client that connects to the remote cluster.jarFiles
- 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.globalClasspaths
- The paths of directories and JAR files that are added to each user code classloader on all nodes in the cluster. Note that the paths must specify a protocol (e.g. file://) and be accessible on all nodes (e.g. by means of a NFS share). The protocol must be supported by theURLClassLoader
.savepointRestoreSettings
- Optional savepoint restore settings for job execution.
-
RemoteStreamEnvironment
@PublicEvolving public RemoteStreamEnvironment(org.apache.flink.core.execution.PipelineExecutorServiceLoader executorServiceLoader, String host, int port, org.apache.flink.configuration.Configuration clientConfiguration, String[] jarFiles, URL[] globalClasspaths, SavepointRestoreSettings savepointRestoreSettings)
-
-
Method Detail
-
execute
public org.apache.flink.api.common.JobExecutionResult execute(StreamGraph streamGraph) throws Exception
Description copied from class:StreamExecutionEnvironment
Triggers the program execution. The environment will execute all parts of the program that have resulted in a "sink" operation. Sink operations are for example printing results or forwarding them to a message queue.- Overrides:
execute
in classStreamExecutionEnvironment
- Parameters:
streamGraph
- the stream graph representing the transformations- Returns:
- The result of the job execution, containing elapsed time and accumulators.
- Throws:
Exception
- which occurs during job execution.
-
getHost
public String getHost()
Gets the hostname of the master (JobManager), where the program will be executed.- Returns:
- The hostname of the master
-
getPort
public int getPort()
Gets the port of the master (JobManager), where the program will be executed.- Returns:
- The port of the master
-
-