Package org.apache.hadoop.mapred
Class TaskAttemptID
java.lang.Object
org.apache.hadoop.mapreduce.ID
org.apache.hadoop.mapred.ID
org.apache.hadoop.mapreduce.TaskAttemptID
org.apache.hadoop.mapred.TaskAttemptID
- All Implemented Interfaces:
Comparable<ID>,Writable,WritableComparable<ID>
TaskAttemptID represents the immutable and unique identifier for
a task attempt. Each task attempt is one particular instance of a Map or
Reduce Task identified by its TaskID.
TaskAttemptID consists of 2 parts. First part is the
An example TaskAttemptID is :
TaskID, that this TaskAttemptID belongs to.
Second part is the task attempt number. An example TaskAttemptID is :
attempt_200707121733_0003_m_000005_0 , which represents the
zeroth task attempt for the fifth map task in the third job
running at the jobtracker started at 200707121733.
Applications should never construct or parse TaskAttemptID strings
, but rather use appropriate constructors or forName(String)
method.
-
Field Summary
Fields inherited from class org.apache.hadoop.mapreduce.TaskAttemptID
ATTEMPT -
Constructor Summary
ConstructorsConstructorDescriptionTaskAttemptID(String jtIdentifier, int jobId, boolean isMap, int taskId, int id) Deprecated.TaskAttemptID(String jtIdentifier, int jobId, TaskType type, int taskId, int id) Constructs a TaskId object from given parts.TaskAttemptID(TaskID taskId, int id) Constructs a TaskAttemptID object from givenTaskID. -
Method Summary
Modifier and TypeMethodDescriptionstatic TaskAttemptIDdowngrade(TaskAttemptID old) Downgrade a new TaskAttemptID to an old onestatic TaskAttemptIDConstruct a TaskAttemptID object from given stringgetJobID()Returns theJobIDobject that this task attempt belongs tostatic StringgetTaskAttemptIDsPattern(String jtIdentifier, Integer jobId, Boolean isMap, Integer taskId, Integer attemptId) Deprecated.static StringgetTaskAttemptIDsPattern(String jtIdentifier, Integer jobId, TaskType type, Integer taskId, Integer attemptId) Deprecated.Returns theTaskIDobject that this task attempt belongs tostatic TaskAttemptIDDeprecated.Methods inherited from class org.apache.hadoop.mapreduce.TaskAttemptID
appendTo, compareTo, equals, getTaskType, hashCode, isMap, readFields, toString, write
-
Constructor Details
-
TaskAttemptID
Constructs a TaskAttemptID object from givenTaskID.- Parameters:
taskId- TaskID that this task belongs toid- the task attempt number
-
TaskAttemptID
Deprecated.Constructs a TaskId object from given parts.- Parameters:
jtIdentifier- jobTracker identifierjobId- job numberisMap- whether the tip is a maptaskId- taskId numberid- the task attempt number
-
TaskAttemptID
Constructs a TaskId object from given parts.- Parameters:
jtIdentifier- jobTracker identifierjobId- job numbertype- the TaskTypetaskId- taskId numberid- the task attempt number
-
TaskAttemptID
public TaskAttemptID()
-
-
Method Details
-
downgrade
Downgrade a new TaskAttemptID to an old one- Parameters:
old- the new id- Returns:
- either old or a new TaskAttemptID constructed to match old
-
getTaskID
Description copied from class:TaskAttemptIDReturns theTaskIDobject that this task attempt belongs to- Overrides:
getTaskIDin classTaskAttemptID
-
getJobID
Description copied from class:TaskAttemptIDReturns theJobIDobject that this task attempt belongs to- Overrides:
getJobIDin classTaskAttemptID
-
read
Deprecated.- Throws:
IOException
-
forName
Construct a TaskAttemptID object from given string- Returns:
- constructed TaskAttemptID object or null if the given String is null
- Throws:
IllegalArgumentException- if the given string is malformed
-
getTaskAttemptIDsPattern
@Deprecated public static String getTaskAttemptIDsPattern(String jtIdentifier, Integer jobId, Boolean isMap, Integer taskId, Integer attemptId) Deprecated.Returns a regex pattern which matches task attempt IDs. Arguments can be given null, in which case that part of the regex will be generic. For example to obtain a regex matching all task attempt IDs of any jobtracker, in any job, of the first map task, we would use :TaskAttemptID.getTaskAttemptIDsPattern(null, null, true, 1, null);
which will return :"attempt_[^_]*_[0-9]*_m_000001_[0-9]*"
- Parameters:
jtIdentifier- jobTracker identifier, or nulljobId- job number, or nullisMap- whether the tip is a map, or nulltaskId- taskId number, or nullattemptId- the task attempt number, or null- Returns:
- a regex pattern matching TaskAttemptIDs
-
getTaskAttemptIDsPattern
@Deprecated public static String getTaskAttemptIDsPattern(String jtIdentifier, Integer jobId, TaskType type, Integer taskId, Integer attemptId) Deprecated.Returns a regex pattern which matches task attempt IDs. Arguments can be given null, in which case that part of the regex will be generic. For example to obtain a regex matching all task attempt IDs of any jobtracker, in any job, of the first map task, we would use :TaskAttemptID.getTaskAttemptIDsPattern(null, null, TaskType.MAP, 1, null);
which will return :"attempt_[^_]*_[0-9]*_m_000001_[0-9]*"
- Parameters:
jtIdentifier- jobTracker identifier, or nulljobId- job number, or nulltype- theTaskTypetaskId- taskId number, or nullattemptId- the task attempt number, or null- Returns:
- a regex pattern matching TaskAttemptIDs
-
TaskAttemptID(String, int, TaskType, int, int).