Package 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>,Writable,WritableComparable<ID>
- Direct Known Subclasses:
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" and a random number.
Second part of the JobID is the job number.
An example JobID is :
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final NumberFormatstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendTo(StringBuilder builder) Add the stuff after the "job" prefix to the given builder.intCompare JobIds by first jtIdentifiers, then by job numbersbooleanstatic JobIDConstruct a JobId object from given stringinthashCode()voidreadFields(DataInput in) Deserialize the fields of this object fromin.toString()voidwrite(DataOutput out) Serialize the fields of this object toout.
-
Field Details
-
JOB
- See Also:
-
JOBID_REGEX
- See Also:
-
idFormat
-
-
Constructor Details
-
JobID
Constructs a JobID object- Parameters:
jtIdentifier- jobTracker identifierid- job number
-
JobID
public JobID()
-
-
Method Details
-
getJtIdentifier
-
equals
-
compareTo
Compare JobIds by first jtIdentifiers, then by job numbers- Specified by:
compareToin interfaceComparable<ID>- Overrides:
compareToin classID
-
appendTo
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() -
toString
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Overrides:
readFieldsin classID- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-
write
Description copied from interface:WritableSerialize the fields of this object toout.- Specified by:
writein interfaceWritable- Overrides:
writein classID- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
forName
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
-