コード例 #1
0
ファイル: TestDatabase.py プロジェクト: makeittotop/py_queue
class TaskAttempt(DBObject.DBObject):
    """Every time a task is attempted (either from initial startup or from
    a retry) a TaskInvocation object is created.  This holds all the data
    relevent to the attempt.

    @ivar jobid:  unique identifier for the job the tasks belong to
    @ivar taskid: unique identifier for the task within the job
    @ivar state: the current state of the task
    @ivar slots: list of the slots checked out for this invocation.
    @ivar readytime: the time this attempt became ready.
    @ivar pickuptime: the time the first command started (derived)
    @ivar statetime: the time the task entered its current state (derived)
    @ivar activesecs: the total time the task was active (derived)
    """

    Fields = [
        DBFields.IntField('jobid', unsigned=True, key=True),
        DBFields.IntField('taskid', unsigned=True, key=True),
        DBFields.VarCharField('state', length=12, index=True, indexlen=8),
        DBFields.StrListField('slots', index=True, indexlen=8),
        DBFields.TimeIntField('readytime', index=True),
        DBFields.TimeIntField('pickuptime', index=True),
        DBFields.TimeIntField('statetime', index=True),
        DBFields.IntField('activesecs', unsigned=True, index=True)
    ]

    Aliases = {'jid': 'jobid', 'tid': 'taskid'}
コード例 #2
0
ファイル: TestDatabase.py プロジェクト: makeittotop/py_queue
class Job(DBObject.DBObject):
    """The base type for all jobs submitted to the scheduling system.

    @ivar jobid:      unique identifier of the job
    @ivar user:       user that submitted the job
    @ivar host:       host where the job was submitted from
    @ivar title:      title of the job
    @ivar priority:   priority of this job to determine placement in the queue
    @ivar huntgroups: list of slot groups this job can run on
    @ivar spooltime:  time this job was spooled
    @ivar stoptime:   time this job finished or was canceled.
    @ivar deletetime: time this job was deleted from the scheduling system.
    @ivar numtasks:   total number of tasks in this job
    @ivar active:     total number of active tasks in this job.
    @ivar blocked:    total number of blocked tasks in this job.
    @ivar done:       total number of done tasks in this job.
    @ivar error:      total number of errored tasks in this job.
    @ivar ready:      total number of ready tasks in this job.
    @ivar other:      total number of tasks in a state other than active,
                       blocked, done, error, or ready.

    @ivar graph:      a compressed representation of the job graph containing
                      all the dependencies. (gziped as well)

    """

    Fields = [
        DBFields.AutoIncField('jobid'),
        DBFields.VarCharField('user', length=16, index=True),
        DBFields.VarCharField('host', length=64, index=True),
        DBFields.IntField('port', unsigned=True),
        DBFields.VarCharField('title', length=255, index=True),
        DBFields.FloatField('priority', index=True),
        DBFields.StrListField('huntgroups', ftype='varchar(255)', index=True),
        DBFields.TimeIntField('spooltime', index=True),
        DBFields.TimeIntField('stoptime', index=True),
        DBFields.TimeIntField('deletetime', index=True),
        DBFields.IntField('numtasks', unsigned=True, index=True),
        DBFields.IntField('active', unsigned=True, index=True),
        DBFields.IntField('blocked', unsigned=True, index=True),
        DBFields.IntField('done', unsigned=True, index=True),
        DBFields.IntField('error', unsigned=True, index=True),
        DBFields.IntField('ready', unsigned=True, index=True),
        DBFields.IntField('other', unsigned=True, index=True),
        DBFields.BlobField('graph')
    ]

    VirtualFields = [DispatcherField('dispatcher', ['user', 'host', 'port'])]

    Aliases = {
        'actv': 'active',
        'crews': 'huntgroups',
        'deleted': 'deletetime',
        'jid': 'jobid',
        'pri': 'priority',
        'spooled': 'spooltime',
        'stopped': 'stoptime',
        'disp': 'dispatcher'
    }
コード例 #3
0
ファイル: TestDatabase.py プロジェクト: makeittotop/py_queue
class Album(DBObject.DBObject):
    Fields = (DBFields.AutoIncField('albumid'),
              DBFields.IntField('artistid', unsigned=True, equivKey=True),
              DBFields.VarCharField('name', length=128, indexlen=8,
                                    index=True),
              DBFields.VarCharField('genre',
                                    length=128,
                                    indexlen=8,
                                    index=True),
              DBFields.TimeIntField('released', index=True),
              DBFields.SmallIntField('year', unsigned=True, index=True),
              DBFields.SmallIntField('tracks', unsigned=True),
              DBFields.SmallIntField('discs', unsigned=True))

    Aliases = {'album': 'name'}