public class MesosExecutorDriver extends java.lang.Object implements ExecutorDriver
The driver is responsible for invoking the Executor callbacks as it communicates with the Mesos slave.
Note that blocking on the MesosExecutorDriver (e.g., via join()) doesn't affect the executor callbacks in anyway because
they are handled by a different thread.
Note that the driver uses GLOG to do its own logging. GLOG flags can be set via environment variables, prefixing the flag name with "GLOG_", e.g., "GLOG_v=1". For Mesos specific logging flags see src/logging/flags.hpp. Mesos flags can also be set via environment variables, prefixing the flag name with "MESOS_", e.g., "MESOS_QUIET=1".
See src/examples/java/TestExecutor.java for an example of using the MesosExecutorDriver.
| Constructor and Description |
|---|
MesosExecutorDriver(Executor executor)
Creates a new driver that uses the specified Executor.
|
| Modifier and Type | Method and Description |
|---|---|
Protos.Status |
abort()
Aborts the driver so that no more callbacks can be made to the
executor.
|
protected void |
finalize() |
protected void |
initialize() |
Protos.Status |
join()
Waits for the driver to be stopped or aborted, possibly
_blocking_ the current thread indefinitely.
|
Protos.Status |
run()
Starts and immediately joins (i.e., blocks on) the driver.
|
Protos.Status |
sendFrameworkMessage(byte[] data)
Sends a message to the framework scheduler.
|
Protos.Status |
sendStatusUpdate(Protos.TaskStatus status)
Sends a status update to the framework scheduler, retrying as
necessary until an acknowledgement has been received or the
executor is terminated (in which case, a TASK_LOST status update
will be sent).
|
Protos.Status |
start()
See ExecutorDriver for descriptions of these.
|
Protos.Status |
stop()
Stops the executor driver.
|
public Protos.Status start()
start in interface ExecutorDriverExecutorDriverpublic Protos.Status stop()
ExecutorDriverstop in interface ExecutorDriverProtos.Statuspublic Protos.Status abort()
ExecutorDriverExecutorDriver.join(), see below),
and instantiate and start another driver if desired (from within
the same process ... although this functionality is currently not
supported for executors).abort in interface ExecutorDriverProtos.Statuspublic Protos.Status join()
ExecutorDriverjoin in interface ExecutorDriverProtos.Statuspublic Protos.Status run()
ExecutorDriverrun in interface ExecutorDriverProtos.Statuspublic Protos.Status sendStatusUpdate(Protos.TaskStatus status)
ExecutorDriverScheduler.statusUpdate(org.apache.mesos.SchedulerDriver, org.apache.mesos.Protos.TaskStatus) for more
information about status update acknowledgements.sendStatusUpdate in interface ExecutorDriverstatus - The status update to send.Protos.Statuspublic Protos.Status sendFrameworkMessage(byte[] data)
ExecutorDriversendFrameworkMessage in interface ExecutorDriverdata - The message payload.Protos.Statusprotected void initialize()
protected void finalize()
finalize in class java.lang.Object