new Scheduler(options)
Represents a Mesos framework scheduler.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
The option map object. |
Methods
accept(offersIds, operations, filters)
Accept incoming offers to actually start the framework scheduler.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
offersIds |
array
|
The array of OfferIDs which should be accepted. |
operations |
array
|
The array of Operation objects. |
filters |
object
|
The Filters object. |
acceptInverseOffers(inverseOffersIds, filters)
Accepts an inverse offer. Inverse offers should only be accepted if the resources in the offer can be safely evacuated before the provided unavailability.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
inverseOffersIds |
array
|
The OfferID array which should be sent to the server. |
filters |
object
|
The Filters object which should be sent to the server. |
acknowledge(update)
Acknowledge a status update.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
update |
object
|
The status update to acknowledge. |
acknowledgeOperationStatus(agentId, resourceProviderId, operationId, uuid)
Acknowledges the receipt of an operation status update. Schedulers are responsible for explicitly acknowledging the receipt of updates which have the 'UpdateOperationStatus.status().uuid()' field set. Such status updates are retried by the agent or resource provider until they are acknowledged by the scheduler.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
agentId |
string
|
The AgentID the task is running on. |
resourceProviderId |
string
|
|
operationId |
string
|
The OperationID |
uuid |
string
|
The uuid of the Operation |
decline(offersIds, filters)
Decline incoming offers because they are not needed by the framework scheduler currently.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
offersIds |
array
|
The array of OfferIDs which should be declined. |
filters |
object
|
The Filters object. |
declineInverseOffers(inverseOffersIds, filters)
Declines an inverse offer. Inverse offers should be declined if the resources in the offer might not be safely evacuated before the provided unavailability.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
inverseOffersIds |
array
|
The OfferID array which should be sent to the server. |
filters |
object
|
The Filters object which should be sent to the server. |
getRunningTasks() → {Array}
Get the running tasks of this framework scheduler.
- Source:
Returns:
- Type:
-
Array
The running task array.
kill(taskId, agentId)
Kill a specific task. If the scheduler has a custom executor, the kill is forwarded to the executor; it is up to the executor to kill the task and send a TASK_KILLED (or TASK_FAILED) update. Mesos releases the resources for a task once it receives a terminal update for the task. If the task is unknown to the master, a TASK_LOST will be generated.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
taskId |
Object
|
The TaskID to kill. |
agentId |
Object
|
The AgentID the task is running on. |
message(agentId, executorId, data)
Send arbitrary data to the executor. Note that Mesos neither interprets this data nor makes any guarantees about the delivery of this message to the executor.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
agentId |
string
|
The AgentID the task is running on. |
executorId |
string
|
The ExecutorID which runs the task. |
data |
string
|
The string which's raw bytes will be encoded in Base64. |
reconcile(taskId, agentId)
query the status of non-terminal tasks. This causes the master to send back UPDATE events for each task in the list. Tasks that are no longer known to Mesos will result in TASK_LOST updates. If the list of tasks is empty, master will send UPDATE events for all currently known tasks of the framework.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
taskId |
string
|
The TaskID to kill. |
agentId |
string
|
The AgentID the task is running on. |
reconcileOperations(operations)
Allows the scheduler to query the status of operations. This causes the master to send back the latest status for each operation in 'operations', if possible. If 'operations' is empty, then the master will send the latest status for each operation currently known.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
operations |
array
|
An array of Operation objects to query. |
request(requests)
Request resources from the master/allocator. The built-in hierarchical allocator simply ignores this request but other allocators (modules) can interpret this in a customizable fashion.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
requests |
array
|
The Request objects which should be sent to the server. |
revive()
Remove any/all filters that it has previously set via ACCEPT or DECLINE calls.
- Source:
shutdown(agentId, executorId)
shutdown a specific custom executor (NOTE: This is a new call that was not present in the old API). When an executor gets a shutdown event, it is expected to kill all its tasks (and send TASK_KILLED updates) and terminate. If an executor doesn’t terminate within a certain timeout (configurable via “–executor_shutdown_grace_period” agent flag), the agent will forcefully destroy the container (executor and its tasks) and transitions its active tasks to TASK_LOST.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
agentId |
string
|
The AgentID the task is running on. |
executorId |
string
|
The ExecutorID whcih runs the task. |
subscribe()
Subscribes the scheduler with the master to receive events. A scheduler must send other calls only after it has received the SUBCRIBED event.
- Source:
suppress(roles)
Suppress offers for the specified roles. If roles
is empty, the SUPPRESS
call will suppress offers for all of the roles the framework is currently subscribed to.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
roles |
array
|
The Role objects which should be sent to the server. |
teardown()
Tear down the framework scheduler. When Mesos receives this request it will shut down all executors (and consequently kill tasks). It then removes the framework and closes all open connections from this scheduler to the Master.
- Source: