public class RemoteEnvironment extends ExecutionEnvironment
ExecutionEnvironment
that sends programs
to a cluster for execution. Note that all file paths used in the program must be accessible from the
cluster. The execution will use the cluster's default parallelism, unless the parallelism is
set explicitly via ExecutionEnvironment.setParallelism(int)
.Modifier and Type | Field and Description |
---|---|
protected String |
host |
protected int |
port |
lastJobExecutionResult
Constructor and Description |
---|
RemoteEnvironment(String host,
int port,
String... jarFiles)
Creates a new RemoteEnvironment that points to the master (JobManager) described by the
given host name and port.
|
Modifier and Type | Method and Description |
---|---|
org.apache.flink.api.common.JobExecutionResult |
execute(String jobName)
Triggers the program execution.
|
String |
getExecutionPlan()
Creates the plan with which the system will execute the program, and returns it as
a String using a JSON representation of the execution data flow graph.
|
String |
toString() |
addDefaultKryoSerializer, addDefaultKryoSerializer, createCollectionsEnvironment, createHadoopInput, createHadoopInput, createInput, createInput, createLocalEnvironment, createLocalEnvironment, createLocalEnvironment, createProgramPlan, createProgramPlan, createProgramPlan, createRemoteEnvironment, createRemoteEnvironment, enableLocalExecution, execute, fromCollection, fromCollection, fromCollection, fromCollection, fromElements, fromParallelCollection, fromParallelCollection, generateSequence, getConfig, getDegreeOfParallelism, getExecutionEnvironment, getId, getIdString, getLastJobExecutionResult, getNumberOfExecutionRetries, getParallelism, initializeContextEnvironment, isContextEnvironmentSet, localExecutionIsAllowed, readCsvFile, readFile, readFileOfPrimitives, readFileOfPrimitives, readHadoopFile, readHadoopFile, readHadoopFile, readHadoopFile, readTextFile, readTextFile, readTextFileWithValue, readTextFileWithValue, registerCachedFile, registerCachedFile, registerCachedFilesWithPlan, registerType, registerTypeWithKryoSerializer, registerTypeWithKryoSerializer, setDefaultLocalParallelism, setDegreeOfParallelism, setNumberOfExecutionRetries, setParallelism
protected final String host
protected final int port
public RemoteEnvironment(String host, int port, String... jarFiles)
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.public org.apache.flink.api.common.JobExecutionResult execute(String jobName) throws Exception
ExecutionEnvironment
DataSet.print()
,
writing results (e.g. DataSet.writeAsText(String)
,
DataSet.write(org.apache.flink.api.common.io.FileOutputFormat, String)
, or other generic
data sinks created with DataSet.output(org.apache.flink.api.common.io.OutputFormat)
.
The program execution will be logged and displayed with the given job name.
execute
in class ExecutionEnvironment
Exception
- Thrown, if the program executions fails.public String getExecutionPlan() throws Exception
ExecutionEnvironment
getExecutionPlan
in class ExecutionEnvironment
Exception
- Thrown, if the compiler could not be instantiated, or the master could not
be contacted to retrieve information relevant to the execution planning.Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.