Class JobID

All Implemented Interfaces:
Comparable<ID>, Writable, WritableComparable<ID>

@Public @Stable public class JobID extends JobID
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". 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:
  • 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

    • downgrade

      public static JobID downgrade(JobID old)
      Downgrade a new JobID to an old one
      Parameters:
      old - a new or old JobID
      Returns:
      either old or a new JobID build to match old
    • read

      @Deprecated public static JobID read(DataInput in) throws IOException
      Deprecated.
      Throws:
      IOException
    • 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
    • getJobIDsPattern

      @Deprecated public static String getJobIDsPattern(String jtIdentifier, Integer jobId)
      Deprecated.
      Returns a regex pattern which matches task IDs. Arguments can be given null, in which case that part of the regex will be generic. For example to obtain a regex matching any job run on the jobtracker started at 200707121733, we would use :
       
       JobID.getTaskIDsPattern("200707121733", null);
       
      which will return :
       "job_200707121733_[0-9]*" 
      Parameters:
      jtIdentifier - jobTracker identifier, or null
      jobId - job number, or null
      Returns:
      a regex pattern matching JobIDs