@ThreadSafe public final class PlanInfo extends Object implements Comparable<PlanInfo>
Constructor and Description |
---|
PlanInfo(long id,
JobConfig jobConfig,
java.util.function.Consumer<PlanInfo> statusChangeCallback)
Creates a new instance of
PlanInfo . |
Modifier and Type | Method and Description |
---|---|
void |
addTask(long taskId,
WorkerInfo workerInfo,
Object args)
Registers a task.
|
int |
compareTo(PlanInfo other)
This method orders jobs using the time their status was last modified.
|
boolean |
equals(Object o) |
String |
getErrorMessage() |
String |
getErrorType() |
long |
getId() |
JobConfig |
getJobConfig() |
long |
getLastStatusChangeMs() |
String |
getResult() |
Status |
getStatus() |
List<Long> |
getTaskIdList() |
TaskInfo |
getTaskInfo(long taskId) |
List<TaskInfo> |
getTaskInfoList() |
int |
hashCode() |
void |
setErrorMessage(String errorMessage) |
void |
setErrorType(String errorType) |
void |
setResult(String result) |
void |
setStatus(Status status)
Sets the status of a job.
|
void |
setTaskInfo(long taskId,
TaskInfo taskInfo)
Sets the information of a task.
|
public PlanInfo(long id, JobConfig jobConfig, java.util.function.Consumer<PlanInfo> statusChangeCallback)
PlanInfo
.id
- the job idjobConfig
- the job configurationstatusChangeCallback
- the callback to invoke upon status changepublic int compareTo(PlanInfo other)
compareTo
in interface Comparable<PlanInfo>
public void addTask(long taskId, WorkerInfo workerInfo, Object args)
taskId
- the task idworkerInfo
- the worker infoargs
- the argumentspublic long getId()
public JobConfig getJobConfig()
public long getLastStatusChangeMs()
public void setErrorType(String errorType)
errorType
- the error typepublic String getErrorType()
public void setErrorMessage(String errorMessage)
errorMessage
- the error messagepublic String getErrorMessage()
public TaskInfo getTaskInfo(long taskId)
taskId
- the task ID to get the task info forpublic void setTaskInfo(long 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.