@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<JobMasterStatus> |
getAllJobMasterStatus()
Lists the status of all job masters in the cluster.
|
List<JobWorkerHealth> |
getAllWorkerHealth() |
Status |
getCmdStatus(long jobControlId)
Get command status.
|
CmdStatusBlock |
getCmdStatusDetailed(long jobControlId) |
Set<String> |
getFailedPaths(long jobControlId) |
long |
getMasterId(Address address)
Allocates an ID for the job master from the target address.
|
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() |
JobMasterMetaCommand |
jobMasterHeartbeat(long masterId,
JobMasterHeartbeatPOptions options)
Handles a heartbeat from a standby job master.
|
void |
jobMasterRegister(long masterId,
RegisterJobMasterPOptions options)
Handles the register request from a standby job master.
|
List<Long> |
list(ListAllPOptions options) |
List<Long> |
listCmds(ListAllPOptions options) |
List<JobInfo> |
listDetailed() |
long |
registerWorker(WorkerNetAddress workerNetAddress,
BuildVersion version)
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, restoreFromCheckpoint, writeToCheckpoint, 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 List<JobMasterStatus> getAllJobMasterStatus()
public long registerWorker(WorkerNetAddress workerNetAddress, BuildVersion version)
workerNetAddress
- the worker WorkerNetAddress
version
- the version info of the job workerpublic 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 workerpublic JobMasterMetaCommand jobMasterHeartbeat(long masterId, JobMasterHeartbeatPOptions options)
masterId
- the job master id allocated by the primary job masteroptions
- extra optionspublic void jobMasterRegister(long masterId, RegisterJobMasterPOptions options) throws NotFoundException
masterId
- the job master idoptions
- extra optionsNotFoundException
public long getMasterId(Address address)
address
- the addressCopyright © 2023. All Rights Reserved.