public class LocalExecutor
extends org.apache.flink.api.common.PlanExecutor
By simply calling the executePlan(org.apache.flink.api.common.Plan) method,
this executor still start up and shut down again immediately after the program finished.
To use this executor to execute many dataflow programs that constitute one job together, then this executor needs to be explicitly started, to keep running across several executions.
| Constructor and Description |
|---|
LocalExecutor() |
LocalExecutor(org.apache.flink.configuration.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
void |
endSession(org.apache.flink.api.common.JobID jobID) |
static org.apache.flink.api.common.JobExecutionResult |
execute(org.apache.flink.api.common.Plan plan)
Executes the given dataflow plan.
|
static org.apache.flink.api.common.JobExecutionResult |
execute(org.apache.flink.api.common.Program pa,
String... args)
Executes the given program.
|
org.apache.flink.api.common.JobExecutionResult |
executePlan(org.apache.flink.api.common.Plan plan)
Executes the given program on a local runtime and waits for the job to finish.
|
String |
getOptimizerPlanAsJSON(org.apache.flink.api.common.Plan plan)
Creates a JSON representation of the given dataflow's execution plan.
|
static String |
getPlanAsJSON(org.apache.flink.api.common.Plan plan)
Creates a JSON representation of the given dataflow plan.
|
int |
getTaskManagerNumSlots() |
boolean |
isDefaultOverwriteFiles() |
boolean |
isRunning() |
static String |
optimizerPlanAsJSON(org.apache.flink.api.common.Plan plan)
Creates a JSON representation of the given dataflow's execution plan.
|
void |
setDefaultOverwriteFiles(boolean defaultOverwriteFiles) |
void |
setTaskManagerNumSlots(int taskManagerNumSlots) |
void |
start() |
void |
stop() |
public LocalExecutor()
public LocalExecutor(org.apache.flink.configuration.Configuration conf)
public boolean isDefaultOverwriteFiles()
public void setDefaultOverwriteFiles(boolean defaultOverwriteFiles)
public void setTaskManagerNumSlots(int taskManagerNumSlots)
public int getTaskManagerNumSlots()
public void start()
throws Exception
start in class org.apache.flink.api.common.PlanExecutorExceptionpublic void stop()
throws Exception
stop in class org.apache.flink.api.common.PlanExecutorExceptionpublic boolean isRunning()
isRunning in class org.apache.flink.api.common.PlanExecutorpublic org.apache.flink.api.common.JobExecutionResult executePlan(org.apache.flink.api.common.Plan plan)
throws Exception
If the executor has not been started before, this starts the executor and shuts it down after the job finished. If the job runs in session mode, the executor is kept alive until no more references to the executor exist.
executePlan in class org.apache.flink.api.common.PlanExecutorplan - The plan of the program to execute.Exception - Thrown, if either the startup of the local execution context, or the execution
caused an exception.public String getOptimizerPlanAsJSON(org.apache.flink.api.common.Plan plan) throws Exception
getOptimizerPlanAsJSON in class org.apache.flink.api.common.PlanExecutorplan - The dataflow plan.Exception - Thrown, if the optimization process that creates the execution plan failed.public void endSession(org.apache.flink.api.common.JobID jobID)
throws Exception
endSession in class org.apache.flink.api.common.PlanExecutorExceptionpublic static org.apache.flink.api.common.JobExecutionResult execute(org.apache.flink.api.common.Program pa,
String... args)
throws Exception
pa - The program.args - The parameters.Exception - Thrown, if either the startup of the local execution context, or the execution
caused an exception.public static org.apache.flink.api.common.JobExecutionResult execute(org.apache.flink.api.common.Plan plan)
throws Exception
plan - The dataflow plan.Exception - Thrown, if either the startup of the local execution context, or the execution
caused an exception.public static String optimizerPlanAsJSON(org.apache.flink.api.common.Plan plan) throws Exception
plan - The dataflow plan.Exception - Thrown, if the optimization process that creates the execution plan failed.public static String getPlanAsJSON(org.apache.flink.api.common.Plan plan)
plan - The dataflow plan.Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.