Source code for buildtest.scheduler.job

import time


[docs]class Job: """This is a base class for holding job level data and common methods for used for batch job submission.""" def __init__(self, jobID): self.jobid = jobID self._state = None # used to store the job elapsed time self.elapsedtime = 0 # used for job pending time self.pendtime = 0 # time when job was submitted self.submittime = time.time() # time when job was started self.starttime = None
[docs] def state(self): """Return job state""" return self._state
[docs] def get(self): """Return Job ID as string type""" return str(self.jobid)
[docs] def is_pending(self): """Check if job is in pending state""" raise NotImplementedError
[docs] def is_running(self): """Check if job is in running state""" raise NotImplementedError
[docs] def is_suspended(self): """Check if job is in suspended state""" raise NotImplementedError
[docs] def cancel(self): """Cancel job""" raise NotImplementedError
[docs] def poll(self): """Poll job and update job state.""" raise NotImplementedError