public class RemoteExecutor extends PlanExecutor
PlanExecutor
that takes the program
and ships it to a remote Flink cluster for execution.
The RemoteExecutor is pointed at the JobManager and gets the program and (if necessary) the set of libraries that need to be shipped together with the program.
The RemoteExecutor is used in the RemoteEnvironment
to
remotely execute program parts.
Constructor and Description |
---|
RemoteExecutor(InetSocketAddress inet,
Configuration clientConfiguration,
List<URL> jarFiles,
List<URL> globalClasspaths) |
RemoteExecutor(String hostport,
Configuration clientConfiguration,
URL jarFile) |
RemoteExecutor(String hostname,
int port) |
RemoteExecutor(String hostname,
int port,
Configuration clientConfiguration) |
RemoteExecutor(String hostname,
int port,
Configuration clientConfiguration,
List<URL> jarFiles,
List<URL> globalClasspaths) |
RemoteExecutor(String hostname,
int port,
Configuration clientConfiguration,
URL jarFile) |
RemoteExecutor(String hostname,
int port,
List<URL> jarFiles) |
RemoteExecutor(String hostname,
int port,
URL jarFile) |
RemoteExecutor(String hostport,
URL jarFile) |
Modifier and Type | Method and Description |
---|---|
void |
endSession(JobID jobID)
Ends the job session, identified by the given JobID.
|
JobExecutionResult |
executePlan(Plan plan)
Execute the given program.
|
JobExecutionResult |
executePlanWithJars(JobWithJars program) |
int |
getDefaultParallelism()
Gets the parallelism that will be used when neither the program does not define
any parallelism at all.
|
String |
getOptimizerPlanAsJSON(Plan plan)
Gets the programs execution plan in a JSON format.
|
boolean |
isRunning()
Checks if this executor is currently running.
|
void |
setDefaultParallelism(int defaultParallelism)
Sets the parallelism that will be used when neither the program does not define
any parallelism at all.
|
void |
start()
Starts the program executor.
|
void |
stop()
Shuts down the plan executor and releases all local resources.
|
createLocalExecutor, createRemoteExecutor, isPrintingStatusDuringExecution, setPrintStatusDuringExecution
public RemoteExecutor(String hostname, int port)
public RemoteExecutor(String hostname, int port, Configuration clientConfiguration)
public RemoteExecutor(String hostname, int port, Configuration clientConfiguration, URL jarFile)
public RemoteExecutor(String hostport, Configuration clientConfiguration, URL jarFile)
public RemoteExecutor(String hostname, int port, Configuration clientConfiguration, List<URL> jarFiles, List<URL> globalClasspaths)
public RemoteExecutor(InetSocketAddress inet, Configuration clientConfiguration, List<URL> jarFiles, List<URL> globalClasspaths)
public void setDefaultParallelism(int defaultParallelism)
defaultParallelism
- The default parallelism for the executor.public int getDefaultParallelism()
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
PlanExecutor
If the executor has not been started before, then this method will start the executor and stop it after the execution has completed. This implies that one needs to explicitly start the executor for all programs where multiple dataflow parts depend on each other. Otherwise, the previous parts will no longer be available, because the executor immediately shut down after the execution.
executePlan
in class PlanExecutor
plan
- The plan of the program to execute.Exception
- Thrown, if job submission caused an exception.public JobExecutionResult executePlanWithJars(JobWithJars program) throws Exception
Exception
public String getOptimizerPlanAsJSON(Plan plan) throws Exception
PlanExecutor
getOptimizerPlanAsJSON
in class PlanExecutor
plan
- The program to get the execution plan for.Exception
- Thrown, if the executor could not connect to the compiler.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.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.