|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Executor
Callback interface to be implemented by frameworks' executors.
Note that only one callback will be invoked at a time, so it is not
recommended that you block within a callback because it may cause a
deadlock.
Each callback includes a reference to the executor driver that was
used to run this executor. The reference will not change for the
duration of an executor (i.e., from the point you do ExecutorDriver.start() to the point that ExecutorDriver.join()
returns). This is intended for convenience so that an executor
doesn't need to store a reference to the driver itself.
| Method Summary | |
|---|---|
void |
disconnected(ExecutorDriver driver)
Invoked when the executor becomes "disconnected" from the slave (e.g., the slave is being restarted due to an upgrade). |
void |
error(ExecutorDriver driver,
String message)
Invoked when a fatal error has occured with the executor and/or executor driver. |
void |
frameworkMessage(ExecutorDriver driver,
byte[] data)
Invoked when a framework message has arrived for this executor. |
void |
killTask(ExecutorDriver driver,
org.apache.mesos.Protos.TaskID taskId)
Invoked when a task running within this executor has been killed (via SchedulerDriver.killTask(org.apache.mesos.Protos.TaskID)). |
void |
launchTask(ExecutorDriver driver,
org.apache.mesos.Protos.TaskInfo task)
Invoked when a task has been launched on this executor (initiated via Scheduler#launchTasks. |
void |
registered(ExecutorDriver driver,
org.apache.mesos.Protos.ExecutorInfo executorInfo,
org.apache.mesos.Protos.FrameworkInfo frameworkInfo,
org.apache.mesos.Protos.SlaveInfo slaveInfo)
Invoked once the executor driver has been able to successfully connect with Mesos. |
void |
reregistered(ExecutorDriver driver,
org.apache.mesos.Protos.SlaveInfo slaveInfo)
Invoked when the executor re-registers with a restarted slave. |
void |
shutdown(ExecutorDriver driver)
Invoked when the executor should terminate all of it's currently running tasks. |
| Method Detail |
|---|
void registered(ExecutorDriver driver,
org.apache.mesos.Protos.ExecutorInfo executorInfo,
org.apache.mesos.Protos.FrameworkInfo frameworkInfo,
org.apache.mesos.Protos.SlaveInfo slaveInfo)
ExecutorInfo#data
field. TODO(vinod): Add a new reregistered callback for when the executor
re-connects with a restarted slave.
void reregistered(ExecutorDriver driver,
org.apache.mesos.Protos.SlaveInfo slaveInfo)
void disconnected(ExecutorDriver driver)
void launchTask(ExecutorDriver driver,
org.apache.mesos.Protos.TaskInfo task)
Scheduler#launchTasks. Note that this task can be
realized with a thread, a process, or some simple computation,
however, no other callbacks will be invoked on this executor
until this callback has returned.
void killTask(ExecutorDriver driver,
org.apache.mesos.Protos.TaskID taskId)
SchedulerDriver.killTask(org.apache.mesos.Protos.TaskID)). Note that no status
update will be sent on behalf of the executor, the executor is
responsible for creating a new TaskStatus (i.e., with
TASK_KILLED) and invoking ExecutorDriver.sendStatusUpdate(org.apache.mesos.Protos.TaskStatus).
void frameworkMessage(ExecutorDriver driver,
byte[] data)
void shutdown(ExecutorDriver driver)
void error(ExecutorDriver driver,
String message)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||