@ThreadSafe public final class Scheduler extends Object
Constructor and Description |
---|
Scheduler(WorkerProvider workerProvider,
JobMetaStore jobMetaStore)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanupStaleJob()
Removes all finished jobs outside the retention time.
|
Map<WorkerInfo,CloseableResource<BlockWorkerClient>> |
getActiveWorkers()
Get active workers.
|
String |
getJobProgress(JobDescription jobDescription,
JobProgressReportFormat format,
boolean verbose)
Get the job's progress report.
|
Map<JobDescription,Job<?>> |
getJobs()
Get jobs.
|
void |
start()
Start scheduler.
|
void |
stop()
Stop scheduler.
|
boolean |
stopJob(JobDescription jobDescription)
Stop a job.
|
boolean |
submitJob(Job<?> job)
Submit a job.
|
void |
updateWorkers()
Refresh active workers.
|
public Scheduler(WorkerProvider workerProvider, JobMetaStore jobMetaStore)
workerProvider
- workerProviderjobMetaStore
- jobMetaStorepublic void start()
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 Map<WorkerInfo,CloseableResource<BlockWorkerClient>> getActiveWorkers()
public void cleanupStaleJob()
public void updateWorkers()
public Map<JobDescription,Job<?>> getJobs()
Copyright © 2023. All Rights Reserved.