@ThreadSafe public final class PlanCoordinator extends Object
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the current job.
|
static PlanCoordinator |
create(CommandManager commandManager,
JobServerContext jobServerContext,
List<WorkerInfo> workerInfoList,
Long jobId,
JobConfig jobConfig,
java.util.function.Consumer<PlanInfo> statusChangeCallback)
Creates a new instance of the
PlanCoordinator . |
boolean |
equals(Object o) |
void |
failTasksForWorker(long workerId)
Fails any incomplete tasks being run on the specified worker.
|
long |
getJobId() |
PlanInfo |
getPlanInfoWire(boolean verbose) |
int |
hashCode() |
boolean |
isJobFinished() |
void |
setJobAsFailed(String errorMessage)
Sets the job as failed with given error message.
|
void |
updateTasks(List<TaskInfo> taskInfoList)
Updates internal status with given tasks.
|
public static PlanCoordinator create(CommandManager commandManager, JobServerContext jobServerContext, List<WorkerInfo> workerInfoList, Long jobId, JobConfig jobConfig, java.util.function.Consumer<PlanInfo> statusChangeCallback) throws JobDoesNotExistException
PlanCoordinator
.commandManager
- the command managerjobServerContext
- the context with information used to select executorsworkerInfoList
- the list of workers to usejobId
- the job IdjobConfig
- configuration for the jobstatusChangeCallback
- Callback to be called for status changes on the jobJobDoesNotExistException
- when the job definition doesn't existpublic void cancel()
public void updateTasks(List<TaskInfo> taskInfoList)
taskInfoList
- List of @TaskInfo instances to updatepublic boolean isJobFinished()
public long getJobId()
public void setJobAsFailed(String errorMessage)
errorMessage
- Error message to set for failurepublic void failTasksForWorker(long workerId)
workerId
- the id of the worker to fail tasks forpublic PlanInfo getPlanInfoWire(boolean verbose)
verbose
- whether the output should be verbose or notCopyright © 2023. All Rights Reserved.