@ThreadSafe public final class Scheduler extends Object
Modifier and Type | Class and Description |
---|---|
class |
Scheduler.BoundedPriorityBlockingQueue<E>
Bounded priority queue impl.
|
static class |
Scheduler.SchedulerStats
Job/Tasks stats.
|
class |
Scheduler.WorkerInfoHub
Worker information hub.
|
static class |
Scheduler.WorkerInfoIdentity
Util class here for tracking unique identity of a worker as
WorkerInfo class uses constantly changing field such as
mLastContactSec for equals(), which can't be served as key
class in map.
|
Constructor and Description |
---|
Scheduler(FileSystemContext fsCtx,
WorkerProvider workerProvider,
JobMetaStore jobMetaStore)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanupStaleJob()
Removes all finished jobs outside the retention time.
|
Set<WorkerInfo> |
getActiveWorkers()
Get active workers.
|
static Scheduler |
getInstance()
Get the singleton instance of Scheduler.
|
JobMetaStore |
getJobMetaStore()
Get job meta store.
|
String |
getJobProgress(JobDescription jobDescription,
JobProgressReportFormat format,
boolean verbose)
Get the job's progress report.
|
Map<JobDescription,Job<?>> |
getJobs()
Get jobs.
|
JobState |
getJobState(JobDescription jobDescription)
Get the job's state.
|
Scheduler.WorkerInfoHub |
getWorkerInfoHub()
Get the workerinfo hub.
|
Scheduler.SchedulerStats |
printJobsStatus()
Print job status.
|
void |
start()
Start scheduler.
|
void |
stop()
Stop scheduler.
|
boolean |
stopJob(JobDescription jobDescription)
Stop a job.
|
boolean |
submitJob(Job<?> job)
Submit a job.
|
void |
updateWorkers()
Update workers.
|
public Scheduler(FileSystemContext fsCtx, WorkerProvider workerProvider, JobMetaStore jobMetaStore)
fsCtx
- file system contextworkerProvider
- workerProviderjobMetaStore
- jobMetaStore@Nullable public static Scheduler getInstance()
public void start()
public void updateWorkers()
public void stop()
public boolean submitJob(Job<?> job)
job
- the jobResourceExhaustedRuntimeException
- if the job cannot be submitted because the scheduler
is at capacityUnavailableRuntimeException
- if the job cannot be submitted because the meta store is
not readypublic boolean stopJob(JobDescription jobDescription)
jobDescription
- job identifierpublic String getJobProgress(JobDescription jobDescription, JobProgressReportFormat format, boolean verbose)
jobDescription
- job identifierformat
- progress report formatverbose
- whether to include details on failed files and failuresNotFoundRuntimeException
- if the job does not existAlluxioRuntimeException
- if any other Alluxio exception occurspublic JobState getJobState(JobDescription jobDescription)
jobDescription
- job identifierNotFoundRuntimeException
- if the job does not existpublic Set<WorkerInfo> getActiveWorkers()
public void cleanupStaleJob()
public Map<JobDescription,Job<?>> getJobs()
public Scheduler.WorkerInfoHub getWorkerInfoHub()
public JobMetaStore getJobMetaStore()
public Scheduler.SchedulerStats printJobsStatus()
Copyright © 2023. All Rights Reserved.