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

Class _JobDependencyManager

source code

Keeps track of job dependencies.

Instance Methods [hide private]
 
__init__(self, getstatus_fn, enqueue_fn)
Initializes this class.
source code
 
GetLockInfo(self, requested)
Retrieves information about waiting jobs.
source code
 
JobWaiting(self, job)
Checks if a job is waiting.
source code
 
CheckAndRegister(self, job, dep_job_id, dep_status)
Checks if a dependency job has the requested status.
source code
 
_RemoveEmptyWaitersUnlocked(self)
Remove all jobs without actual waiters.
source code
 
NotifyWaiters(self, job_id)
Notifies all jobs waiting for a certain job ID.
source code
Method Details [hide private]

GetLockInfo(self, requested)

source code 

Retrieves information about waiting jobs.

Parameters:
  • requested (set) - Requested information, see query.LQ_*
Decorators:
  • @locking.ssynchronized(_LOCK, shared= 1)

JobWaiting(self, job)

source code 

Checks if a job is waiting.

Decorators:
  • @locking.ssynchronized(_LOCK, shared= 1)

CheckAndRegister(self, job, dep_job_id, dep_status)

source code 

Checks if a dependency job has the requested status.

If the other job is not yet in a finalized status, the calling job will be notified (re-added to the workerpool) at a later point.

Parameters:
  • job (_QueuedJob) - Job object
  • dep_job_id (int) - ID of dependency job
  • dep_status (list) - Required status
Decorators:
  • @locking.ssynchronized(_LOCK)

NotifyWaiters(self, job_id)

source code 

Notifies all jobs waiting for a certain job ID.

Parameters:
  • job_id (int) - Job ID

Attention: Do not call until CheckAndRegister returned a status other than WAITDEP for job_id, or behaviour is undefined