org.apache.mesos
Class MesosExecutorDriver

java.lang.Object
  extended by org.apache.mesos.MesosExecutorDriver
All Implemented Interfaces:
ExecutorDriver

public class MesosExecutorDriver
extends Object
implements ExecutorDriver

Concrete implementation of an ExecutorDriver that connects an Executor with a Mesos slave. The MesosExecutorDriver is thread-safe. 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. See src/examples/java/TestExecutor.java for an example of using the MesosExecutorDriver.


Constructor Summary
MesosExecutorDriver(Executor executor)
          Creates a new driver that uses the specified Executor.
 
Method Summary
 org.apache.mesos.Protos.Status abort()
          Aborts the driver so that no more callbacks can be made to the executor.
protected  void finalize()
           
protected  void initialize()
           
 org.apache.mesos.Protos.Status join()
          Waits for the driver to be stopped or aborted, possibly _blocking_ the current thread indefinitely.
 org.apache.mesos.Protos.Status run()
          Starts and immediately joins (i.e., blocks on) the driver.
 org.apache.mesos.Protos.Status sendFrameworkMessage(byte[] data)
          Sends a message to the framework scheduler.
 org.apache.mesos.Protos.Status sendStatusUpdate(org.apache.mesos.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).
 org.apache.mesos.Protos.Status start()
          See ExecutorDriver for descriptions of these.
 org.apache.mesos.Protos.Status stop()
          Stops the executor driver.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MesosExecutorDriver

public MesosExecutorDriver(Executor executor)
Creates a new driver that uses the specified Executor.

Method Detail

start

public org.apache.mesos.Protos.Status start()
See ExecutorDriver for descriptions of these.

Specified by:
start in interface ExecutorDriver

stop

public org.apache.mesos.Protos.Status stop()
Description copied from interface: ExecutorDriver
Stops the executor driver.

Specified by:
stop in interface ExecutorDriver

abort

public org.apache.mesos.Protos.Status abort()
Description copied from interface: ExecutorDriver
Aborts the driver so that no more callbacks can be made to the executor. The semantics of abort and stop have deliberately been separated so that code can detect an aborted driver (i.e., via the return status of 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).

Specified by:
abort in interface ExecutorDriver

join

public org.apache.mesos.Protos.Status join()
Description copied from interface: ExecutorDriver
Waits for the driver to be stopped or aborted, possibly _blocking_ the current thread indefinitely. The return status of this function can be used to determine if the driver was aborted (see mesos.proto for a description of Status).

Specified by:
join in interface ExecutorDriver

run

public org.apache.mesos.Protos.Status run()
Description copied from interface: ExecutorDriver
Starts and immediately joins (i.e., blocks on) the driver.

Specified by:
run in interface ExecutorDriver

sendStatusUpdate

public org.apache.mesos.Protos.Status sendStatusUpdate(org.apache.mesos.Protos.TaskStatus status)
Description copied from interface: ExecutorDriver
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). See Scheduler.statusUpdate(org.apache.mesos.SchedulerDriver, org.apache.mesos.Protos.TaskStatus) for more information about status update acknowledgements.

Specified by:
sendStatusUpdate in interface ExecutorDriver

sendFrameworkMessage

public org.apache.mesos.Protos.Status sendFrameworkMessage(byte[] data)
Description copied from interface: ExecutorDriver
Sends a message to the framework scheduler. These messages are best effort; do not expect a framework message to be retransmitted in any reliable fashion.

Specified by:
sendFrameworkMessage in interface ExecutorDriver

initialize

protected void initialize()

finalize

protected void finalize()
Overrides:
finalize in class Object


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