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
限定符和类型 | 字段和说明 |
---|---|
protected static NumberFormat |
idFormat |
protected static String |
TASK |
构造器和说明 |
---|
TaskID() |
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.
|
限定符和类型 | 方法和说明 |
---|---|
protected StringBuilder |
appendTo(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(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 |
int |
hashCode() |
boolean |
isMap()
Returns whether this TaskID is a map ID
|
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 . |
protected static final 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(String jtIdentifier, int jobId, boolean isMap, int id)
jtIdentifier
- jobTracker identifierjobId
- job numberisMap
- whether the tip is a mapid
- the tip numberpublic TaskID()
public boolean isMap()
public int compareTo(ID o)
compareTo
在接口中 Comparable<ID>
compareTo
在类中 ID
protected StringBuilder appendTo(StringBuilder builder)
builder
- the builder to append topublic void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
在接口中 Writable
readFields
在类中 ID
in
- DataInput
to deseriablize this object from.IOException
public void write(DataOutput out) throws IOException
Writable
out
.write
在接口中 Writable
write
在类中 ID
out
- DataOuput
to serialize this object into.IOException
public static TaskID forName(String str) throws IllegalArgumentException
IllegalArgumentException
- if the given string is malformedCopyright © 2009 The Apache Software Foundation