#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.
◆ loadJobState()
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().
◆ syncJobState()
void syncJobState |
( |
| ) |
const |
Sync all job state with disk.
◆ newJob() [1/2]
- 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.
◆ newJob() [2/2]
Job newJob |
( |
const QJsonObject & |
jobState | ) |
|
◆ removeJob() [1/3]
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.
◆ removeJob() [2/3]
void removeJob |
( |
IdType |
moleQueueId | ) |
|
Remove the job with the specified moleQueueId from this manager and delete it.
◆ removeJob() [3/3]
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.
◆ removeJobs() [1/2]
void removeJobs |
( |
const QList< Job > & |
jobsToRemove | ) |
|
Remove the specified jobs from this manager and delete them.
◆ removeJobs() [2/2]
void removeJobs |
( |
const QList< IdType > & |
moleQueueIds | ) |
|
Remove the jobs with the specified moleQueueIds from this manager and delete them.
◆ lookupJobByMoleQueueId()
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;
◆ jobsWithJobState()
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
◆ count()
- Returns
- Number of Job objects held by this manager.
◆ jobAt()
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
◆ indexOf()
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.
◆ itemModel()
◆ moleQueueIdChanged
Inform the QueueManager that the MoleQueue id of job has changed so that it may update its internal lookup tables.
- Parameters
-
◆ setJobState
void setJobState |
( |
MoleQueue::IdType |
jobManagerId, |
|
|
MoleQueue::JobState |
newState |
|
) |
| |
|
slot |
Set the JobState for the job with the specified MoleQueue id
◆ setJobQueueId
void setJobQueueId |
( |
MoleQueue::IdType |
jobManagerIdId, |
|
|
MoleQueue::IdType |
queueId |
|
) |
| |
|
slot |
Set the QueueId for the job with the specified MoleQueue id
◆ jobAboutToBeAdded
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.
◆ jobAdded
◆ jobStateChanged
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 |
◆ jobUpdated
Emitted when a Job's state changes.
- Parameters
-
◆ jobAboutToBeRemoved
Emitted when the job is about to be removed and deleted.
◆ jobRemoved
void jobRemoved |
( |
MoleQueue::IdType |
moleQueueId | ) |
|
|
signal |
Emitted when the job with the specified moleQueueId has been removed and deleted.
◆ lookupJobDataByMoleQueueId()
JobData* lookupJobDataByMoleQueueId |
( |
IdType |
moleQueueId | ) |
const |
|
protected |
- Returns
- The JobData with moleQueueId
◆ hasJobData()
bool hasJobData |
( |
const JobData * |
data | ) |
const |
|
protected |
- Returns
- Whether the address data is stored in m_jobs.
◆ insertJobData()
void insertJobData |
( |
JobData * |
jobdata | ) |
|
|
protected |
- Parameters
-
jobdata | Job to insert into the internal lookup structures. |
◆ m_jobs
◆ m_itemModel
Item model for interacting with jobs.
◆ m_moleQueueMap
QMap<IdType, JobData*> m_moleQueueMap |
|
protected |
Lookup table for MoleQueue ids.
The documentation for this class was generated from the following file: