@ThreadSafe public class JobMaster extends AbstractMaster implements NoopJournaled
mClock, mMasterContext
Constructor and Description |
---|
JobMaster(MasterContext masterContext,
FileSystem filesystem,
FileSystemContext fsContext,
UfsManager ufsManager)
Creates a new instance of
JobMaster . |
Modifier and Type | Method and Description |
---|---|
void |
cancel(long jobId)
Cancels a job.
|
List<JobWorkerHealth> |
getAllWorkerHealth() |
String |
getName() |
long |
getNewJobId() |
Map<ServiceType,GrpcService> |
getServices() |
JobInfo |
getStatus(long jobId)
Gets information of the given job id (verbose = True).
|
JobInfo |
getStatus(long jobId,
boolean verbose)
Gets information of the given job id.
|
JobServiceSummary |
getSummary()
Gets summary of the job service.
|
List<WorkerInfo> |
getWorkerInfoList() |
List<Long> |
list() |
List<JobInfo> |
listDetailed() |
long |
registerWorker(WorkerNetAddress workerNetAddress)
Returns a worker id for the given worker.
|
long |
run(JobConfig jobConfig)
Runs a job with the given configuration.
|
void |
run(JobConfig jobConfig,
long jobId)
Runs a job with the given configuration and job id.
|
void |
setTaskPoolSize(int taskPoolSize) |
void |
start(Boolean isLeader)
Starts the Alluxio server.
|
List<JobCommand> |
workerHeartbeat(JobWorkerHealth jobWorkerHealth,
List<TaskInfo> taskInfoList)
Updates the tasks' status when a worker periodically heartbeats with the master, and sends the
commands for the worker to execute.
|
close, createJournalContext, getDependencies, getExecutorService, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCheckpointName, getJournalEntryIterator, processJournalEntry, resetState, restoreFromCheckpoint, writeToCheckpoint
applyAndJournal
public JobMaster(MasterContext masterContext, FileSystem filesystem, FileSystemContext fsContext, UfsManager ufsManager)
JobMaster
.masterContext
- the context for Alluxio masterfilesystem
- the Alluxio filesystem client the job master uses to communicatefsContext
- the filesystem client's underlying contextufsManager
- the ufs managerpublic long getNewJobId()
public void start(Boolean isLeader) throws IOException
Server
start
in interface Server<Boolean>
start
in class AbstractMaster
isLeader
- the start optionsIOException
public Map<ServiceType,GrpcService> getServices()
getServices
in interface Server<Boolean>
public String getName()
public long run(JobConfig jobConfig) throws JobDoesNotExistException, ResourceExhaustedException
jobConfig
- the job configurationJobDoesNotExistException
- when the job doesn't existResourceExhaustedException
- if the job master is too busy to run the jobpublic void run(JobConfig jobConfig, long jobId) throws JobDoesNotExistException, ResourceExhaustedException
jobConfig
- the job configurationjobId
- the job idJobDoesNotExistException
- when the job doesn't existResourceExhaustedException
- if the job master is too busy to run the jobpublic void cancel(long jobId) throws JobDoesNotExistException
jobId
- the id of the jobJobDoesNotExistException
- when the job does not existpublic JobInfo getStatus(long jobId) throws JobDoesNotExistException
jobId
- the id of the jobJobDoesNotExistException
- if the job does not existpublic JobInfo getStatus(long jobId, boolean verbose) throws JobDoesNotExistException
jobId
- the id of the jobverbose
- whether the job info should be verboseJobDoesNotExistException
- if the job does not existpublic JobServiceSummary getSummary()
JobServiceSummary
public List<JobWorkerHealth> getAllWorkerHealth()
public long registerWorker(WorkerNetAddress workerNetAddress)
workerNetAddress
- the worker WorkerNetAddress
public List<WorkerInfo> getWorkerInfoList()
WorkerInfo
objects representing the workers in Alluxiopublic void setTaskPoolSize(int taskPoolSize)
taskPoolSize
- the task pool size for the job workerspublic List<JobCommand> workerHeartbeat(JobWorkerHealth jobWorkerHealth, List<TaskInfo> taskInfoList) throws ResourceExhaustedException
jobWorkerHealth
- the job worker health infotaskInfoList
- the list of the task informationJobCommand
to the workerResourceExhaustedException
Copyright © 2023. All Rights Reserved.