Package ganeti :: Package jqueue
[hide private]
[frames] | no frames]

Package jqueue

source code

Module implementing the job queue handling.

Locking: there's a single, large lock in the JobQueue class. It's used by all other classes in this module.

Submodules [hide private]

Classes [hide private]
  CancelJob
Special exception to cancel a job.
  _QueuedOpCode
Encapsulates an opcode object.
  _QueuedJob
In-memory job representation.
  _OpExecCallbacks
  _TimeoutStrategyWrapper
  _OpExecContext
  _JobProcessor
  _JobQueueWorker
The actual job workers.
  _JobQueueWorkerPool
Simple class implementing a job-processing workerpool.
  _JobDependencyManager
Keeps track of job dependencies.
  JobQueue
Queue used to manage the jobs.
Functions [hide private]
tuple
TimeStampNow()
Returns the current timestamp.
source code
 
_CallJqUpdate(runner, names, file_name, content)
Updates job queue file after virtualizing filename.
source code
 
_EncodeOpError(err)
Encodes an error which occurred while processing an opcode.
source code
 
_EvaluateJobProcessorResult(depmgr, job, result)
Looks at a result from _JobProcessor for a job.
source code
Variables [hide private]
  JOBQUEUE_THREADS = 1
the number of worker threads we start for processing jobs
  _LOCK = "_lock"
  _QUEUE = "_queue"
  _GetIdAttr = operator.attrgetter("id")
Retrieves "id" attribute

Imports: logging, errno, time, weakref, threading, itertools, operator, os, pyinotify, asyncnotifier, constants, serializer, workerpool, locking, luxi, opcodes, opcodes_base, errors, mcpu, utils, jstore, rpc, runtime, netutils, compat, ht, query, qlang, pathutils, vcluster, cluster


Function Details [hide private]

TimeStampNow()

source code 

Returns the current timestamp.

Returns: tuple
the current time in the (seconds, microseconds) format

_EvaluateJobProcessorResult(depmgr, job, result)

source code 

Looks at a result from _JobProcessor for a job.

To be used in a _JobQueueWorker.