@ThreadSafe public final class JobInfo extends Object implements Comparable<JobInfo>
Constructor and Description |
---|
JobInfo(long id,
JobConfig jobConfig,
java.util.function.Consumer<JobInfo> statusChangeCallback)
Creates a new instance of
JobInfo . |
Modifier and Type | Method and Description |
---|---|
void |
addTask(int taskId)
Registers a task.
|
int |
compareTo(JobInfo other)
This method orders jobs using the time their status was last modified.
|
boolean |
equals(Object o) |
String |
getErrorMessage() |
long |
getId() |
JobConfig |
getJobConfig() |
long |
getLastStatusChangeMs() |
String |
getResult() |
Status |
getStatus() |
List<Integer> |
getTaskIdList() |
TaskInfo |
getTaskInfo(int taskId) |
List<TaskInfo> |
getTaskInfoList() |
int |
hashCode() |
void |
setErrorMessage(String errorMessage) |
void |
setResult(String result) |
void |
setStatus(Status status)
Sets the status of a job.
|
void |
setTaskInfo(int taskId,
TaskInfo taskInfo)
Sets the information of a task.
|
public JobInfo(long id, JobConfig jobConfig, java.util.function.Consumer<JobInfo> statusChangeCallback)
JobInfo
.id
- the job idjobConfig
- the job configurationstatusChangeCallback
- the callback to invoke upon status changepublic int compareTo(JobInfo other)
compareTo
in interface Comparable<JobInfo>
public void addTask(int taskId)
taskId
- the task idpublic long getId()
public JobConfig getJobConfig()
public long getLastStatusChangeMs()
public void setErrorMessage(String errorMessage)
errorMessage
- the error messagepublic String getErrorMessage()
public TaskInfo getTaskInfo(int taskId)
taskId
- the task ID to get the task info forpublic void setTaskInfo(int taskId, TaskInfo taskInfo)
taskId
- the task idtaskInfo
- the task informationpublic void setStatus(Status status)
status
- the job statuspublic Status getStatus()
public void setResult(String result)
result
- the joined job resultpublic String getResult()
Copyright © 2023. All Rights Reserved.