@ThreadSafe
public final class PlanCoordinator
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the current job.
|
static PlanCoordinator |
create(CommandManager commandManager,
JobServerContext jobServerContext,
java.util.List<WorkerInfo> workerInfoList,
java.lang.Long jobId,
JobConfig jobConfig,
java.util.function.Consumer<PlanInfo> statusChangeCallback)
Creates a new instance of the
PlanCoordinator. |
boolean |
equals(java.lang.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(java.lang.String errorType,
java.lang.String errorMessage)
Sets the job as failed with given error message.
|
void |
updateTasks(java.util.List<TaskInfo> taskInfoList)
Updates internal status with given tasks.
|
public static PlanCoordinator create(CommandManager commandManager, JobServerContext jobServerContext, java.util.List<WorkerInfo> workerInfoList, java.lang.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(java.util.List<TaskInfo> taskInfoList)
taskInfoList - List of @TaskInfo instances to updatepublic boolean isJobFinished()
public long getJobId()
public void setJobAsFailed(java.lang.String errorType,
java.lang.String errorMessage)
errorType - Error type to set for failureerrorMessage - 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 notpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2022. All Rights Reserved.