webgme-engine
Version:
WebGME server and Client API without a GUI
174 lines (137 loc) • 7.55 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: common/executor/JobInfo.js</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="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: common/executor/JobInfo.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/*globals define*/
/*eslint-env node*/
/**
* @author lattmann / https://github.com/lattmann
*/
define([], function () {
'use strict';
/**
* Class describing an executor job. The data is used for communication between the
* initiator/a monitor of the job and the worker executing the job.
*
* @param {object} parameters
* @param {hash} parameters.hash - Job identifier.
* @constructor
* @alias JobInfo
*/
var JobInfo = function (parameters) {
/**
* Job identifier.
* @type {string}
*/
this.hash = parameters.hash;
/**
* Array of hashes to {@link Artifact}s containing each requested result.
* @type {string[]}
*/
this.resultHashes = parameters.resultHashes || [];
/**
* Hash to an {@link Artifact} containing the union of all requests results.
* @type {string}
*/
this.resultSuperSet = parameters.resultSuperSet || null;
this.userId = parameters.userId || [];
/**
* Current status of the job.
* @type {string}
*/
this.status = parameters.status || null;
/**
* Timestamp of when the job was created.
* @type {string}
*/
this.createTime = parameters.createTime || null;
/**
* Timestamp of when the job execution started by a worker.
* @type {string}
*/
this.startTime = parameters.startTime || null;
/**
* Timestamp of when the job execution finished on the worker.
* @type {string}
*/
this.finishTime = parameters.finishTime || null;
/**
* Id/label of the worker processing the job.
* @type {string}
*/
this.worker = parameters.worker || null;
/**
* Array of labels for the job.
* @type {string[]}
*/
this.labels = parameters.labels || [];
/**
* The (id) outputNumber (0, 1, 2, ...) of the latest {@link OutputInfo} (for this job) available on the server.
* When no output is available the number is <b>null</b>.
* @type {number}
*/
this.outputNumber = typeof parameters.outputNumber === 'number' ? parameters.outputNumber : null;
};
/**
* Array of statuses where the job hash finished and won't proceed.
* @type {string[]}
*/
JobInfo.finishedStatuses = [
'SUCCESS',
'CANCELED',
'FAILED_TO_EXECUTE',
'FAILED_TO_GET_SOURCE_METADATA',
'FAILED_SOURCE_COULD_NOT_BE_OBTAINED',
'FAILED_CREATING_SOURCE_ZIP',
'FAILED_UNZIP',
'FAILED_EXECUTOR_CONFIG',
'FAILED_TO_ARCHIVE_FILE',
'FAILED_TO_SAVE_JOINT_ARTIFACT',
'FAILED_TO_ADD_OBJECT_HASHES',
'FAILED_TO_SAVE_ARTIFACT'];
/**
* Returns true of the provided status is a finished status.
* @param {string} status - The status of a job.
* @returns {boolean}
*/
JobInfo.isFinishedStatus = function (status) {
return JobInfo.finishedStatuses.indexOf(status) !== -1;
};
/**
* Returns true if the provided status is a failed finished status.
* @param {string} status - The status of a job.
* @returns {boolean}
*/
JobInfo.isFailedFinishedStatus = function (status) {
return JobInfo.isFinishedStatus(status) && status !== 'SUCCESS';
};
return JobInfo;
});</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="Server_GMEAuth.html">Server:GMEAuth</a></li><li><a href="Server_SafeStorage.html">Server:SafeStorage</a></li><li><a href="Server_UserProject.html">Server:UserProject</a></li><li><a href="module-Core.html">Core</a></li><li><a href="module-Storage.html">Storage</a></li><li><a href="module-crosscuts.html">crosscuts</a></li><li><a href="module-serialization.html">serialization</a></li></ul><h3>Externals</h3><ul><li><a href="external-Promise.html">Promise</a></li></ul><h3>Classes</h3><ul><li><a href="AddOnBase.html">AddOnBase</a></li><li><a href="AddOnUpdateResult.html">AddOnUpdateResult</a></li><li><a href="Artifact.html">Artifact</a></li><li><a href="BlobClient.html">BlobClient</a></li><li><a href="BlobMetadata.html">BlobMetadata</a></li><li><a href="BlobRunPluginClient.html">BlobRunPluginClient</a></li><li><a href="Client.html">Client</a></li><li><a href="Core.html">Core</a></li><li><a href="ExecutorClient.html">ExecutorClient</a></li><li><a href="GMENode.html">GMENode</a></li><li><a href="GmeLogger.html">GmeLogger</a></li><li><a href="InterPluginResult.html">InterPluginResult</a></li><li><a href="JobInfo.html">JobInfo</a></li><li><a href="OutputInfo.html">OutputInfo</a></li><li><a href="PluginBase.html">PluginBase</a></li><li><a href="PluginConfig.html">PluginConfig</a></li><li><a href="PluginMessage.html">PluginMessage</a></li><li><a href="PluginNodeDescription.html">PluginNodeDescription</a></li><li><a href="PluginResult.html">PluginResult</a></li><li><a href="Project.html">Project</a></li><li><a href="ProjectInterface.html">ProjectInterface</a></li><li><a href="Server_GMEAuth-GMEAuth.html">GMEAuth</a></li><li><a href="Server_SafeStorage-SafeStorage.html">SafeStorage</a></li><li><a href="Server_UserProject-UserProject.html">UserProject</a></li><li><a href="WebsocketRouter.html">WebsocketRouter</a></li><li><a href="WebsocketRouterUser.html">WebsocketRouterUser</a></li></ul><h3>Events</h3><ul><li><a href="Client.html#event:BRANCH_CHANGED">BRANCH_CHANGED</a></li><li><a href="Client.html#event:BRANCH_CLOSED">BRANCH_CLOSED</a></li><li><a href="Client.html#event:BRANCH_OPENED">BRANCH_OPENED</a></li><li><a href="Client.html#event:BRANCH_STATUS_CHANGED">BRANCH_STATUS_CHANGED</a></li><li><a href="Client.html#event:CONNECTED_USERS_CHANGED">CONNECTED_USERS_CHANGED</a></li><li><a href="Client.html#event:NETWORK_STATUS_CHANGED">NETWORK_STATUS_CHANGED</a></li><li><a href="Client.html#event:NOTIFICATION">NOTIFICATION</a></li><li><a href="Client.html#event:PLUGIN_FINISHED">PLUGIN_FINISHED</a></li><li><a href="Client.html#event:PLUGIN_INITIATED">PLUGIN_INITIATED</a></li><li><a href="Client.html#event:PLUGIN_NOTIFICATION">PLUGIN_NOTIFICATION</a></li><li><a href="Client.html#event:PROJECT_CLOSED">PROJECT_CLOSED</a></li><li><a href="Client.html#event:PROJECT_OPENED">PROJECT_OPENED</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Fri Jun 21 2024 09:43:40 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>