Class JobID

All Implemented Interfaces:
Comparable<ID>, Writable, WritableComparable<ID>
Direct Known Subclasses:
JobID

@Public @Stable public class JobID extends ID implements Comparable<ID>
JobID represents the immutable and unique identifier for the job. JobID consists of two parts. First part represents the jobtracker identifier, so that jobID to jobtracker map is defined. For cluster setup this string is the jobtracker start time, for local setting, it is "local" and a random number. Second part of the JobID is the job number.
An example JobID is : job_200707121733_0003 , which represents the third job running at the jobtracker started at 200707121733.

Applications should never construct or parse JobID strings, but rather use appropriate constructors or forName(String) method.

See Also:
  • Field Details

  • Constructor Details

    • JobID

      public JobID(String jtIdentifier, int id)
      Constructs a JobID object
      Parameters:
      jtIdentifier - jobTracker identifier
      id - job number
    • JobID

      public JobID()
  • Method Details

    • getJtIdentifier

      public String getJtIdentifier()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ID
    • compareTo

      public int compareTo(ID o)
      Compare JobIds by first jtIdentifiers, then by job numbers
      Specified by:
      compareTo in interface Comparable<ID>
      Overrides:
      compareTo in class ID
    • appendTo

      public StringBuilder appendTo(StringBuilder builder)
      Add the stuff after the "job" prefix to the given builder. This is useful, because the sub-ids use this substring at the start of their string.
      Parameters:
      builder - the builder to append to
      Returns:
      the builder that was passed in
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ID
    • toString

      public String toString()
      Overrides:
      toString in class ID
    • readFields

      public void readFields(DataInput in) throws IOException
      Description copied from interface: Writable
      Deserialize the fields of this object from in.

      For efficiency, implementations should attempt to re-use storage in the existing object where possible.

      Specified by:
      readFields in interface Writable
      Overrides:
      readFields in class ID
      Parameters:
      in - DataInput to deseriablize this object from.
      Throws:
      IOException - any other problem for readFields.
    • write

      public void write(DataOutput out) throws IOException
      Description copied from interface: Writable
      Serialize the fields of this object to out.
      Specified by:
      write in interface Writable
      Overrides:
      write in class ID
      Parameters:
      out - DataOuput to serialize this object into.
      Throws:
      IOException - any other problem for write.
    • forName

      public static JobID forName(String str) throws IllegalArgumentException
      Construct a JobId object from given string
      Returns:
      constructed JobId object or null if the given String is null
      Throws:
      IllegalArgumentException - if the given string is malformed