public class LocalExecutor extends 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(Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
endSession(JobID jobID)
Ends the job session, identified by the given JobID.
|
static JobExecutionResult |
execute(Plan plan)
Executes the given dataflow plan.
|
static JobExecutionResult |
execute(Program pa,
String... args)
Executes the given program.
|
JobExecutionResult |
executePlan(Plan plan)
Executes the given program on a local runtime and waits for the job to finish.
|
String |
getOptimizerPlanAsJSON(Plan plan)
Creates a JSON representation of the given dataflow's execution plan.
|
static String |
getPlanAsJSON(Plan plan)
Creates a JSON representation of the given dataflow plan.
|
int |
getTaskManagerNumSlots() |
boolean |
isDefaultOverwriteFiles() |
boolean |
isRunning()
Checks if this executor is currently running.
|
static String |
optimizerPlanAsJSON(Plan plan)
Creates a JSON representation of the given dataflow's execution plan.
|
void |
setDefaultOverwriteFiles(boolean defaultOverwriteFiles) |
void |
setTaskManagerNumSlots(int taskManagerNumSlots) |
void |
start()
Starts the program executor.
|
void |
stop()
Shuts down the plan executor and releases all local resources.
|
createLocalExecutor, createRemoteExecutor, isPrintingStatusDuringExecution, setPrintStatusDuringExecution
public LocalExecutor()
public LocalExecutor(Configuration conf)
public boolean isDefaultOverwriteFiles()
public void setDefaultOverwriteFiles(boolean defaultOverwriteFiles)
public void setTaskManagerNumSlots(int taskManagerNumSlots)
public int getTaskManagerNumSlots()
public void start() throws Exception
PlanExecutor
PlanExecutor.stop()
is called.start
in class PlanExecutor
Exception
- Thrown, if the executor startup failed.public void stop() throws Exception
PlanExecutor
This method also ends all sessions created by this executor. Remote job executions may complete, but the session is not kept alive after that.
stop
in class PlanExecutor
Exception
- Thrown, if the proper shutdown failed.public boolean isRunning()
PlanExecutor
isRunning
in class PlanExecutor
public JobExecutionResult executePlan(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 PlanExecutor
plan
- 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(Plan plan) throws Exception
getOptimizerPlanAsJSON
in class PlanExecutor
plan
- The dataflow plan.Exception
- Thrown, if the optimization process that creates the execution plan failed.public void endSession(JobID jobID) throws Exception
PlanExecutor
endSession
in class PlanExecutor
jobID
- The JobID identifying the job session.Exception
- Thrown, if the message to finish the session cannot be delivered.public static JobExecutionResult execute(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 JobExecutionResult execute(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(Plan plan) throws Exception
plan
- The dataflow plan.Exception
- Thrown, if the optimization process that creates the execution plan failed.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.