public interface SchedulerDriver
Modifier and Type | Method and Description |
---|---|
Protos.Status |
abort()
Aborts the driver so that no more callbacks can be made to the
scheduler.
|
Protos.Status |
acceptOffers(java.util.Collection<Protos.OfferID> offerIds,
java.util.Collection<Protos.Offer.Operation> operations,
Protos.Filters filters)
Accepts the given offers and performs a sequence of operations on
those accepted offers.
|
Protos.Status |
acknowledgeStatusUpdate(Protos.TaskStatus status)
Acknowledges the status update.
|
Protos.Status |
declineOffer(Protos.OfferID offerId)
Declines an offer in its entirety.
|
Protos.Status |
declineOffer(Protos.OfferID offerId,
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).
|
Protos.Status |
join()
Waits for the driver to be stopped or aborted, possibly
blocking the current thread indefinitely.
|
Protos.Status |
killTask(Protos.TaskID taskId)
Kills the specified task.
|
Protos.Status |
launchTasks(java.util.Collection<Protos.OfferID> offerIds,
java.util.Collection<Protos.TaskInfo> tasks)
Launches the given set of tasks.
|
Protos.Status |
launchTasks(java.util.Collection<Protos.OfferID> offerIds,
java.util.Collection<Protos.TaskInfo> tasks,
Protos.Filters filters)
Launches the given set of tasks.
|
Protos.Status |
launchTasks(Protos.OfferID offerId,
java.util.Collection<Protos.TaskInfo> tasks)
Deprecated.
Use
launchTasks(Collection, Collection) instead.
Note that this may add a default filter (see mesos.proto)
for the remaining resources. Notably the MesosSchedulerDriver
does so. |
Protos.Status |
launchTasks(Protos.OfferID offerId,
java.util.Collection<Protos.TaskInfo> tasks,
Protos.Filters filters)
Deprecated.
Use
#launchTasks(Collection, Collection, Filters) instead. |
Protos.Status |
reconcileTasks(java.util.Collection<Protos.TaskStatus> statuses)
Allows the framework to query the status for non-terminal tasks.
|
Protos.Status |
requestResources(java.util.Collection<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).
|
Protos.Status |
reviveOffers()
Removes all filters previously set by the framework (via launchTasks()
or declineOffer()) and clears the set of suppressed roles.
|
Protos.Status |
reviveOffers(java.util.Collection<java.lang.String> roles)
Removes filters for the specified roles and removes these roles from
the suppressed set.
|
Protos.Status |
run()
Starts and immediately joins (i.e., blocks on) the driver.
|
Protos.Status |
sendFrameworkMessage(Protos.ExecutorID executorId,
Protos.SlaveID slaveId,
byte[] data)
Sends a message from the framework to one of its executors.
|
Protos.Status |
start()
Starts the scheduler driver.
|
Protos.Status |
stop()
Stops the scheduler driver assuming no failover.
|
Protos.Status |
stop(boolean failover)
Stops the scheduler driver.
|
Protos.Status |
suppressOffers()
Informs Mesos master to stop sending offers to the framework (i.e.
|
Protos.Status |
suppressOffers(java.util.Collection<java.lang.String> roles)
Adds the roles to the suppressed set.
|
Protos.Status |
updateFramework(Protos.FrameworkInfo frameworkInfo,
java.util.Collection<java.lang.String> suppressedRoles)
Deprecated.
To call UPDATE_FRAMEWORK without setting offer constraints,
use the new `updateFramework()` signature and pass empty constraints
(for example, the ones returned by `OfferConstraints.getDefaultInstance()`).
|
Protos.Status |
updateFramework(Protos.FrameworkInfo frameworkInfo,
java.util.Collection<java.lang.String> suppressedRoles,
org.apache.mesos.scheduler.Protos.OfferConstraints offerConstraints) |
Protos.Status start()
Protos.Status
Protos.Status stop(boolean failover)
failover
- Whether framework failover is expected.Protos.Status
Protos.Status stop()
stop(boolean)
for more details.Protos.Status abort()
join()
, see below), and instantiate
and start another driver if desired (from within the same
process).Protos.Status join()
Protos.Status run()
Protos.Status requestResources(java.util.Collection<Protos.Request> requests)
Scheduler.resourceOffers(org.apache.mesos.SchedulerDriver, java.util.List<org.apache.mesos.Protos.Offer>)
callback,
asynchronously.requests
- The resource requests.Protos.Request
,
Protos.Status
Protos.Status launchTasks(java.util.Collection<Protos.OfferID> offerIds, java.util.Collection<Protos.TaskInfo> tasks, Protos.Filters filters)
declineOffer(org.apache.mesos.Protos.OfferID, org.apache.mesos.Protos.Filters)
).offerIds
- The collection of offer IDs.tasks
- The collection of tasks to be launched.filters
- The filters to set for any remaining resources.Protos.OfferID
,
Protos.TaskInfo
,
Protos.Filters
,
Protos.Status
Protos.Status launchTasks(java.util.Collection<Protos.OfferID> offerIds, java.util.Collection<Protos.TaskInfo> tasks)
offerIds
- The collection of offer IDs.tasks
- The collection of tasks to be launched.Protos.Status launchTasks(Protos.OfferID offerId, java.util.Collection<Protos.TaskInfo> tasks, Protos.Filters filters)
#launchTasks(Collection, Collection, Filters)
instead.offerId
- The offer ID.tasks
- The collection of tasks to be launched.filters
- The filters to set for any remaining resources.Protos.Status launchTasks(Protos.OfferID offerId, java.util.Collection<Protos.TaskInfo> tasks)
launchTasks(Collection, Collection)
instead.
Note that this may add a default filter (see mesos.proto)
for the remaining resources. Notably the MesosSchedulerDriver
does so.offerId
- The offer ID.tasks
- The collection of tasks to be launched.Protos.Status killTask(Protos.TaskID taskId)
taskId
- The ID of the task to be killed.Protos.Status acceptOffers(java.util.Collection<Protos.OfferID> offerIds, java.util.Collection<Protos.Offer.Operation> operations, Protos.Filters filters)
offerIds
- The collection of offer IDs.operations
- The collection of offer operations to perform.filters
- The filters to set for any remaining resources.Protos.OfferID
,
Offer.Operation
,
Protos.Filters
,
Protos.Status
Protos.Status declineOffer(Protos.OfferID offerId, Protos.Filters filters)
Scheduler.resourceOffers(org.apache.mesos.SchedulerDriver, java.util.List<org.apache.mesos.Protos.Offer>)
callback.offerId
- The ID of the offer to be declined.filters
- The filters to set for any remaining resources.Protos.OfferID
,
Protos.Filters
,
Protos.Status
Protos.Status declineOffer(Protos.OfferID offerId)
offerId
- The ID of the offer to be declined.Protos.OfferID
,
Protos.Status
Protos.Status reviveOffers()
Protos.Status
Protos.Status reviveOffers(java.util.Collection<java.lang.String> roles)
roles
- The collection of the framework roles to be revivied.
If empty, this method does nothing.Protos.Status
Protos.Status suppressOffers()
Protos.Status
Protos.Status suppressOffers(java.util.Collection<java.lang.String> roles)
roles
- The collection of framework roles to be suppressed.
If empty, the method does nothing.Protos.Status
Protos.Status acknowledgeStatusUpdate(Protos.TaskStatus status)
status
- The status to acknowledge.Protos.TaskStatus
Protos.Status sendFrameworkMessage(Protos.ExecutorID executorId, Protos.SlaveID slaveId, byte[] data)
executorId
- The ID of the executor to send the message to.slaveId
- The ID of the slave that is running the executor.data
- The message.Protos.ExecutorID
,
Protos.SlaveID
Protos.Status reconcileTasks(java.util.Collection<Protos.TaskStatus> statuses)
statuses
- The collection of non-terminal TaskStatuses to reconcile.Protos.TaskStatus
,
Protos.SlaveID
Protos.Status updateFramework(Protos.FrameworkInfo frameworkInfo, java.util.Collection<java.lang.String> suppressedRoles, org.apache.mesos.scheduler.Protos.OfferConstraints offerConstraints)
@Deprecated Protos.Status updateFramework(Protos.FrameworkInfo frameworkInfo, java.util.Collection<java.lang.String> suppressedRoles)