@ThreadSafe
public class PlanTracker
extends java.lang.Object
PlanTracker is used to create, remove, and provide access to the set of currently
scheduled or finished jobs.
All modification of the status of jobs should occur within this class,| Constructor and Description |
|---|
PlanTracker(long capacity,
long retentionMs,
long maxJobPurgeCount,
WorkflowTracker workflowTracker)
Create a new instance of
PlanTracker. |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<PlanCoordinator> |
coordinators()
A collection of all
PlanCoordinator currently tracked by the job master. |
java.util.stream.Stream<PlanInfo> |
failed() |
java.util.Set<java.lang.Long> |
findJobs(java.lang.String name,
java.util.List<Status> statusList) |
PlanCoordinator |
getCoordinator(long jobId)
Gets a
PlanCoordinator associated with the given job Id. |
java.util.Collection<java.lang.Long> |
list()
A collection of all job Ids currently tracked in the job master.
|
void |
run(PlanConfig jobConfig,
CommandManager manager,
JobServerContext ctx,
java.util.List<WorkerInfo> workers,
long jobId)
Adds a job with the given
JobConfig to the job tracker. |
public PlanTracker(long capacity,
long retentionMs,
long maxJobPurgeCount,
WorkflowTracker workflowTracker)
PlanTracker.capacity - the capacity of jobs that can be handledretentionMs - the minimum amount of time to retain jobsmaxJobPurgeCount - the max amount of jobs to purge when reaching max capacityworkflowTracker - the workflow tracker instance@Nullable public PlanCoordinator getCoordinator(long jobId)
PlanCoordinator associated with the given job Id.jobId - the job id associated with the PlanCoordinatorPlanCoordinator associated with the id, or null if there is no associationpublic void run(PlanConfig jobConfig, CommandManager manager, JobServerContext ctx, java.util.List<WorkerInfo> workers, long jobId) throws JobDoesNotExistException, ResourceExhaustedException
JobConfig to the job tracker.jobConfig - configuration for the jobmanager - command manager for jobsctx - the JobServerContext from the job masterworkers - a list of available workersjobId - job id of the newly added jobJobDoesNotExistException - if the job type does not existResourceExhaustedException - if there is no more space available in the job masterpublic java.util.Collection<java.lang.Long> list()
public java.util.Collection<PlanCoordinator> coordinators()
PlanCoordinator currently tracked by the job master. May contain
coordinators for jobs which have finished.PlanCoordinatorpublic java.util.stream.Stream<PlanInfo> failed()
public java.util.Set<java.lang.Long> findJobs(java.lang.String name,
java.util.List<Status> statusList)
name - job name filterstatusList - status list filterCopyright © 2022. All Rights Reserved.