public class JobStatus
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private long |
endTime |
private int |
exitCode |
private JobIdentifier |
jobId |
private java.lang.String |
message |
private java.lang.String |
name |
private java.lang.String |
nodeName |
private int |
progress |
static DateFormatter |
QACCT_DATE
Convert date string from "qacct -j <id>" into Date objects.
|
static DateFormatter |
QSTAT_DATE
Convert date string from "qstat -xml" into Date objects.
|
private long |
startTime |
private Job.Status |
status |
private long |
submissionTime |
Modifier | Constructor and Description |
---|---|
protected |
JobStatus(JobIdentifier jobId) |
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getEndDate()
Get the end time as a date.
|
long |
getEndTime()
Get the time the job ended execution.
|
int |
getExitCode()
Get the exit code from the job script.
|
JobIdentifier |
getJobIdentifier()
Get the identifier for the job.
|
java.lang.String |
getMessage()
Get the progress message of an executing job.
|
java.lang.String |
getName()
Get the name of the job.
|
java.lang.String |
getNodeName()
Get the name of the node in the cluster that the job is/was running
on.
|
int |
getProgress()
Get the progress in percent of an executing job.
|
java.util.Date |
getStartDate()
Get the start time as a date.
|
long |
getStartTime()
Get the time the job started to execute on one of
the cluster nodes.
|
Job.Status |
getStatus()
Get the status of the job.
|
java.util.Date |
getSubmissionDate()
Get the submission time as a date.
|
long |
getSubmissionTime()
Get the time the job was submitted to the cluster.
|
boolean |
isAlive()
Utility method for checking if the status of this job is "alive":
eg. null, WAITING or EXECUTING
|
(package private) void |
readFromProgress(java.lang.String data)
Parse the data from the 'progress' file which
is fomatted as <percent-value> <message>.
|
(package private) void |
readFromQacct(java.lang.String text,
int timeAdjustment)
Get information from output from 'qacct -j <job-id>'.
|
(package private) void |
readFromQstatXml(org.jdom2.Element e,
int timeAdjustment)
Get information from XML element generated by 'qstat -xml'.
|
protected void |
setEndTime(long time) |
protected void |
setExitCode(int exitCode) |
protected void |
setMessage(java.lang.String message) |
protected void |
setName(java.lang.String name) |
protected void |
setNodeName(java.lang.String nodeName) |
protected void |
setProgress(int progress) |
protected void |
setStartTime(long time) |
protected void |
setStatus(Job.Status status) |
protected void |
setSubmissionTime(long time) |
(package private) void |
setSubmitted(long submissionTime,
java.lang.String name)
Called after a job has been been successfully submitted to the
cluster.
|
java.lang.String |
toString() |
public static final DateFormatter QSTAT_DATE
public static final DateFormatter QACCT_DATE
private final JobIdentifier jobId
private java.lang.String name
private Job.Status status
private long submissionTime
private long startTime
private long endTime
private java.lang.String nodeName
private int progress
private java.lang.String message
private int exitCode
protected JobStatus(JobIdentifier jobId)
public JobIdentifier getJobIdentifier()
public java.lang.String getName()
JobDefinition.getName()
.protected void setName(java.lang.String name)
public Job.Status getStatus()
protected void setStatus(Job.Status status)
public boolean isAlive()
public long getSubmissionTime()
public java.util.Date getSubmissionDate()
protected void setSubmissionTime(long time)
public long getStartTime()
public java.util.Date getStartDate()
protected void setStartTime(long time)
public long getEndTime()
public java.util.Date getEndDate()
protected void setEndTime(long time)
public int getExitCode()
protected void setExitCode(int exitCode)
public java.lang.String getNodeName()
protected void setNodeName(java.lang.String nodeName)
public int getProgress()
protected void setProgress(int progress)
public java.lang.String getMessage()
protected void setMessage(java.lang.String message)
void setSubmitted(long submissionTime, java.lang.String name)
void readFromQstatXml(org.jdom2.Element e, int timeAdjustment)
e
- The XML element containing information about a single job <job_list>timeAdjustment
- Number of seconds to adjust the time values in the XML data
(used for getting the local time). A positive value will adjust the times
into the future.void readFromProgress(java.lang.String data)
void readFromQacct(java.lang.String text, int timeAdjustment)
public java.lang.String toString()
toString
in class java.lang.Object