org.apache.hadoop.mapreduce
Class JobID
java.lang.Object
org.apache.hadoop.mapreduce.ID
org.apache.hadoop.mapred.ID
org.apache.hadoop.mapreduce.JobID
- All Implemented Interfaces:
- Comparable<ID>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<ID>
- Direct Known Subclasses:
- JobID
@InterfaceAudience.Public
@InterfaceStability.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".
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:
TaskID
,
TaskAttemptID
Fields inherited from class org.apache.hadoop.mapreduce.ID |
id, SEPARATOR |
Constructor Summary |
JobID()
|
JobID(String jtIdentifier,
int id)
Constructs a JobID object |
Methods inherited from class org.apache.hadoop.mapreduce.ID |
getId |
JOB
protected static final String JOB
- See Also:
- Constant Field Values
JOBID_REGEX
public static final String JOBID_REGEX
- See Also:
- Constant Field Values
idFormat
protected static final NumberFormat idFormat
JobID
public JobID(String jtIdentifier,
int id)
- Constructs a JobID object
- Parameters:
jtIdentifier
- jobTracker identifierid
- job number
JobID
public JobID()
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
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Overrides:
readFields
in class ID
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Overrides:
write
in class ID
- 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
Copyright © 2012 Apache Software Foundation. All Rights Reserved.