|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mesos.MesosSchedulerDriver
public class MesosSchedulerDriver
Concrete implementation of a SchedulerDriver that connects a
Scheduler with a Mesos master. The MesosSchedulerDriver is
thread-safe.
Note that scheduler failover is supported in Mesos. After a
scheduler is registered with Mesos it may failover (to a new
process on the same machine or across multiple machines) by
creating a new driver with the ID given to it in Scheduler.registered(org.apache.mesos.SchedulerDriver, org.apache.mesos.Protos.FrameworkID, org.apache.mesos.Protos.MasterInfo).
The driver is responsible for invoking the Scheduler callbacks as
it communicates with the Mesos master.
Note that blocking on the MesosSchedulerDriver (e.g., via join()) doesn't affect the scheduler callbacks in anyway because
they are handled by a different thread.
See src/examples/java/TestFramework.java for an example of using
the MesosSchedulerDriver.
| Constructor Summary | |
|---|---|
MesosSchedulerDriver(Scheduler scheduler,
org.apache.mesos.Protos.FrameworkInfo framework,
String master)
Creates a new driver for the specified scheduler. |
|
MesosSchedulerDriver(Scheduler scheduler,
org.apache.mesos.Protos.FrameworkInfo framework,
String master,
org.apache.mesos.Protos.Credential credential)
Same as the above constructor, except that it accepts 'credential' as a parameter. |
|
| Method Summary | |
|---|---|
org.apache.mesos.Protos.Status |
abort()
Aborts the driver so that no more callbacks can be made to the scheduler. |
org.apache.mesos.Protos.Status |
declineOffer(org.apache.mesos.Protos.OfferID offerId)
Declines an offer in its entirety. |
org.apache.mesos.Protos.Status |
declineOffer(org.apache.mesos.Protos.OfferID offerId,
org.apache.mesos.Protos.Filters filters)
Declines an offer in its entirety and applies the specified filters on the resources (see mesos.proto for a description of Filters). |
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 |
killTask(org.apache.mesos.Protos.TaskID taskId)
Kills the specified task. |
org.apache.mesos.Protos.Status |
launchTasks(Collection<org.apache.mesos.Protos.OfferID> offerIds,
Collection<org.apache.mesos.Protos.TaskInfo> tasks)
Launches the given set of tasks. |
org.apache.mesos.Protos.Status |
launchTasks(Collection<org.apache.mesos.Protos.OfferID> offerIds,
Collection<org.apache.mesos.Protos.TaskInfo> tasks,
org.apache.mesos.Protos.Filters filters)
Launches the given set of tasks on a set of offers. |
org.apache.mesos.Protos.Status |
launchTasks(org.apache.mesos.Protos.OfferID offerId,
Collection<org.apache.mesos.Protos.TaskInfo> tasks)
Deprecated. Replaced by launchTasks using offer list. |
org.apache.mesos.Protos.Status |
launchTasks(org.apache.mesos.Protos.OfferID offerId,
Collection<org.apache.mesos.Protos.TaskInfo> tasks,
org.apache.mesos.Protos.Filters filters)
Deprecated. Replaced by launchTasks using offer list. |
org.apache.mesos.Protos.Status |
reconcileTasks(Collection<org.apache.mesos.Protos.TaskStatus> statuses)
Reconciliation of tasks causes the master to send status updates for tasks whose status differs from the status sent here. |
org.apache.mesos.Protos.Status |
requestResources(Collection<org.apache.mesos.Protos.Request> requests)
Requests resources from Mesos (see mesos.proto for a description of Request and how, for example, to request resources from specific slaves). |
org.apache.mesos.Protos.Status |
reviveOffers()
Removes all filters, previously set by the framework (via SchedulerDriver.launchTasks(java.util.Collection). |
org.apache.mesos.Protos.Status |
run()
Starts and immediately joins (i.e., blocks on) the driver. |
org.apache.mesos.Protos.Status |
sendFrameworkMessage(org.apache.mesos.Protos.ExecutorID executorId,
org.apache.mesos.Protos.SlaveID slaveId,
byte[] data)
Sends a message from the framework to one of its executors. |
org.apache.mesos.Protos.Status |
start()
See SchedulerDriver for descriptions of these. |
org.apache.mesos.Protos.Status |
stop()
Stops the scheduler driver assuming no failover. |
org.apache.mesos.Protos.Status |
stop(boolean failover)
Stops the scheduler driver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MesosSchedulerDriver(Scheduler scheduler,
org.apache.mesos.Protos.FrameworkInfo framework,
String master)
public MesosSchedulerDriver(Scheduler scheduler,
org.apache.mesos.Protos.FrameworkInfo framework,
String master,
org.apache.mesos.Protos.Credential credential)
| Method Detail |
|---|
public org.apache.mesos.Protos.Status start()
start in interface SchedulerDriverpublic org.apache.mesos.Protos.Status stop(boolean failover)
SchedulerDriver
stop in interface SchedulerDriverpublic org.apache.mesos.Protos.Status stop()
SchedulerDriver
stop in interface SchedulerDriverpublic org.apache.mesos.Protos.Status abort()
SchedulerDriverSchedulerDriver.join(), see below), and instantiate
and start another driver if desired (from within the same
process).
abort in interface SchedulerDriverpublic org.apache.mesos.Protos.Status join()
SchedulerDriver
join in interface SchedulerDriverpublic org.apache.mesos.Protos.Status run()
SchedulerDriver
run in interface SchedulerDriverpublic org.apache.mesos.Protos.Status requestResources(Collection<org.apache.mesos.Protos.Request> requests)
SchedulerDriverScheduler.resourceOffers(org.apache.mesos.SchedulerDriver, java.util.List) callback,
asynchronously.
requestResources in interface SchedulerDriver
public org.apache.mesos.Protos.Status launchTasks(org.apache.mesos.Protos.OfferID offerId,
Collection<org.apache.mesos.Protos.TaskInfo> tasks)
launchTasks in interface SchedulerDriver
public org.apache.mesos.Protos.Status launchTasks(org.apache.mesos.Protos.OfferID offerId,
Collection<org.apache.mesos.Protos.TaskInfo> tasks,
org.apache.mesos.Protos.Filters filters)
launchTasks in interface SchedulerDriver
public org.apache.mesos.Protos.Status launchTasks(Collection<org.apache.mesos.Protos.OfferID> offerIds,
Collection<org.apache.mesos.Protos.TaskInfo> tasks)
SchedulerDriver
launchTasks in interface SchedulerDriver
public org.apache.mesos.Protos.Status launchTasks(Collection<org.apache.mesos.Protos.OfferID> offerIds,
Collection<org.apache.mesos.Protos.TaskInfo> tasks,
org.apache.mesos.Protos.Filters filters)
SchedulerDriverSchedulerDriver.declineOffer(org.apache.mesos.Protos.OfferID, org.apache.mesos.Protos.Filters).
launchTasks in interface SchedulerDriverpublic org.apache.mesos.Protos.Status killTask(org.apache.mesos.Protos.TaskID taskId)
SchedulerDriver
killTask in interface SchedulerDriverpublic org.apache.mesos.Protos.Status declineOffer(org.apache.mesos.Protos.OfferID offerId)
SchedulerDriver
declineOffer in interface SchedulerDriver
public org.apache.mesos.Protos.Status declineOffer(org.apache.mesos.Protos.OfferID offerId,
org.apache.mesos.Protos.Filters filters)
SchedulerDriverScheduler.resourceOffers(org.apache.mesos.SchedulerDriver, java.util.List)
callback.
declineOffer in interface SchedulerDriverpublic org.apache.mesos.Protos.Status reviveOffers()
SchedulerDriverSchedulerDriver.launchTasks(java.util.Collection, java.util.Collection, org.apache.mesos.Protos.Filters) ). This enables the framework to receive offers
from those filtered slaves.
reviveOffers in interface SchedulerDriver
public org.apache.mesos.Protos.Status sendFrameworkMessage(org.apache.mesos.Protos.ExecutorID executorId,
org.apache.mesos.Protos.SlaveID slaveId,
byte[] data)
SchedulerDriver
sendFrameworkMessage in interface SchedulerDriverpublic org.apache.mesos.Protos.Status reconcileTasks(Collection<org.apache.mesos.Protos.TaskStatus> statuses)
SchedulerDriver
reconcileTasks in interface SchedulerDriverprotected void initialize()
protected void finalize()
finalize in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||