#include <molequeue/jobmanager.h>
|
|
Methods to change properties of jobs.
|
void | setJobState (MoleQueue::IdType jobManagerId, MoleQueue::JobState newState) |
|
void | setJobQueueId (MoleQueue::IdType jobManagerIdId, MoleQueue::IdType queueId) |
|
Owns and manages JobData objects.
- Author
- David C. Lonie
The JobManager class owns all JobData objects. At least two JobManager objects exist during normal operation; the Client class holds a JobManager to track all jobs belonging to that client, and the Server class of the MoleQueue server holds a JobManager to track all jobs that it is managing.
void loadJobState |
( |
const QString & |
path | ) |
|
Locate jobs from the subdirectories in path. This function will look in all immediate subdirectories of path and load mqjobinfo.json files with JobData::load().
void syncJobState |
( |
| ) |
const |
Sync all job state with disk.
- Returns
- Insert a new JobData object into the JobManager's jobMap. The JobData is set to default values and a Job reference to it is returned.
Job newJob |
( |
const QJsonObject & |
jobState | ) |
|
void removeJob |
( |
JobData * |
jobdata | ) |
|
Remove the specified jobdata from this manager and delete it. All Job objects with job's MoleQueue id will be invalidated.
void removeJob |
( |
IdType |
moleQueueId | ) |
|
Remove the job with the specified moleQueueId from this manager and delete it.
void removeJob |
( |
const Job & |
job | ) |
|
Remove the specified job from this manager and delete it. All Job objects with job's MoleQueue id will be invalidated.
void removeJobs |
( |
const QList< Job > & |
jobsToRemove | ) |
|
Remove the specified jobs from this manager and delete them.
void removeJobs |
( |
const QList< IdType > & |
moleQueueIds | ) |
|
Remove the jobs with the specified moleQueueIds from this manager and delete them.
Job lookupJobByMoleQueueId |
( |
IdType |
moleQueueId | ) |
const |
- Parameters
-
moleQueueId | The MoleQueue Id of the requested Job. |
- Returns
- The Job with the requested MoleQueue Id.
- Note
- If no such Job exists, Job::isValid() will return false;
QList<Job> jobsWithJobState |
( |
MoleQueue::JobState |
state | ) |
|
Return a list of Job objects that have JobState state.
- Parameters
-
state | JobState of interests |
- Returns
- List of Job objects with JobState state
- Returns
- Number of Job objects held by this manager.
Index based job look up. Use with count() to iterate over all Jobs in the manager. Jobs are not sorted in any particular order.
- Returns
- The job with index i
int indexOf |
( |
const Job & |
job | ) |
const |
Lookup iteratible index of Job &job. Compatible with count() and jobAt().
- Returns
- index of job, or -1 if job is invalid.
Inform the QueueManager that the MoleQueue id of job has changed so that it may update its internal lookup tables.
- Parameters
-
void setJobState |
( |
MoleQueue::IdType |
jobManagerId, |
|
|
MoleQueue::JobState |
newState |
|
) |
| |
|
slot |
Set the JobState for the job with the specified MoleQueue id
void setJobQueueId |
( |
MoleQueue::IdType |
jobManagerIdId, |
|
|
MoleQueue::IdType |
queueId |
|
) |
| |
|
slot |
Set the QueueId for the job with the specified MoleQueue id
Emitted when a job is about to be inserted. Client and MainWindow should directly connect slots to this signal which will set the molequeue id and local working directory.
void jobStateChanged |
( |
const MoleQueue::Job & |
job, |
|
|
MoleQueue::JobState |
oldState, |
|
|
MoleQueue::JobState |
newState |
|
) |
| |
|
signal |
Emitted when a Job changes JobState.
- Parameters
-
job | Job object |
oldState | Previous state of job |
newState | New state of job |
Emitted when a Job's state changes.
- Parameters
-
Emitted when the job is about to be removed and deleted.
void jobRemoved |
( |
MoleQueue::IdType |
moleQueueId | ) |
|
|
signal |
Emitted when the job with the specified moleQueueId has been removed and deleted.
JobData* lookupJobDataByMoleQueueId |
( |
IdType |
moleQueueId | ) |
const |
|
protected |
- Returns
- The JobData with moleQueueId
bool hasJobData |
( |
const JobData * |
data | ) |
const |
|
protected |
- Returns
- Whether the address data is stored in m_jobs.
void insertJobData |
( |
JobData * |
jobdata | ) |
|
|
protected |
- Parameters
-
jobdata | Job to insert into the internal lookup structures. |
Item model for interacting with jobs.
QMap<IdType, JobData*> m_moleQueueMap |
|
protected |
Lookup table for MoleQueue ids.
The documentation for this class was generated from the following file: