![]() |
ATLAS Offline Software
|
Public Member Functions | |
def | parseConnectionInfo (self, connstring='') |
def | __init__ (self, connstring='', createDatabase=False) |
def | __enter__ (self) |
def | __exit__ (self, exc_type, exc_value, traceback) |
def | execute (self, statementParts, doCommit=False, limit=None) |
def | deleteTask (self, dsName, taskName) |
def | addTask (self, dsName, taskName, template, release, njobs, taskpostprocsteps='', status=StatusCodes['SUBMITTED'], onDisk=OnDiskCodes['ALLONDISK'], createdTime=None, createdUser=None, createdHost=None, comment='') |
def | getStatus (self, dsName, taskName) |
def | setStatus (self, dsName, taskName, status, oldStatus=None) |
def | setDiskStatus (self, dsName, taskName, onDisk) |
def | updateStatus (self, dsName, taskName, status, nResultFiles, nJobs, nJobsSubmitted, nJobsRunning, nJobsPostProc, nJobsFailed, nJobsCompleted) |
def | setValue (self, dsName, taskName, fieldName, value) |
def | getValue (self, what, qual=()) |
def | getCount (self, what, qual=()) |
def | getNTasks (self, qual=()) |
def | getTaskValue (self, dsName, taskName, what) |
def | taskIter (self, what=' *', qual=('order by UPDATED',)) |
def | taskIterDict (self, what=' *', qual=('order by UPDATED',), limit=999999999) |
def | getTaskDict (self, dsname, taskname, what=' *', qual=()) |
def | getDSNames (self, dsname) |
def | getTaskNames (self, dsname, taskname=None, addWildCards=True) |
Public Attributes | |
debug | |
paramstyle | |
is_managing_context | |
dbname | |
dbtype | |
dbcon | |
Static Public Attributes | |
dictionary | StatusCodes |
dictionary | OnDiskCodes |
Private Member Functions | |
def | _createSQLiteSchema (self) |
def | _createOracleSchema (self) |
TaskManager is tool for keeping track of JobRunner jobs.
Definition at line 122 of file TaskManager.py.
def 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 168 of file TaskManager.py.
def python.TaskManager.TaskManager.__enter__ | ( | self | ) |
Remember that we're inside a 'with' statement so we can warn otherwise:
Definition at line 206 of file TaskManager.py.
def python.TaskManager.TaskManager.__exit__ | ( | self, | |
exc_type, | |||
exc_value, | |||
traceback | |||
) |
Close the database connection at the end of the 'with' statement.
Definition at line 211 of file TaskManager.py.
|
private |
Create the database schema for an Oracle database.
Definition at line 255 of file TaskManager.py.
|
private |
def 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 397 of file TaskManager.py.
def python.TaskManager.TaskManager.deleteTask | ( | self, | |
dsName, | |||
taskName | |||
) |
Delete a task entry from the taskmanager database.
Definition at line 390 of file TaskManager.py.
def python.TaskManager.TaskManager.execute | ( | self, | |
statementParts, | |||
doCommit = False , |
|||
limit = None |
|||
) |
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 313 of file TaskManager.py.
def python.TaskManager.TaskManager.getCount | ( | self, | |
what, | |||
qual = () |
|||
) |
Definition at line 519 of file TaskManager.py.
def python.TaskManager.TaskManager.getDSNames | ( | self, | |
dsname | |||
) |
Get all DSNAMEs for a given (partial) data set name dsname.
Definition at line 584 of file TaskManager.py.
def python.TaskManager.TaskManager.getNTasks | ( | self, | |
qual = () |
|||
) |
Definition at line 527 of file TaskManager.py.
def python.TaskManager.TaskManager.getStatus | ( | self, | |
dsName, | |||
taskName | |||
) |
Get status of a task.
Definition at line 460 of file TaskManager.py.
def python.TaskManager.TaskManager.getTaskDict | ( | self, | |
dsname, | |||
taskname, | |||
what = '*' , |
|||
qual = () |
|||
) |
Definition at line 563 of file TaskManager.py.
def python.TaskManager.TaskManager.getTaskNames | ( | self, | |
dsname, | |||
taskname = None , |
|||
addWildCards = True |
|||
) |
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 591 of file TaskManager.py.
def 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 532 of file TaskManager.py.
def 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 511 of file TaskManager.py.
def python.TaskManager.TaskManager.parseConnectionInfo | ( | self, | |
connstring = '' |
|||
) |
Definition at line 146 of file TaskManager.py.
def python.TaskManager.TaskManager.setDiskStatus | ( | self, | |
dsName, | |||
taskName, | |||
onDisk | |||
) |
Update the onDisk-status of a task.
Definition at line 478 of file TaskManager.py.
def 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 466 of file TaskManager.py.
def python.TaskManager.TaskManager.setValue | ( | self, | |
dsName, | |||
taskName, | |||
fieldName, | |||
value | |||
) |
Update a field of a given task.
Definition at line 503 of file TaskManager.py.
def python.TaskManager.TaskManager.taskIter | ( | self, | |
what = '*' , |
|||
qual = ('order by UPDATED',) |
|||
) |
Definition at line 538 of file TaskManager.py.
def python.TaskManager.TaskManager.taskIterDict | ( | self, | |
what = '*' , |
|||
qual = ('order by UPDATED',) , |
|||
limit = 999999999 |
|||
) |
Definition at line 545 of file TaskManager.py.
def 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 486 of file TaskManager.py.
python.TaskManager.TaskManager.dbcon |
Definition at line 189 of file TaskManager.py.
python.TaskManager.TaskManager.dbname |
Definition at line 179 of file TaskManager.py.
python.TaskManager.TaskManager.dbtype |
Definition at line 181 of file TaskManager.py.
python.TaskManager.TaskManager.debug |
Definition at line 175 of file TaskManager.py.
python.TaskManager.TaskManager.is_managing_context |
Definition at line 177 of file TaskManager.py.
|
static |
Definition at line 138 of file TaskManager.py.
python.TaskManager.TaskManager.paramstyle |
Definition at line 176 of file TaskManager.py.
|
static |
Definition at line 125 of file TaskManager.py.