@ThreadSafe public class JobMaster extends AbstractMaster implements NoopJournaled
mClock, mJournal, 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<JobInfo> |
failed(int limit,
long before,
long after) |
Set<String> |
getAllFailedPaths() |
List<JobWorkerHealth> |
getAllWorkerHealth() |
Status |
getCmdStatus(long jobControlId)
Get command status.
|
CmdStatusBlock |
getCmdStatusDetailed(long jobControlId) |
Set<String> |
getFailedPaths(long jobControlId) |
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(ListAllPOptions options) |
List<Long> |
listCmds(ListAllPOptions options) |
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.
|
void |
stop()
Stops the Alluxio server.
|
long |
submit(CmdConfig cmdConfig)
Submit a job with the given configuration.
|
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, getMasterContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCheckpointName, getJournalEntryIterator, processJournalEntry, resetState, restoreFromCheckpoint, writeToCheckpoint
applyAndJournal
getStandbyServices
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 void stop() throws IOException
Server
#start(T)
should be
cleaned up and shutdown.stop
in interface Server<Boolean>
stop
in class AbstractMaster
IOException
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 long submit(CmdConfig cmdConfig) throws JobDoesNotExistException, IOException
cmdConfig
- the CMD configurationJobDoesNotExistException
- when the job doesn't existResourceExhaustedException
- if the job master is too busy to run the jobIOException
public void cancel(long jobId) throws JobDoesNotExistException
jobId
- the id of the jobJobDoesNotExistException
- when the job does not existpublic Status getCmdStatus(long jobControlId) throws JobDoesNotExistException
jobControlId
- JobDoesNotExistException
public List<Long> list(ListAllPOptions options)
options
- listing optionspublic List<Long> listCmds(ListAllPOptions options) throws JobDoesNotExistException
options
- listing options (using existing options)JobDoesNotExistException
public CmdStatusBlock getCmdStatusDetailed(long jobControlId) throws JobDoesNotExistException
jobControlId
- job control ID of a commandJobDoesNotExistException
public Set<String> getFailedPaths(long jobControlId) throws JobDoesNotExistException
jobControlId
- job control idJobDoesNotExistException
public List<JobInfo> failed(int limit, long before, long after)
limit
- maximum number of jobInfos to returnbefore
- filters out on or after this timestamp (in ms) (-1 to disable)after
- filter out on or before this timestamp (in ms) (-1 to disable)public 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)
jobWorkerHealth
- the job worker health infotaskInfoList
- the list of the task informationJobCommand
to the workerCopyright © 2023. All Rights Reserved.