public class LocalEnvironment extends ExecutionEnvironment
ExecutionEnvironment
that runs the program locally, multi-threaded, in the JVM where the
environment is instantiated. When this environment is instantiated, it uses a default degree of parallelism
of 1
. Local environments can also be instantiated through
ExecutionEnvironment.createLocalEnvironment()
and ExecutionEnvironment.createLocalEnvironment(int)
.
The former version will pick a default degree of parallelism equal to the number of hardware contexts in the local
machine.Constructor and Description |
---|
LocalEnvironment()
Creates a new local environment.
|
Modifier and Type | Method and Description |
---|---|
void |
disableLogging()
Completely disables logging during the execution of programs in the local environment.
|
void |
enableLogging()
Causes the local environment to print INFO level log messages to the standard error output.
|
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.
|
boolean |
isLoggingEnabled()
Checks whether logging during the program execution is enabled or disabled.
|
String |
toString() |
createInput, createInput, createLocalEnvironment, createLocalEnvironment, createProgramPlan, createProgramPlan, createRemoteEnvironment, createRemoteEnvironment, disableLocalExecution, execute, fromCollection, fromCollection, fromCollection, fromCollection, fromElements, fromParallelCollection, fromParallelCollection, generateSequence, getDegreeOfParallelism, getExecutionEnvironment, getId, getIdString, initializeContextEnvironment, isContextEnvironmentSet, localExecutionIsAllowed, readCsvFile, readFile, readTextFile, readTextFile, readTextFileWithValue, readTextFileWithValue, registerCachedFile, registerCachedFile, registerCachedFilesWithPlan, setDefaultLocalParallelism, setDegreeOfParallelism
public 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.public void enableLogging()
public void disableLogging()
public boolean isLoggingEnabled()
By default, logging is turned off.
Copyright © 2014 The Apache Software Foundation. All rights reserved.