public class JobManager extends Object implements DeploymentManager, 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.
|
void |
deploy(JobID jobID,
Instance instance,
List<ExecutionVertex> verticesToBeDeployed)
Deploys the list of vertices on the given
Instance. |
AccumulatorEvent |
getAccumulatorResults(JobID jobID)
Get the final accumulator results.
|
Map<String,Accumulator<?,?>> |
getAccumulators(JobID jobID) |
ArchiveListener |
getArchive() |
int |
getAvailableSlots()
Returns the number of available slots among the registered task managers
|
List<AbstractEvent> |
getEvents(JobID jobID)
Retrieves the collected events for the job with the given job ID.
|
InstanceManager |
getInstanceManager() |
Map<InstanceConnectionInfo,Instance> |
getInstances() |
JobProgressResult |
getJobProgress(JobID jobID)
Retrieves the current status of the job specified by the given ID.
|
ManagementGraph |
getManagementGraph(JobID jobID)
Returns current ManagementGraph from eventCollector and, if not current, from archive
Retrieves the management graph for the job
with the given ID.
|
NetworkTopology |
getNetworkTopology(JobID jobID)
Retrieves the current network topology for the job with
the given ID.
|
int |
getNumberOfTaskTrackers() |
List<RecentJobEvent> |
getOldJobs() |
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.
|
static JobManager |
initialize(String[] args) |
boolean |
isShutDown()
Tests whether the job manager has been shut down completely.
|
void |
jobStatusHasChanged(ExecutionGraph executionGraph,
InternalJobStatus newJobStatus,
String optionalMessage)
Called when the status of the job with the given {@li
|
void |
killInstance(StringRecord instanceName)
Kills the instance with the given name (i.e.
|
void |
killTask(JobID jobID,
ManagementVertexID id)
Kills the task with the given vertex ID.
|
void |
logBufferUtilization(JobID jobID)
Triggers all task managers involved in processing the job with the given job ID to write the utilization of
their read and write buffers to their log files.
|
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
|
RegisterTaskManagerResult |
registerTaskManager(InstanceConnectionInfo instanceConnectionInfo,
HardwareDescription hardwareDescription,
IntegerRecord numberOfSlots)
Registers a task manager at the JobManager.
|
void |
reportAccumulatorResult(AccumulatorEvent accumulatorEvent)
Report accumulators that were collected in a task.
|
InputSplitWrapper |
requestNextInputSplit(JobID jobID,
ExecutionVertexID vertexID,
IntegerRecord sequenceNumber)
Requests the next split to be consumed by the task with the given execution vertex ID.
|
void |
sendHeartbeat(InstanceConnectionInfo instanceConnectionInfo)
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.
|
void |
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 static void main(String[] args)
args - arguments from the command linepublic static JobManager initialize(String[] args) throws Exception
Exceptionpublic 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 InstanceManager getInstanceManager()
public void sendHeartbeat(InstanceConnectionInfo instanceConnectionInfo)
JobManagerProtocolsendHeartbeat in interface JobManagerProtocolinstanceConnectionInfo - the information the job manager requires to connect to the instance's task managerpublic RegisterTaskManagerResult registerTaskManager(InstanceConnectionInfo instanceConnectionInfo, HardwareDescription hardwareDescription, IntegerRecord 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.public void updateTaskExecutionState(TaskExecutionState executionState) throws IOException
JobManagerProtocolupdateTaskExecutionState in interface JobManagerProtocolexecutionState - the new task execution stateIOException - thrown if an error occurs during this remote procedure callpublic 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 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 ManagementGraph getManagementGraph(JobID jobID) throws IOException
getManagementGraph in interface ExtendedManagementProtocoljobID - the ID identifying the jobIOException - thrown if an error occurs while retrieving the management graphpublic NetworkTopology getNetworkTopology(JobID jobID) throws IOException
ExtendedManagementProtocolgetNetworkTopology in interface ExtendedManagementProtocoljobID - the ID identifying the jobIOException - thrown if an error occurs while retrieving the network topologypublic 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 void killTask(JobID jobID, ManagementVertexID id) throws IOException
ExtendedManagementProtocolkillTask in interface ExtendedManagementProtocoljobID - the ID of the job the vertex to be killed belongs toid - the vertex ID which identified the task be killedIOException - thrown if an error occurs while transmitting the kill requestpublic void killInstance(StringRecord instanceName) throws IOException
ExtendedManagementProtocolkillInstance in interface ExtendedManagementProtocolinstanceName - the name of the instance to be killedIOException - thrown if an error occurs while transmitting the kill requestpublic boolean isShutDown()
true if the job manager has been shut down completely, false otherwisepublic void jobStatusHasChanged(ExecutionGraph executionGraph, InternalJobStatus newJobStatus, String optionalMessage)
JobStatusListenerjobStatusHasChanged in interface JobStatusListenerexecutionGraph - the executionGraph representing the job the event belongs tonewJobStatus - the new job statusoptionalMessage - an optional message (possibly null) that can be attached to the state changepublic void logBufferUtilization(JobID jobID) throws IOException
ExtendedManagementProtocollogBufferUtilization in interface ExtendedManagementProtocoljobID - the ID of the job to print the buffer distribution forIOException - throws if an error occurs while transmitting the requestpublic int getAvailableSlots()
ExtendedManagementProtocolgetAvailableSlots in interface ExtendedManagementProtocolpublic void deploy(JobID jobID, Instance instance, List<ExecutionVertex> verticesToBeDeployed)
DeploymentManagerInstance.deploy in interface DeploymentManagerjobID - the ID of the job the vertices to be deployed belong toinstance - the instance on which the vertices shall be deployedverticesToBeDeployed - the list of vertices to be deployedpublic InputSplitWrapper requestNextInputSplit(JobID jobID, ExecutionVertexID vertexID, IntegerRecord sequenceNumber) throws IOException
InputSplitProviderProtocolrequestNextInputSplit in interface InputSplitProviderProtocoljobID - the ID of the job the task to retrieve the next input split for belongs tovertexID - the ID of the task to retrieve the next input split forsequenceNumber - a sequence number, starting at 0 and increased by the task on each requestnull in case
no more input splits shall be consumed by the task with the given execution vertex IDIOException - thrown if an I/O error occurs while retrieving the new input splitpublic void startInfoServer()
public List<RecentJobEvent> getOldJobs() throws IOException
IOExceptionpublic ArchiveListener getArchive()
public int getNumberOfTaskTrackers()
public Map<InstanceConnectionInfo,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)
Copyright © 2014 The Apache Software Foundation. All rights reserved.