|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapred.ID
org.apache.hadoop.mapred.TaskID
public class TaskID
TaskID represents the immutable and unique identifier for
a Map or Reduce Task. Each TaskID encompasses multiple attempts made to
execute the Map or Reduce Task, each of which are uniquely indentified by
their TaskAttemptID.
TaskID consists of 3 parts. First part is the JobID, that this
TaskInProgress belongs to. Second part of the TaskID is either 'm' or 'r'
representing whether the task is a map task or a reduce task.
And the third part is the task number.
An example TaskID is :
task_200707121733_0003_m_000005 , which represents the
fifth map task in the third job running at the jobtracker
started at 200707121733.
Applications should never construct or parse TaskID strings
, but rather use appropriate constructors or forName(String)
method.
JobID,
TaskAttemptID| Field Summary |
|---|
| Fields inherited from class org.apache.hadoop.mapred.ID |
|---|
id |
| Constructor Summary | |
|---|---|
TaskID(JobID jobId,
boolean isMap,
int id)
Constructs a TaskID object from given JobID. |
|
TaskID(String jtIdentifier,
int jobId,
boolean isMap,
int id)
Constructs a TaskInProgressId object from given parts. |
|
| Method Summary | |
|---|---|
int |
compareTo(ID o)
Compare TaskInProgressIds by first jobIds, then by tip numbers. |
boolean |
equals(Object o)
|
static TaskID |
forName(String str)
Construct a TaskID object from given string |
JobID |
getJobID()
Returns the JobID object that this tip belongs to |
static String |
getTaskIDsPattern(String jtIdentifier,
Integer jobId,
Boolean isMap,
Integer taskId)
Returns a regex pattern which matches task IDs. |
int |
hashCode()
|
boolean |
isMap()
Returns whether this TaskID is a map ID |
static TaskID |
read(DataInput in)
|
void |
readFields(DataInput in)
Deserialize the fields of this object from in. |
String |
toString()
|
void |
write(DataOutput out)
Serialize the fields of this object to out. |
| Methods inherited from class org.apache.hadoop.mapred.ID |
|---|
getId |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TaskID(JobID jobId,
boolean isMap,
int id)
JobID.
jobId - JobID that this tip belongs toisMap - whether the tip is a mapid - the tip number
public TaskID(String jtIdentifier,
int jobId,
boolean isMap,
int id)
jtIdentifier - jobTracker identifierjobId - job numberisMap - whether the tip is a mapid - the tip number| Method Detail |
|---|
public JobID getJobID()
JobID object that this tip belongs to
public boolean isMap()
public boolean equals(Object o)
equals in class IDpublic int compareTo(ID o)
compareTo in interface Comparable<ID>compareTo in class IDpublic String toString()
toString in class IDpublic int hashCode()
hashCode in class ID
public void readFields(DataInput in)
throws IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface WritablereadFields in class IDin - DataInput to deseriablize this object from.
IOException
public void write(DataOutput out)
throws IOException
Writableout.
write in interface Writablewrite in class IDout - DataOuput to serialize this object into.
IOException
public static TaskID read(DataInput in)
throws IOException
IOException
public static TaskID forName(String str)
throws IllegalArgumentException
IllegalArgumentException - if the given string is malformed
public static String getTaskIDsPattern(String jtIdentifier,
Integer jobId,
Boolean isMap,
Integer taskId)
TaskID.getTaskIDsPattern(null, null, true, 1);which will return :
"task_[^_]*_[0-9]*_m_000001*"
jtIdentifier - jobTracker identifier, or nulljobId - job number, or nullisMap - whether the tip is a map, or nulltaskId - taskId number, or null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||