Package Ganga :: Package Core :: Package JobRepository :: Module Base :: Class JobRepository
[hide private]
[frames] | no frames]

Class JobRepository

source code

object --+
         |
        JobRepository
Known Subclasses:

JobRepository class is an interface for developers, that need to access jobs/job attributes stored in the database. Implementation details are given in the derived class.

Instance Methods [hide private]
 
__init__(self, schema, role, streamer=None, tree_streamer=None)
schema is a subset of job schema.
source code
 
_getStreamFromJob(self, job) source code
 
_getJobFromStream(self, stream) source code
 
registerJobs(self, jobs)
registerJobs(self, jobs) --> None throws RepositoryError jobs -- list of jobs to register
source code
 
commitJobs(self, jobs)
commitJobs(self, jobs) --> None throws RepositoryError jobs -- list of jobs to commit jobs must already be registered
source code
 
checkoutJobs(self, ids_or_attributes)
checkoutJobs(self, ids_or_attributes) --> list of jobs throws RepositoryError ids_or_attributes -- list of job ids or dictionary of job attributes saved in the DB as metadata.
source code
 
deleteJobs(self, ids)
deleteJob(self, ids) --> None throws RepositoryError ids -- list of job ids
source code
 
getJobIds(self, ids_or_attributes)
getJobIds(self, ids_or_attributes) --> list of ids for the jobs having specified attributes.
source code
 
getJobAttributes(self, ids_or_attributes)
getJobAttributes(self, ids_or_attributes) --> list of dictionaries with job metadata stored in the registry.
source code
 
setJobsStatus(self, statusList)
setJobsStatus(self, statusList) --> None throws RepositoryError statusList -- list of tuples (<jobId>, <status>) Supposed to be used by JobManager
source code
 
getJobsStatus(self, ids_or_attributes)
getJobsStatus(self, ids_or_attributes) --> list of tuples, indicating jobid and job status: (id, status).
source code
 
getJobTree(self, tree_id=0)
getJobTree(self, tree_id = 0) --> jobtree object.
source code
 
setJobTree(self, jobtree, tree_id=0)
setJobTree(self, jobtree, tree_id = 0) --> None.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, schema, role, streamer=None, tree_streamer=None)
(Constructor)

source code 

schema is a subset of job schema. It should be list of tuples (attr, dbtype), where attr is a name of attribute, and dbtype is database specific type. role can be 'Client' or 'JobManager'. 'Client' can only modify job status of 'new' jobs streamer is an object which converts job dictionary into a string and vice versa. tree_streamer is an object which converts jobtree into a string and vice versa.

Overrides: object.__init__

checkoutJobs(self, ids_or_attributes)

source code 

checkoutJobs(self, ids_or_attributes) --> list of jobs throws RepositoryError ids_or_attributes -- list of job ids or dictionary of job attributes saved in the DB as metadata. Example of attributes: attributes = {'status':'submitted', 'application':'DaVinci'}

getJobIds(self, ids_or_attributes)

source code 

getJobIds(self, ids_or_attributes) --> list of ids for the jobs having specified attributes. throws RepositoryError ids_or_attributes -- list of job ids or dictionary of job attributes saved in the DB as metadata. Example of attributes: attributes = {'status':'submitted', 'application':'DaVinci'}

getJobAttributes(self, ids_or_attributes)

source code 

getJobAttributes(self, ids_or_attributes) --> list of dictionaries with job metadata stored in the registry. throws RepositoryError ids_or_attributes -- list of job ids or dictionary of job attributes saved in the DB as metadata. Example of attributes: attributes = {'status':'submitted', 'application':'DaVinci'}

getJobsStatus(self, ids_or_attributes)

source code 

getJobsStatus(self, ids_or_attributes) --> list of tuples, indicating jobid and job status: (id, status). throws RepositoryError ids_or_attributes -- list of job ids or dictionary of job attributes saved in the DB as metadata. Example of attributes: attributes = {'application':'DaVinci'}

getJobTree(self, tree_id=0)

source code 

getJobTree(self, tree_id = 0) --> jobtree object. throws RepositoryError. tree_id - id of jobtree in registry. Can be used to support back up

setJobTree(self, jobtree, tree_id=0)

source code 

setJobTree(self, jobtree, tree_id = 0) --> None. throws RepositoryError. Registers and/or modifies jobtree object in the repository. jobtree - jobtree object tree_id - id of jobtree in registry. Can be used to support back up