org.apache.tez.dag.records
Class TezTaskAttemptID

java.lang.Object
  extended by org.apache.tez.dag.records.TezID
      extended by 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

Field Summary
static String ATTEMPT
           
protected static ThreadLocal<NumberFormat> tezTaskAttemptIdFormat
           
 
Fields inherited from class org.apache.tez.dag.records.TezID
id, SEPARATOR
 
Constructor Summary
TezTaskAttemptID()
           
 
Method Summary
protected  StringBuilder appendTo(StringBuilder builder)
          Add the unique string to the StringBuilder
 int compareTo(TezID o)
          Compare TaskIds by first tipIds, then by task numbers.
 boolean equals(Object o)
           
static TezTaskAttemptID fromString(String taIdStr)
           
static TezTaskAttemptID getInstance(TezTaskID taskID, int id)
          Constructs a TaskAttemptID object from given TezTaskID.
 TezTaskID getTaskID()
          Returns the TezTaskID object that this task attempt belongs to
 int hashCode()
           
 void readFields(DataInput in)
           
static TezTaskAttemptID readTezTaskAttemptID(DataInput in)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.tez.dag.records.TezID
getId, readID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTEMPT

public static final String ATTEMPT
See Also:
Constant Field Values

tezTaskAttemptIdFormat

protected static final ThreadLocal<NumberFormat> tezTaskAttemptIdFormat
Constructor Detail

TezTaskAttemptID

public TezTaskAttemptID()
Method Detail

getInstance

public static TezTaskAttemptID getInstance(TezTaskID taskID,
                                           int id)
Constructs a TaskAttemptID object from given TezTaskID.

Parameters:
taskID - TaskID that this task belongs to
id - 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.