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 ExecutorDriver
ExecutorDriver
public Protos.Status stop()
ExecutorDriver
stop
in interface ExecutorDriver
Protos.Status
public Protos.Status abort()
ExecutorDriver
ExecutorDriver.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 ExecutorDriver
Protos.Status
public Protos.Status join()
ExecutorDriver
join
in interface ExecutorDriver
Protos.Status
public Protos.Status run()
ExecutorDriver
run
in interface ExecutorDriver
Protos.Status
public Protos.Status sendStatusUpdate(Protos.TaskStatus status)
ExecutorDriver
Scheduler.statusUpdate(org.apache.mesos.SchedulerDriver, org.apache.mesos.Protos.TaskStatus)
for more
information about status update acknowledgements.sendStatusUpdate
in interface ExecutorDriver
status
- The status update to send.Protos.Status
public Protos.Status sendFrameworkMessage(byte[] data)
ExecutorDriver
sendFrameworkMessage
in interface ExecutorDriver
data
- The message payload.Protos.Status
protected void initialize()
protected void finalize()
finalize
in class java.lang.Object