public class TaskID extends ID
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. 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| Modifier and Type | Field and Description |
|---|---|
protected static java.text.NumberFormat |
idFormat |
protected static java.lang.String |
TASK |
| Constructor and Description |
|---|
TaskID() |
TaskID(JobID jobId,
boolean isMap,
int id)
Constructs a TaskID object from given
JobID. |
TaskID(java.lang.String jtIdentifier,
int jobId,
boolean isMap,
int id)
Constructs a TaskInProgressId object from given parts.
|
TaskID(java.lang.String jtIdentifier,
int jobId,
TaskType type,
int id)
Constructs a TaskInProgressId object from given parts.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.StringBuilder |
appendTo(java.lang.StringBuilder builder)
Add the unique string to the given builder.
|
int |
compareTo(ID o)
Compare TaskInProgressIds by first jobIds, then by tip numbers.
|
boolean |
equals(java.lang.Object o) |
static TaskID |
forName(java.lang.String str)
Construct a TaskID object from given string
|
JobID |
getJobID()
Returns the
JobID object that this tip belongs to |
TaskType |
getTaskType()
Get the type of the task
|
int |
hashCode() |
boolean |
isMap()
Returns whether this TaskID is a map ID
|
void |
readFields(java.io.DataInput in) |
java.lang.String |
toString() |
void |
write(java.io.DataOutput out) |
protected static final java.lang.String TASK
protected static final java.text.NumberFormat idFormat
public TaskID(JobID jobId, boolean isMap, int id)
JobID.jobId - JobID that this tip belongs toisMap - whether the tip is a mapid - the tip numberpublic TaskID(java.lang.String jtIdentifier,
int jobId,
boolean isMap,
int id)
jtIdentifier - jobTracker identifierjobId - job numberisMap - whether the tip is a mapid - the tip numberpublic TaskID(java.lang.String jtIdentifier,
int jobId,
TaskType type,
int id)
jtIdentifier - jobTracker identifierjobId - job numbertype - the TaskTypeid - the tip numberpublic TaskID()
public boolean isMap()
public TaskType getTaskType()
public int compareTo(ID o)
protected java.lang.StringBuilder appendTo(java.lang.StringBuilder builder)
builder - the builder to append topublic void readFields(java.io.DataInput in)
throws java.io.IOException
readFields in interface org.apache.hadoop.io.WritablereadFields in class IDjava.io.IOExceptionpublic void write(java.io.DataOutput out)
throws java.io.IOException
public static TaskID forName(java.lang.String str) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if the given string is malformedCopyright © 2009 The Apache Software Foundation