Class JobStatus
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.engine.executor.JobStatus
-
- All Implemented Interfaces:
java.lang.Comparable<IJobStatus>
,IJobStatus
public class JobStatus extends java.lang.Object implements IJobStatus
Basic job status implementation
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculateProgressIncrement(int nextStepTotalIncrements)
int
compareTo(@NotNull IJobStatus o)
void
finishJob()
java.time.Duration
getDuration()
fetches the current duration of the job, if job finished gives the total runtimejava.lang.String
getFormattedDuration()
Fetches the current duration of the job as a formatted string, if job finished gives the total runtimeint
getId()
get the id of the jobstatusjava.lang.String
getMessage()
Returns the current status message for the jobPriority
getPriority()
Internal priority for the job in the run queue, probably don't show to the user.float
getProgress()
Progress float, percentage complete between 0 and 1int
getProgressInt()
Progress int, percentage complete between 0 and 100java.time.Instant
getStartTime()
returns the start time of the jobint
getStep()
Fetches the current "step" for the job, the stage it is atvoid
incrementProgress()
boolean
isFinished()
returns whether the job has finishedvoid
nextStep()
void
setMessage(java.lang.String msg)
void
setStep(int step)
void
startJob()
-
-
-
Constructor Detail
-
JobStatus
public JobStatus(int id, Priority priority)
-
-
Method Detail
-
calculateProgressIncrement
public void calculateProgressIncrement(int nextStepTotalIncrements)
-
compareTo
public int compareTo(@NotNull @NotNull IJobStatus o)
Description copied from interface:IJobStatus
- Specified by:
compareTo
in interfacejava.lang.Comparable<IJobStatus>
- Specified by:
compareTo
in interfaceIJobStatus
-
finishJob
public void finishJob()
-
getDuration
public java.time.Duration getDuration()
Description copied from interface:IJobStatus
fetches the current duration of the job, if job finished gives the total runtime- Specified by:
getDuration
in interfaceIJobStatus
- Returns:
- duration
-
getFormattedDuration
public java.lang.String getFormattedDuration()
Description copied from interface:IJobStatus
Fetches the current duration of the job as a formatted string, if job finished gives the total runtime- Specified by:
getFormattedDuration
in interfaceIJobStatus
- Returns:
- duration as string
-
getId
public int getId()
Description copied from interface:IJobStatus
get the id of the jobstatus- Specified by:
getId
in interfaceIJobStatus
- Returns:
- id
-
getMessage
public java.lang.String getMessage()
Description copied from interface:IJobStatus
Returns the current status message for the job- Specified by:
getMessage
in interfaceIJobStatus
- Returns:
- message
-
setMessage
public void setMessage(java.lang.String msg)
-
getPriority
public Priority getPriority()
Internal priority for the job in the run queue, probably don't show to the user.- Returns:
- the job priority
-
getProgress
public float getProgress()
Progress float, percentage complete between 0 and 1- Specified by:
getProgress
in interfaceIJobStatus
- Returns:
- percentage job complete between 0 and 1
-
getProgressInt
public int getProgressInt()
Progress int, percentage complete between 0 and 100- Specified by:
getProgressInt
in interfaceIJobStatus
- Returns:
- percentage job complete between 0 and 100
-
getStartTime
public java.time.Instant getStartTime()
Description copied from interface:IJobStatus
returns the start time of the job- Specified by:
getStartTime
in interfaceIJobStatus
- Returns:
- start time
-
getStep
public int getStep()
Description copied from interface:IJobStatus
Fetches the current "step" for the job, the stage it is at- Specified by:
getStep
in interfaceIJobStatus
- Returns:
- stage of job
-
setStep
public void setStep(int step)
-
incrementProgress
public void incrementProgress()
-
isFinished
public boolean isFinished()
Description copied from interface:IJobStatus
returns whether the job has finished- Specified by:
isFinished
in interfaceIJobStatus
- Returns:
- finished
-
nextStep
public void nextStep()
-
startJob
public void startJob()
-
-