public class JobManager extends Object implements ExtendedManagementProtocol, InputSplitProviderProtocol, JobManagerProtocol, ChannelLookupProtocol, JobStatusListener, AccumulatorProtocol
| Constructor and Description |
|---|
JobManager(ExecutionMode executionMode) |
| Modifier and Type | Method and Description |
|---|---|
JobCancelResult |
cancelJob(JobID jobID)
Requests to cancel the job specified by the given ID.
|
AccumulatorEvent |
getAccumulatorResults(JobID jobID)
Get the final accumulator results.
|
Map<String,Accumulator<?,?>> |
getAccumulators(JobID jobID) |
ArchiveListener |
getArchive() |
int |
getBlobServerPort()
Returns the network port of the job manager's BLOB server.
|
Map<JobID,ExecutionGraph> |
getCurrentJobs() |
List<AbstractEvent> |
getEvents(JobID jobID)
Retrieves the collected events for the job with the given job ID.
|
InstanceManager |
getInstanceManager() |
Map<InstanceID,Instance> |
getInstances() |
JobProgressResult |
getJobProgress(JobID jobID)
Retrieves the current status of the job specified by the given ID.
|
int |
getNumberOfSlotsAvailableToScheduler() |
int |
getNumberOfTaskManagers() |
List<RecentJobEvent> |
getOldJobs() |
ExecutionGraph |
getRecentExecutionGraph(JobID jobID) |
List<RecentJobEvent> |
getRecentJobs()
Retrieves a list of jobs which have either running or have been started recently.
|
IntegerRecord |
getRecommendedPollingInterval()
Returns the recommended interval in seconds in which a client
is supposed to poll for progress information.
|
int |
getTotalNumberOfRegisteredSlots()
Returns the number of available slots among the registered task managers
|
static JobManager |
initialize(String[] args) |
boolean |
isShutDown()
Tests whether the job manager has been shut down completely.
|
void |
jobStatusHasChanged(ExecutionGraph executionGraph,
JobStatus newJobStatus,
String optionalMessage)
Called when the status of the job changed.
|
ConnectionInfoLookupResponse |
lookupConnectionInfo(InstanceConnectionInfo caller,
JobID jobID,
ChannelID sourceChannelID)
Retrieves all recipients of a data for the given
sourceChannelID. |
static void |
main(String[] args)
Entry point for the program
|
InstanceID |
registerTaskManager(InstanceConnectionInfo instanceConnectionInfo,
HardwareDescription hardwareDescription,
int numberOfSlots)
Registers a task manager at the JobManager.
|
void |
reportAccumulatorResult(AccumulatorEvent accumulatorEvent)
Report accumulators that were collected in a task.
|
InputSplitWrapper |
requestNextInputSplit(JobID jobID,
JobVertexID vertexId,
ExecutionAttemptID executionAttempt) |
boolean |
sendHeartbeat(InstanceID taskManagerId)
Sends a heart beat to the job manager.
|
void |
shutdown() |
void |
startInfoServer()
Starts the Jetty Infoserver for the Jobmanager
|
JobSubmissionResult |
submitJob(JobGraph job)
Submits the specified job to the job manager.
|
boolean |
updateTaskExecutionState(TaskExecutionState executionState)
Reports an update of a task's execution state to the job manager.
|
public JobManager(ExecutionMode executionMode) throws Exception
Exceptionpublic void shutdown()
public JobSubmissionResult submitJob(JobGraph job) throws IOException
JobManagementProtocolsubmitJob in interface JobManagementProtocoljob - the job to be executedIOException - thrown if an error occurred while transmitting the submit requestpublic JobCancelResult cancelJob(JobID jobID) throws IOException
JobManagementProtocolcancelJob in interface JobManagementProtocoljobID - the ID of the jobJobCancelResult containing the result of the cancel requestIOException - thrown if an error occurred while transmitting the requestpublic boolean updateTaskExecutionState(TaskExecutionState executionState) throws IOException
JobManagerProtocolupdateTaskExecutionState in interface JobManagerProtocolexecutionState - The new task execution state.IOException - Thrown, if an error occurs during this remote procedure callpublic InputSplitWrapper requestNextInputSplit(JobID jobID, JobVertexID vertexId, ExecutionAttemptID executionAttempt) throws IOException
requestNextInputSplit in interface InputSplitProviderProtocolIOExceptionpublic void jobStatusHasChanged(ExecutionGraph executionGraph, JobStatus newJobStatus, String optionalMessage)
JobStatusListenerjobStatusHasChanged in interface JobStatusListenerexecutionGraph - The executionGraph representing the job.newJobStatus - The new job status.optionalMessage - An optional message (possibly null) that can be attached to the state change.public JobProgressResult getJobProgress(JobID jobID) throws IOException
JobManagementProtocolgetJobProgress in interface JobManagementProtocoljobID - the ID of the jobJobProgressResult object including the current job progressIOException - thrown if an error occurred while transmitting the requestpublic ConnectionInfoLookupResponse lookupConnectionInfo(InstanceConnectionInfo caller, JobID jobID, ChannelID sourceChannelID)
ChannelLookupProtocolsourceChannelID.lookupConnectionInfo in interface ChannelLookupProtocolcaller - the InstanceConnectionInfo object of the task manager which calls this methodjobID - the ID of the job the channel ID belongs tosourceChannelID - the ID of the channel to resolvepublic boolean isShutDown()
true if the job manager has been shut down completely, false otherwisepublic InstanceManager getInstanceManager()
public IntegerRecord getRecommendedPollingInterval() throws IOException
JobManagementProtocolgetRecommendedPollingInterval in interface JobManagementProtocolIOException - thrown if an error occurred while transmitting the requestpublic List<RecentJobEvent> getRecentJobs() throws IOException
ExtendedManagementProtocolgetRecentJobs in interface ExtendedManagementProtocolIOException - thrown if an error occurs while retrieving the job listpublic List<AbstractEvent> getEvents(JobID jobID) throws IOException
ExtendedManagementProtocolgetEvents in interface ExtendedManagementProtocoljobID - the ID of the job to retrieve the events forIOException - thrown if an error occurs while retrieving the list of eventspublic int getTotalNumberOfRegisteredSlots()
ExtendedManagementProtocolgetTotalNumberOfRegisteredSlots in interface ExtendedManagementProtocolpublic int getNumberOfSlotsAvailableToScheduler()
getNumberOfSlotsAvailableToScheduler in interface ExtendedManagementProtocolpublic void startInfoServer()
public List<RecentJobEvent> getOldJobs() throws IOException
IOExceptionpublic ArchiveListener getArchive()
public int getNumberOfTaskManagers()
public Map<InstanceID,Instance> getInstances()
public void reportAccumulatorResult(AccumulatorEvent accumulatorEvent) throws IOException
AccumulatorProtocolreportAccumulatorResult in interface AccumulatorProtocolIOExceptionpublic AccumulatorEvent getAccumulatorResults(JobID jobID) throws IOException
AccumulatorProtocolgetAccumulatorResults in interface AccumulatorProtocolIOExceptionpublic Map<String,Accumulator<?,?>> getAccumulators(JobID jobID)
public Map<JobID,ExecutionGraph> getCurrentJobs()
public ExecutionGraph getRecentExecutionGraph(JobID jobID) throws IOException
IOExceptionpublic boolean sendHeartbeat(InstanceID taskManagerId)
JobManagerProtocolsendHeartbeat in interface JobManagerProtocoltaskManagerId - The ID identifying the task manager.public InstanceID registerTaskManager(InstanceConnectionInfo instanceConnectionInfo, HardwareDescription hardwareDescription, int numberOfSlots)
JobManagerProtocolregisterTaskManager in interface JobManagerProtocolinstanceConnectionInfo - the information the job manager requires to connect to the instance's task managerhardwareDescription - a hardware description with details on the instance's compute resources.numberOfSlots - The number of task slots that the TaskManager provides.public static void main(String[] args)
args - arguments from the command linepublic static JobManager initialize(String[] args) throws Exception
Exceptionpublic int getBlobServerPort()
ServiceDiscoveryProtocolgetBlobServerPort in interface ServiceDiscoveryProtocol-1 if the job manager does not run a BLOB
serverCopyright © 2015 The Apache Software Foundation. All rights reserved.