mesos-framework
Version:
A wrapper around the Mesos HTTP APIs for Schedulers and Executors. Write your Mesos framework in pure JavaScript!
2,850 lines (716 loc) • 41.6 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Scheduler - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Builder.html">Builder</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Executor.html">Executor</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Executor.html#message">message</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Executor.html#subscribe">subscribe</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Executor.html#update">update</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Mesos.html">Mesos</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Mesos.html#build">build</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Mesos.html#getBuilder">getBuilder</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Mesos.html#getMesos">getMesos</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Mesos.html#getProtoBuf">getProtoBuf</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Scheduler.html">Scheduler</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#accept">accept</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#acceptInverseOffers">acceptInverseOffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#acknowledge">acknowledge</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#acknowledgeOperationStatus">acknowledgeOperationStatus</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#backOff">backOff</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#decline">decline</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#declineInverseOffers">declineInverseOffers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#getRunningTasks">getRunningTasks</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#kill">kill</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#message">message</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#reconcile">reconcile</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#reconcileOperations">reconcileOperations</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#request">request</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#revive">revive</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#shutdown">shutdown</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#subscribe">subscribe</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#suppress">suppress</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#sync">sync</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Scheduler.html#teardown">teardown</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="TaskHealthHelper.html">TaskHealthHelper</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="TaskHelper.html">TaskHelper</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="TaskHelper.html#deleteTask">deleteTask</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="TaskHelper.html#loadTasks">loadTasks</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="TaskHelper.html#saveTask">saveTask</a></span></li>
</nav>
<div id="main">
<h1 class="page-title">Scheduler</h1>
<section>
<header>
<h2>
Scheduler
</h2>
</header>
<article>
<div class="container-overview">
<div class="section-method">
<h4 class="name" id="Scheduler"><span class="type-signature"></span>new Scheduler<span class="signature">(options)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Represents a Mesos framework scheduler.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line21">line 21</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
<p>The option map object.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3 class="subsection-title">Methods</h3>
<div class="section-method">
<h4 class="name" id="accept"><span class="type-signature"></span>accept<span class="signature">(offersIds, operations, filters)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Accept incoming offers to actually start the framework scheduler.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line571">line 571</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>offersIds</code></td>
<td class="type">
<span class="param-type"><code>array</code></span>
</td>
<td class="description last">
<p>The array of <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L49">OfferID</a>s which should be accepted.</p>
</td>
</tr>
<tr>
<td class="name"><code>operations</code></td>
<td class="type">
<span class="param-type"><code>array</code></span>
</td>
<td class="description last">
<p>The array of <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L1903">Operation</a> objects.</p>
</td>
</tr>
<tr>
<td class="name"><code>filters</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L2488">Filters</a> object.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="acceptInverseOffers"><span class="type-signature"></span>acceptInverseOffers<span class="signature">(inverseOffersIds, filters)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Accepts an inverse offer. Inverse offers should only be accepted if the resources in the offer can be safely evacuated before the provided unavailability.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line927">line 927</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>inverseOffersIds</code></td>
<td class="type">
<span class="param-type"><code>array</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L49">OfferID</a> array which should be sent to the server.</p>
</td>
</tr>
<tr>
<td class="name"><code>filters</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L2488">Filters</a> object which should be sent to the server.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="acknowledge"><span class="type-signature"></span>acknowledge<span class="signature">(update)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Acknowledge a status update.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line755">line 755</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>update</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
<p>The status update to acknowledge.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="acknowledgeOperationStatus"><span class="type-signature"></span>acknowledgeOperationStatus<span class="signature">(agentId, resourceProviderId, operationId, uuid)</span><span class="type-signature"></span></h4>
<div class="description">
<p>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.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line989">line 989</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>agentId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L59">AgentID</a> the task is running on.</p>
</td>
</tr>
<tr>
<td class="name"><code>resourceProviderId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L102">ResourceProviderId</a></p>
</td>
</tr>
<tr>
<td class="name"><code>operationId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L111">OperationID</a></p>
</td>
</tr>
<tr>
<td class="name"><code>uuid</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The uuid of the Operation</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="backOff"><span class="type-signature"></span>backOff<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Calculate the backOff time (for reconnection trials)</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line1094">line 1094</a>
</li></ul></dd>
</dl>
</div>
<div class="section-method">
<h4 class="name" id="decline"><span class="type-signature"></span>decline<span class="signature">(offersIds, filters)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Decline incoming offers because they are not needed by the framework scheduler currently.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line607">line 607</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>offersIds</code></td>
<td class="type">
<span class="param-type"><code>array</code></span>
</td>
<td class="description last">
<p>The array of <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L49">OfferID</a>s which should be declined.</p>
</td>
</tr>
<tr>
<td class="name"><code>filters</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L2488">Filters</a> object.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="declineInverseOffers"><span class="type-signature"></span>declineInverseOffers<span class="signature">(inverseOffersIds, filters)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Declines an inverse offer. Inverse offers should be declined if the resources in the offer might not be safely evacuated before the provided unavailability.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line957">line 957</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>inverseOffersIds</code></td>
<td class="type">
<span class="param-type"><code>array</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L49">OfferID</a> array which should be sent to the server.</p>
</td>
</tr>
<tr>
<td class="name"><code>filters</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L2488">Filters</a> object which should be sent to the server.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="getRunningTasks"><span class="type-signature"></span>getRunningTasks<span class="signature">()</span><span class="type-signature"> → {Array}</span></h4>
<div class="description">
<p>Get the running tasks of this framework scheduler.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line1048">line 1048</a>
</li></ul></dd>
</dl>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Array</code></span>
</dd>
</dl>
<div class="param-desc">
<p>The running task array.</p>
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id="kill"><span class="type-signature"></span>kill<span class="signature">(taskId, agentId)</span><span class="type-signature"></span></h4>
<div class="description">
<p>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.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line690">line 690</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>taskId</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L71">TaskID</a> to kill.</p>
</td>
</tr>
<tr>
<td class="name"><code>agentId</code></td>
<td class="type">
<span class="param-type"><code>Object</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L59">AgentID</a> the task is running on.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="message"><span class="type-signature"></span>message<span class="signature">(agentId, executorId, data)</span><span class="type-signature"></span></h4>
<div class="description">
<p>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.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line840">line 840</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>agentId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L59">AgentID</a> the task is running on.</p>
</td>
</tr>
<tr>
<td class="name"><code>executorId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L81">ExecutorID</a> which runs the task.</p>
</td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The string which's raw bytes will be encoded in Base64.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="reconcile"><span class="type-signature"></span>reconcile<span class="signature">(taskId, agentId)</span><span class="type-signature"></span></h4>
<div class="description">
<p>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.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line792">line 792</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>taskId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L71">TaskID</a> to kill.</p>
</td>
</tr>
<tr>
<td class="name"><code>agentId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L59">AgentID</a> the task is running on.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="reconcileOperations"><span class="type-signature"></span>reconcileOperations<span class="signature">(operations)</span><span class="type-signature"></span></h4>
<div class="description">
<p>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.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line1020">line 1020</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>operations</code></td>
<td class="type">
<span class="param-type"><code>array</code></span>
</td>
<td class="description last">
<p>An array of <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/scheduler/scheduler.proto#L420">Operation</a> objects to query.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="request"><span class="type-signature"></span>request<span class="signature">(requests)</span><span class="type-signature"></span></h4>
<div class="description">
<p>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.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line870">line 870</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>requests</code></td>
<td class="type">
<span class="param-type"><code>array</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L1858">Request</a> objects which should be sent to the server.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="revive"><span class="type-signature"></span>revive<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Remove any/all filters that it has previously set via ACCEPT or DECLINE calls.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line663">line 663</a>
</li></ul></dd>
</dl>
</div>
<div class="section-method">
<h4 class="name" id="shutdown"><span class="type-signature"></span>shutdown<span class="signature">(agentId, executorId)</span><span class="type-signature"></span></h4>
<div class="description">
<p>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.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line726">line 726</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>agentId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L59">AgentID</a> the task is running on.</p>
</td>
</tr>
<tr>
<td class="name"><code>executorId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L81">ExecutorID</a> whcih runs the task.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="subscribe"><span class="type-signature"></span>subscribe<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Subscribes the scheduler with the master to receive events. A scheduler must send other calls only after it has received the SUBCRIBED event.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line281">line 281</a>
</li></ul></dd>
</dl>
</div>
<div class="section-method">
<h4 class="name" id="suppress"><span class="type-signature"></span>suppress<span class="signature">(roles)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Suppress offers for the specified roles. If <code>roles</code> is empty, the <code>SUPPRESS</code> call will suppress offers for all of the roles the framework is currently subscribed to.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line898">line 898</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>roles</code></td>
<td class="type">
<span class="param-type"><code>array</code></span>
</td>
<td class="description last">
<p>The <a href="https://github.com/apache/mesos/blob/1.5.x/include/mesos/v1/mesos.proto#L3390">Role</a> objects which should be sent to the server.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section-method">
<h4 class="name" id="sync"><span class="type-signature"></span>sync<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Synchronize the tasks of this scheduler.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line1066">line 1066</a>
</li></ul></dd>
</dl>
</div>
<div class="section-method">
<h4 class="name" id="teardown"><span class="type-signature"></span>teardown<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>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.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="scheduler.js.html">scheduler.js</a>, <a href="scheduler.js.html#line639">line 639</a>
</li></ul></dd>
</dl>
</div>
</article>
</section>
</div>
<br class="clear">
<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Mar 04 2018 17:37:29 GMT+0100 (CET) using the Minami theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>