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

Class ARDARepositoryMixIn

source code

        object --+    
                 |    
Base.JobRepository --+
                     |
                    ARDARepositoryMixIn
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, schema, role, streamer, tree_streamer, root_dir, init_schema)
schema is a subset of job schema.
source code
 
_initAll(self, init_schema=True) source code
 
_initSchema(self) source code
 
_initDir(self, path, schema=None, create_sequence=True) source code
 
_removeAllEntries(self, path) source code
 
_removeAllAttributes(self, path, schema) source code
 
_isDirNotFoundError(self, e) source code
 
_isDirNotEmptyError(self, e) source code
 
_isNotASequenceError(self, e) source code
 
_forcedRemoveDir(self, path, schema=None, remove_sequence=True) source code
 
_getSequenceName(self, path) source code
 
_createDirIfMissing(self, path) source code
 
_createAttrIfMissing(self, path, schema) source code
 
_convertDbJobId(self, dbid) source code
 
_getFQID(self, j) source code
 
_getJobFolderName(self, fqid) source code
 
_getJobFileName(self, fqid) source code
 
_getFQIDfromName(self, path) source code
 
_getSubJobPath(self, fqid) source code
 
_getCondition(self, fqid, forced_action=False) source code
 
_sortJobsByJobFolders(self, jobs) source code
 
_text2pstr(self, text) source code
 
_pstr2text(self, pstr) source code
 
_compress(self, v) source code
 
_decompress(self, v) source code
 
_getValues(self, job, timestamp, deep=True) source code
 
_commitJobs(self, jobs, forced_action=False, deep=True, register=False, get_ids=True) source code
 
_fqnConverter(self, i) source code
 
_getSelectionAndPath(self, selection) source code
 
_getUpdateExpr(self, name, value) source code
 
_initBulkGetAttr(self) source code
 
_finalizeBulkGetAttr(self) source code
 
_initBulkRm(self) source code
 
_finalizeBulkRm(self) source code
 
_getExtendedAttrList(self, attr_list) source code
 
_getMetaData(self, ids_or_attributes, attr_list)
ids_or_attributes is used to make a selection in the DB attr_list is used to specify return value.
source code
 
_getLockedMetaData(self, ids, attr_list, istate='_', forced_action=False)
The same function as _getMetaData, but it first tries to lock data using on istate.
source code
 
_setLock(self, ids, istate, forced_action=False) source code
 
_setMetaData(self, ids, attrs, values, forced_action=False, new=False) source code
 
_initCounter(self, fqid) source code
 
_counterNext(self, fqid, reserve=1) source code
 
_initCommand(self) source code
 
_finalizeCommand(self) source code
 
_generic_addEntry(self, fqid, attrs, values) source code
 
_generic_updateAttr(self, fqid, attrs, values, forced_action) source code
 
_generic_eot(self) source code
 
_generic_getattr(self, fqid, attr_list) source code
 
_generic_getEntry(self) source code
 
_generic_selectAttr(self, selection, path, attr_list) source code
 
_generic_getSelectAttrEntry(self) source code
 
_generic_rm(self, fqid, forced_action) source code
 
_generic_sequenceNext(self, name, reserve=0) source code
 
registerJobs(self, jobs, masterJob=None)
registerJobs(self, jobs) --> None throws RepositoryError jobs -- list of jobs to register
source code
 
commitJobs(self, jobs, forced_action=False, deep=True)
commitJobs(self, jobs) --> None throws RepositoryError jobs -- list of jobs to commit jobs must already be registered
source code
 
checkoutJobs(self, ids_or_attributes, deep=True)
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, forced_action=False)
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, forced_action=False)
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
 
resetAll(self)
Replaces root directory and all its content with fresh empty initialized directory.
source code

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

Class Variables [hide private]
  _counterName = 'jobseq'
  _jobsTreeFldr = 'jobstree'
  _jobsTreeAttr = ('folders', 'text')
  _lock = ('lock', 'varchar(254)')
  _blob = ('blob', 'text')
  _id = ('id', 'int')
  _counter = ('counter', 'int')
  _subjobs = ('subjobs', 'text')
  _isasubjob = ('isasubjob', 'varchar(254)')
  _compressed = ('compressed', 'varchar(254)')
  _istate = ('istate', 'varchar(254)')
  _time = ('time', 'varchar(254)')
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, schema, role, streamer, tree_streamer, root_dir, init_schema)
(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__
(inherited documentation)

_getMetaData(self, ids_or_attributes, attr_list)

source code 

ids_or_attributes is used to make a selection in the DB attr_list is used to specify return value. Note, the first item of every list in the returned list is always job fqid.

_getLockedMetaData(self, ids, attr_list, istate='_', forced_action=False)

source code 

The same function as _getMetaData, but it first tries to lock data using on istate. It returns non empty list only for the entries that has been actually locked. It only accepts list of fqids as ids parameter. The idea is that it checks lock and retrieves metadata within one call.

registerJobs(self, jobs, masterJob=None)

source code 

registerJobs(self, jobs) --> None throws RepositoryError jobs -- list of jobs to register

Overrides: Base.JobRepository.registerJobs
(inherited documentation)

commitJobs(self, jobs, forced_action=False, deep=True)

source code 

commitJobs(self, jobs) --> None throws RepositoryError jobs -- list of jobs to commit jobs must already be registered

Overrides: Base.JobRepository.commitJobs
(inherited documentation)

checkoutJobs(self, ids_or_attributes, deep=True)

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'}

Overrides: Base.JobRepository.checkoutJobs
(inherited documentation)

deleteJobs(self, ids, forced_action=False)

source code 

deleteJob(self, ids) --> None throws RepositoryError ids -- list of job ids

Overrides: Base.JobRepository.deleteJobs
(inherited documentation)

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'}

Overrides: Base.JobRepository.getJobIds
(inherited documentation)

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'}

Overrides: Base.JobRepository.getJobAttributes
(inherited documentation)

setJobsStatus(self, statusList, forced_action=False)

source code 

setJobsStatus(self, statusList) --> None throws RepositoryError statusList -- list of tuples (<jobId>, <status>) Supposed to be used by JobManager

Overrides: Base.JobRepository.setJobsStatus
(inherited documentation)

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'}

Overrides: Base.JobRepository.getJobsStatus
(inherited documentation)

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

Overrides: Base.JobRepository.getJobTree
(inherited documentation)

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

Overrides: Base.JobRepository.setJobTree
(inherited documentation)