org.apache.mesos
Interface Executor


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

registered

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. In particular, a scheduler can pass some data to it's executors through the ExecutorInfo#data field. TODO(vinod): Add a new reregistered callback for when the executor re-connects with a restarted slave.


reregistered

void reregistered(ExecutorDriver driver,
                  org.apache.mesos.Protos.SlaveInfo slaveInfo)
Invoked when the executor re-registers with a restarted slave.


disconnected

void disconnected(ExecutorDriver driver)
Invoked when the executor becomes "disconnected" from the slave (e.g., the slave is being restarted due to an upgrade).


launchTask

void launchTask(ExecutorDriver driver,
                org.apache.mesos.Protos.TaskInfo task)
Invoked when a task has been launched on this executor (initiated via 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.


killTask

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)). 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).


frameworkMessage

void frameworkMessage(ExecutorDriver driver,
                      byte[] data)
Invoked when a framework message has arrived for this executor. These messages are best effort; do not expect a framework message to be retransmitted in any reliable fashion.


shutdown

void shutdown(ExecutorDriver driver)
Invoked when the executor should terminate all of it's currently running tasks. Note that after a Mesos has determined that an executor has terminated any tasks that the executor did not send terminal status updates for (e.g., TASK_KILLED, TASK_FINISHED, TASK_FAILED, etc) a TASK_LOST status update will be created.


error

void error(ExecutorDriver driver,
           String message)
Invoked when a fatal error has occured with the executor and/or executor driver. The driver will be aborted BEFORE invoking this callback.



Copyright © 2014 The Apache Software Foundation. All Rights Reserved.