Trees | Indices | Help |
|
---|
|
Queue used to manage the jobs.
|
|||
|
|||
|
|||
|
|||
|
|||
(list, list) |
|
||
|
|||
|
|||
str |
|
||
list |
|
||
_QueuedJob or None |
|
||
_QueuedJob or None |
|
||
_QueuedJob or None |
|
||
|
|||
|
|||
_QueuedJob |
|
||
|
|||
|
|||
|
|||
tuple (job info, log entries) |
|
||
|
|||
int |
|
||
bool |
|
||
|
|||
list |
|
||
|
|||
Inherited from |
|
|||
str |
|
||
str |
|
|
|||
|
|||
str |
|
||
str |
|
||
boolean |
|
|
|||
_RE_JOB_FILE = re.compile(r"^job-(%s)$" % constants.JOB_ID_TEM regex matching the valid job file names |
|
|||
Inherited from |
|
Constructor for JobQueue. The constructor will initialize the job queue object and then start loading the current jobs from disk, either for starting them (if they were queue) or for aborting them (if they were already running).
|
Loads the whole job queue and resumes unfinished jobs. This function needs the lock here because WorkerPool.AddTask() may start a job while we're still doing our work.
|
Register a new node with the queue.
|
Callback called when removing nodes from the cluster.
|
Verifies the status of an RPC call. Since we aim to keep consistency should this node (the current master) fail, we will log errors if our rpc fail, and especially log the case when more than half of the nodes fails.
|
Helper for returning the node name/ip list.
|
Writes a file locally and then replicates it to all nodes. This function will replace the contents of a file on the local node and then replicate it to all the other nodes we have.
|
Renames a file locally and then replicate the change. This function will rename a file in the local queue directory and then replicate this rename to all the other nodes we have.
|
Convert a job ID to string format. Currently this just does
|
Returns the archive directory for a job.
|
Generates a new job identifier. Job identifiers are unique during the lifetime of a cluster.
|
Returns the job file for a given job id.
|
Returns the archived job file for a give job id.
|
Return all known job IDs. The method only looks at disk because it's a requirement that all jobs are present on disk (so in the _memcache we don't have any extra IDs).
|
Loads a job from the disk or memory. Given a job id, this will return the cached job object if existing, or try to load the job from the disk. If loading from disk, it will also add the job to the cache.
|
Load the given job file from disk. Given a job file, read, load and restore it in a _QueuedJob format.
|
Load the given job file from disk. Given a job file, read, load and restore it in a _QueuedJob format. In case of error reading the job, it gets returned as None, and the exception is logged.
|
Check if the queue is marked from drain. This currently uses the queue drain file, which makes it a per-node flag. In the future this can be moved to the config file.
|
Sets the drain flag for the queue.
|
Create and store a new job. This enters the job into our job queue and also puts it on the new queue, in order for it to be picked up by the queue processors.
|
Create and store a new job.
See Also: _SubmitJobUnlocked |
Create and store multiple jobs.
See Also: _SubmitJobUnlocked |
Update a job's on disk storage. After a job has been modified, this function needs to be called in order to write the changes to disk and replicate them to the other nodes.
|
Waits for changes in a job.
|
Cancels a job. This will only succeed if the job has not started yet.
|
Archives jobs.
|
Archives a job. This is just a wrapper over _ArchiveJobsUnlocked.
|
Archives all jobs based on age. The method will archive all jobs which are older than the age parameter. For jobs that don't have an end timestamp, the start timestamp will be considered. The special '-1' age will cause archival of all jobs (that are not running or queued).
|
Returns a list of jobs in queue.
|
Stops the job queue. This shutdowns all the worker threads an closes the queue.
|
|
_RE_JOB_FILEregex matching the valid job file names
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Dec 9 15:55:44 2010 | http://epydoc.sourceforge.net |