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 voidcalculateProgressIncrement(int nextStepTotalIncrements)intcompareTo(@NotNull IJobStatus o)voidfinishJob()java.time.DurationgetDuration()fetches the current duration of the job, if job finished gives the total runtimejava.lang.StringgetFormattedDuration()Fetches the current duration of the job as a formatted string, if job finished gives the total runtimeintgetId()get the id of the jobstatusjava.lang.StringgetMessage()Returns the current status message for the jobPrioritygetPriority()Internal priority for the job in the run queue, probably don't show to the user.floatgetProgress()Progress float, percentage complete between 0 and 1intgetProgressInt()Progress int, percentage complete between 0 and 100java.time.InstantgetStartTime()returns the start time of the jobintgetStep()Fetches the current "step" for the job, the stage it is atvoidincrementProgress()booleanisFinished()returns whether the job has finishedvoidnextStep()voidsetMessage(java.lang.String msg)voidsetStep(int step)voidstartJob()
-
-
-
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:
compareToin interfacejava.lang.Comparable<IJobStatus>- Specified by:
compareToin interfaceIJobStatus
-
finishJob
public void finishJob()
-
getDuration
public java.time.Duration getDuration()
Description copied from interface:IJobStatusfetches the current duration of the job, if job finished gives the total runtime- Specified by:
getDurationin interfaceIJobStatus- Returns:
- duration
-
getFormattedDuration
public java.lang.String getFormattedDuration()
Description copied from interface:IJobStatusFetches the current duration of the job as a formatted string, if job finished gives the total runtime- Specified by:
getFormattedDurationin interfaceIJobStatus- Returns:
- duration as string
-
getId
public int getId()
Description copied from interface:IJobStatusget the id of the jobstatus- Specified by:
getIdin interfaceIJobStatus- Returns:
- id
-
getMessage
public java.lang.String getMessage()
Description copied from interface:IJobStatusReturns the current status message for the job- Specified by:
getMessagein 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:
getProgressin interfaceIJobStatus- Returns:
- percentage job complete between 0 and 1
-
getProgressInt
public int getProgressInt()
Progress int, percentage complete between 0 and 100- Specified by:
getProgressIntin interfaceIJobStatus- Returns:
- percentage job complete between 0 and 100
-
getStartTime
public java.time.Instant getStartTime()
Description copied from interface:IJobStatusreturns the start time of the job- Specified by:
getStartTimein interfaceIJobStatus- Returns:
- start time
-
getStep
public int getStep()
Description copied from interface:IJobStatusFetches the current "step" for the job, the stage it is at- Specified by:
getStepin interfaceIJobStatus- Returns:
- stage of job
-
setStep
public void setStep(int step)
-
incrementProgress
public void incrementProgress()
-
isFinished
public boolean isFinished()
Description copied from interface:IJobStatusreturns whether the job has finished- Specified by:
isFinishedin interfaceIJobStatus- Returns:
- finished
-
nextStep
public void nextStep()
-
startJob
public void startJob()
-
-