org.apache.tez.dag.records
Class TezTaskAttemptID
java.lang.Object
org.apache.tez.dag.records.TezID
org.apache.tez.dag.records.TezTaskAttemptID
- All Implemented Interfaces:
- Comparable<TezID>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<TezID>
@InterfaceAudience.Public
@InterfaceStability.Stable
public class TezTaskAttemptID
- extends TezID
TezTaskAttemptID represents the immutable and unique identifier for
a task attempt. Each task attempt is one particular instance of a Tez Task
identified by its TezTaskID.
TezTaskAttemptID consists of 2 parts. First part is the
TezTaskID, that this TaskAttemptID belongs to.
Second part is the task attempt number.
Applications should never construct or parse TaskAttemptID strings
, but rather use appropriate constructors or Class.forName(String)
method.
- See Also:
TezTaskID
ATTEMPT
public static final String ATTEMPT
- See Also:
- Constant Field Values
tezTaskAttemptIdFormat
protected static final ThreadLocal<NumberFormat> tezTaskAttemptIdFormat
TezTaskAttemptID
public TezTaskAttemptID()
getInstance
public static TezTaskAttemptID getInstance(TezTaskID taskID,
int id)
- Constructs a TaskAttemptID object from given
TezTaskID.
- Parameters:
taskID - TaskID that this task belongs toid - the task attempt number
getTaskID
public TezTaskID getTaskID()
- Returns the
TezTaskID object that this task attempt belongs to
equals
public boolean equals(Object o)
- Overrides:
equals in class TezID
appendTo
protected StringBuilder appendTo(StringBuilder builder)
- Add the unique string to the StringBuilder
- Parameters:
builder - the builder to append ot
- Returns:
- the builder that was passed in.
hashCode
public int hashCode()
- Overrides:
hashCode in class TezID
compareTo
public int compareTo(TezID o)
- Compare TaskIds by first tipIds, then by task numbers.
- Specified by:
compareTo in interface Comparable<TezID>- Overrides:
compareTo in class TezID
toString
public String toString()
- Overrides:
toString in class TezID
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields in interface org.apache.hadoop.io.Writable- Overrides:
readFields in class TezID
- Throws:
IOException
readTezTaskAttemptID
public static TezTaskAttemptID readTezTaskAttemptID(DataInput in)
throws IOException
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Specified by:
write in interface org.apache.hadoop.io.Writable- Overrides:
write in class TezID
- Throws:
IOException
fromString
public static TezTaskAttemptID fromString(String taIdStr)
Copyright © 2014 Apache Software Foundation. All rights reserved.