![]() |
ATLAS Offline Software
|
Public Member Functions | |
| parseConnectionInfo (self, connstring='') | |
| __init__ (self, connstring='', createDatabase=False) | |
| __enter__ (self) | |
| __exit__ (self, exc_type, exc_value, traceback) | |
| execute (self, statementParts, doCommit=False, limit=None) | |
| deleteTask (self, dsName, taskName) | |
| addTask (self, dsName, taskName, template, release, njobs, taskpostprocsteps='', status=StatusCodes['SUBMITTED'], onDisk=OnDiskCodes['ALLONDISK'], createdTime=None, createdUser=None, createdHost=None, comment='') | |
| getStatus (self, dsName, taskName) | |
| setStatus (self, dsName, taskName, status, oldStatus=None) | |
| setDiskStatus (self, dsName, taskName, onDisk) | |
| updateStatus (self, dsName, taskName, status, nResultFiles, nJobs, nJobsSubmitted, nJobsRunning, nJobsPostProc, nJobsFailed, nJobsCompleted) | |
| setValue (self, dsName, taskName, fieldName, value) | |
| getValue (self, what, qual=()) | |
| getCount (self, what, qual=()) | |
| getNTasks (self, qual=()) | |
| getTaskValue (self, dsName, taskName, what) | |
| taskIter (self, what=' *', qual=('order by UPDATED',)) | |
| taskIterDict (self, what=' *', qual=('order by UPDATED',), limit=999999999) | |
| getTaskDict (self, dsname, taskname, what=' *', qual=()) | |
| getDSNames (self, dsname) | |
| getTaskNames (self, dsname, taskname=None, addWildCards=True) | |
Public Attributes | |
| bool | debug = False |
| str | paramstyle = None |
| bool | is_managing_context = False |
| str | dbtype |
| dbname = self.__class__.parseConnectionInfo(connstring) | |
| dbcon = sqlite3.connect(self.dbname) | |
Static Public Attributes | |
| dict | StatusCodes |
| dict | OnDiskCodes |
Protected Member Functions | |
| _createSQLiteSchema (self) | |
| _createOracleSchema (self) | |
TaskManager is tool for keeping track of JobRunner jobs.
Definition at line 120 of file TaskManager.py.
| python.TaskManager.TaskManager.__init__ | ( | self, | |
| connstring = '', | |||
| createDatabase = False ) |
Constructor. connstring is a connection string specifying either a SQLite file
("sqlite_file:..."), an Oracle database ("oracle://..."), or an authorization file
("auth_file:...") with connection information. If connstring is empty, the connection
information will be taken from TASKDB (if set), or otherwise defaults to
'sqlite_file:taskdata.db'.
Definition at line 166 of file TaskManager.py.
| python.TaskManager.TaskManager.__enter__ | ( | self | ) |
Remember that we're inside a 'with' statement so we can warn otherwise:
Definition at line 204 of file TaskManager.py.
| python.TaskManager.TaskManager.__exit__ | ( | self, | |
| exc_type, | |||
| exc_value, | |||
| traceback ) |
Close the database connection at the end of the 'with' statement.
Definition at line 209 of file TaskManager.py.
|
protected |
Create the database schema for an Oracle database.
Definition at line 253 of file TaskManager.py.
|
protected |
Create the database schema for a SQLite3 database.
Definition at line 216 of file TaskManager.py.
| python.TaskManager.TaskManager.addTask | ( | self, | |
| dsName, | |||
| taskName, | |||
| template, | |||
| release, | |||
| njobs, | |||
| taskpostprocsteps = '', | |||
| status = StatusCodes['SUBMITTED'], | |||
| onDisk = OnDiskCodes['ALLONDISK'], | |||
| createdTime = None, | |||
| createdUser = None, | |||
| createdHost = None, | |||
| comment = '' ) |
Add an entry for a new task if the task doesn't exist already. If the task exists, its UPDATED, NJOBS, STATUS and ONDISK fields will be updated.
Definition at line 395 of file TaskManager.py.
| python.TaskManager.TaskManager.deleteTask | ( | self, | |
| dsName, | |||
| taskName ) |
Delete a task entry from the taskmanager database.
Definition at line 388 of file TaskManager.py.
Execute a SQL statement passed as a list or tuple of statement parts, where each part is either a partial SQL string, or an object of type DbParam specifying a parameter for the SQL statement. The actual SQL statement is assembled (using the parameter style of the current database) and executed, and the resulting cursor is returned. Loosely follows the method discussed in the Python Cookbook. WARNING: At present, limit doesn't work when ordering rows for Oracle!
Definition at line 311 of file TaskManager.py.
| python.TaskManager.TaskManager.getCount | ( | self, | |
| what, | |||
| qual = () ) |
Definition at line 517 of file TaskManager.py.
| python.TaskManager.TaskManager.getDSNames | ( | self, | |
| dsname ) |
Get all DSNAMEs for a given (partial) data set name dsname.
Definition at line 582 of file TaskManager.py.
| python.TaskManager.TaskManager.getNTasks | ( | self, | |
| qual = () ) |
Definition at line 525 of file TaskManager.py.
| python.TaskManager.TaskManager.getStatus | ( | self, | |
| dsName, | |||
| taskName ) |
Get status of a task.
Definition at line 458 of file TaskManager.py.
| python.TaskManager.TaskManager.getTaskDict | ( | self, | |
| dsname, | |||
| taskname, | |||
| what = '*', | |||
| qual = () ) |
Definition at line 561 of file TaskManager.py.
Find all matching tasks and return list of full (DSNAME,TASKNAME) pairs. dsname and taskname may be any partial dataset and task name, respectively.
Definition at line 589 of file TaskManager.py.
| python.TaskManager.TaskManager.getTaskValue | ( | self, | |
| dsName, | |||
| taskName, | |||
| what ) |
Get a single value from the task database. If the query results in more than one value, only the first value is returned.
Definition at line 530 of file TaskManager.py.
| python.TaskManager.TaskManager.getValue | ( | self, | |
| what, | |||
| qual = () ) |
Get a single value from the task database. If the query results in more than one value, only the first value is returned.
Definition at line 509 of file TaskManager.py.
| python.TaskManager.TaskManager.parseConnectionInfo | ( | self, | |
| connstring = '' ) |
Definition at line 144 of file TaskManager.py.
| python.TaskManager.TaskManager.setDiskStatus | ( | self, | |
| dsName, | |||
| taskName, | |||
| onDisk ) |
Update the onDisk-status of a task.
Definition at line 476 of file TaskManager.py.
| python.TaskManager.TaskManager.setStatus | ( | self, | |
| dsName, | |||
| taskName, | |||
| status, | |||
| oldStatus = None ) |
Set the status of a task. If oldStatus is set, the task must be in the designated status.
Definition at line 464 of file TaskManager.py.
| python.TaskManager.TaskManager.setValue | ( | self, | |
| dsName, | |||
| taskName, | |||
| fieldName, | |||
| value ) |
Update a field of a given task.
Definition at line 501 of file TaskManager.py.
| python.TaskManager.TaskManager.taskIter | ( | self, | |
| what = '*', | |||
| qual = ('order by UPDATED',) ) |
Definition at line 536 of file TaskManager.py.
| python.TaskManager.TaskManager.taskIterDict | ( | self, | |
| what = '*', | |||
| qual = ('order by UPDATED',), | |||
| limit = 999999999 ) |
Definition at line 543 of file TaskManager.py.
| python.TaskManager.TaskManager.updateStatus | ( | self, | |
| dsName, | |||
| taskName, | |||
| status, | |||
| nResultFiles, | |||
| nJobs, | |||
| nJobsSubmitted, | |||
| nJobsRunning, | |||
| nJobsPostProc, | |||
| nJobsFailed, | |||
| nJobsCompleted ) |
Update task status information including number of jobs in different states.
Definition at line 484 of file TaskManager.py.
| python.TaskManager.TaskManager.dbcon = sqlite3.connect(self.dbname) |
Definition at line 187 of file TaskManager.py.
| python.TaskManager.TaskManager.dbname = self.__class__.parseConnectionInfo(connstring) |
Definition at line 177 of file TaskManager.py.
| python.TaskManager.TaskManager.dbtype |
Definition at line 177 of file TaskManager.py.
| bool python.TaskManager.TaskManager.debug = False |
Definition at line 173 of file TaskManager.py.
| bool python.TaskManager.TaskManager.is_managing_context = False |
Definition at line 175 of file TaskManager.py.
|
static |
Definition at line 136 of file TaskManager.py.
| python.TaskManager.TaskManager.paramstyle = None |
Definition at line 174 of file TaskManager.py.
|
static |
Definition at line 123 of file TaskManager.py.