Package org.apache.hadoop.mapred
Interface RunningJob
@Public
@Stable
public interface RunningJob
RunningJob is the user-interface to query for details on a
running Map-Reduce job.
Clients can get hold of RunningJob via the JobClient
and then query the running-job for details such as name, configuration,
progress etc.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfloatGet the progress of the job's cleanup-tasks, as a float between 0.0 and 1.0.Get the underlying job configurationGets the counters for this job.Get failure info for the job.Get the url where history file is archived.getID()Get the job identifier.Get the path of the submitted job configuration.getJobID()Deprecated.This method is deprecated and will be removed.Get the name of the job.intReturns the current state of the Job.Returns a snapshot of the current status,JobStatus, of the Job.getTaskCompletionEvents(int startFrom) Get events indicating completion (success/failure) of component tasks.String[]getTaskDiagnostics(TaskAttemptID taskid) Gets the diagnostic messages for a given task attempt.Get the URL where some job progress information will be displayed.booleanCheck if the job is finished or not.booleanCheck whether the job has been removed from JobTracker memory and retired.booleanCheck if the job completed successfully.voidkillJob()Kill the running job.voidDeprecated.Applications should rather usekillTask(TaskAttemptID, boolean)voidkillTask(TaskAttemptID taskId, boolean shouldFail) Kill indicated task attempt.floatGet the progress of the job's map-tasks, as a float between 0.0 and 1.0.floatGet the progress of the job's reduce-tasks, as a float between 0.0 and 1.0.voidsetJobPriority(String priority) Set the priority of a running job.floatGet the progress of the job's setup-tasks, as a float between 0.0 and 1.0.voidBlocks until the job is complete.
-
Method Details
-
getConfiguration
Configuration getConfiguration()Get the underlying job configuration- Returns:
- the configuration of the job.
-
getID
JobID getID()Get the job identifier.- Returns:
- the job identifier.
-
getJobID
Deprecated.This method is deprecated and will be removed. Applications should rather usegetID(). -
getJobName
String getJobName()Get the name of the job.- Returns:
- the name of the job.
-
getJobFile
String getJobFile()Get the path of the submitted job configuration.- Returns:
- the path of the submitted job configuration.
-
getTrackingURL
String getTrackingURL()Get the URL where some job progress information will be displayed.- Returns:
- the URL where some job progress information will be displayed.
-
mapProgress
Get the progress of the job's map-tasks, as a float between 0.0 and 1.0. When all map tasks have completed, the function returns 1.0.- Returns:
- the progress of the job's map-tasks.
- Throws:
IOException
-
reduceProgress
Get the progress of the job's reduce-tasks, as a float between 0.0 and 1.0. When all reduce tasks have completed, the function returns 1.0.- Returns:
- the progress of the job's reduce-tasks.
- Throws:
IOException
-
cleanupProgress
Get the progress of the job's cleanup-tasks, as a float between 0.0 and 1.0. When all cleanup tasks have completed, the function returns 1.0.- Returns:
- the progress of the job's cleanup-tasks.
- Throws:
IOException
-
setupProgress
Get the progress of the job's setup-tasks, as a float between 0.0 and 1.0. When all setup tasks have completed, the function returns 1.0.- Returns:
- the progress of the job's setup-tasks.
- Throws:
IOException
-
isComplete
Check if the job is finished or not. This is a non-blocking call.- Returns:
trueif the job is complete, elsefalse.- Throws:
IOException
-
isSuccessful
Check if the job completed successfully.- Returns:
trueif the job succeeded, elsefalse.- Throws:
IOException
-
waitForCompletion
Blocks until the job is complete.- Throws:
IOException
-
getJobState
Returns the current state of the Job.JobStatus- Throws:
IOException
-
getJobStatus
Returns a snapshot of the current status,JobStatus, of the Job. Need to call again for latest information.- Throws:
IOException
-
killJob
Kill the running job. Blocks until all job tasks have been killed as well. If the job is no longer running, it simply returns.- Throws:
IOException
-
setJobPriority
Set the priority of a running job.- Parameters:
priority- the new priority for the job.- Throws:
IOException
-
getTaskCompletionEvents
Get events indicating completion (success/failure) of component tasks.- Parameters:
startFrom- index to start fetching events from- Returns:
- an array of
TaskCompletionEvents - Throws:
IOException
-
killTask
Kill indicated task attempt.- Parameters:
taskId- the id of the task to be terminated.shouldFail- if true the task is failed and added to failed tasks list, otherwise it is just killed, w/o affecting job failure status.- Throws:
IOException
-
killTask
Deprecated.Applications should rather usekillTask(TaskAttemptID, boolean)- Throws:
IOException
-
getCounters
Gets the counters for this job.- Returns:
- the counters for this job or null if the job has been retired.
- Throws:
IOException
-
getTaskDiagnostics
Gets the diagnostic messages for a given task attempt.- Parameters:
taskid-- Returns:
- the list of diagnostic messages for the task
- Throws:
IOException
-
getHistoryUrl
Get the url where history file is archived. Returns empty string if history file is not available yet.- Returns:
- the url where history file is archived
- Throws:
IOException
-
isRetired
Check whether the job has been removed from JobTracker memory and retired. On retire, the job history file is copied to a location known bygetHistoryUrl()- Returns:
trueif the job retired, elsefalse.- Throws:
IOException
-
getFailureInfo
Get failure info for the job.- Returns:
- the failure info for the job.
- Throws:
IOException
-