Scheduler

Scheduler

new Scheduler(options)

Represents a Mesos framework scheduler.

Parameters:
Name Type Description
options object

The option map object.

Source:

Methods

accept(offers, taskInfos, filters)

Accept incoming offers to actually start the framework scheduler.

Parameters:
Name Type Description
offers array

The array of OfferIDs which should be accepted.

taskInfos array

The array of Operation objects.

filters array

The array of Filter objects.

Source:

acknowledge(update)

Acknowledge a status update.

Parameters:
Name Type Description
update object

The status update to acknowledge.

Source:

decline(offers, filters)

Decline incoming offers because they are not needed by the framework scheduler currently.

Parameters:
Name Type Description
offers array

The array of OfferIDs which should be declined.

filters array

The array of Filter objects.

Source:

getRunningTasks() → {Array}

Get the running tasks of this framework scheduler.

Source:
Returns:

The running task array.

Type
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.

Parameters:
Name Type Description
taskId Object

The TaskID to kill.

agentId Object

The AgentID the task is running on.

Source:

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.

Parameters:
Name Type Description
agentId string

The AgentID the task is running on.

executorId string

The ExecutorID whcih runs the task.

data string

The string which's raw bytes will be encoded in Base64.

Source:

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.

Parameters:
Name Type Description
taskId string

The TaskID to kill.

agentId string

The AgentID the task is running on.

Source:

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.

Parameters:
Name Type Description
requests array

The Request objects which should be sent to the server.

Source:

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.

Parameters:
Name Type Description
agentId string

The AgentID the task is running on.

executorId string

The ExecutorID whcih runs the task.

Source:

subscribe()

Subscribes the framework scheduler to the leading Mesos master.

Source:

sync()

Synchronize the tasks of this scheduler.

Source:

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: