p2pMapReduce.mapreduceModule
Class JobID
java.lang.Object
p2pMapReduce.mapreduceModule.ID
p2pMapReduce.mapreduceModule.JobID
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<ID>
public class JobID
- extends ID
- implements java.lang.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
,
org.apache.hadoop.mapred.JobTracker#getNewJobId()
,
org.apache.hadoop.mapred.JobTracker#getStartTime()
,
Serialized Form
Field Summary |
protected static java.text.NumberFormat |
idFormat
|
protected static java.lang.String |
JOB
|
Fields inherited from class p2pMapReduce.mapreduceModule.ID |
id, SEPARATOR |
Constructor Summary |
JobID()
|
JobID(java.lang.String jtIdentifier,
int id)
Constructs a JobID object |
Method Summary |
java.lang.StringBuilder |
appendTo(java.lang.StringBuilder builder)
Add the stuff after the "job" prefix to the given builder. |
int |
compareTo(ID o)
Compare JobIds by first jtIdentifiers, then by job numbers |
boolean |
equals(java.lang.Object o)
|
static JobID |
forName(java.lang.String str)
Construct a JobId object from given string |
java.lang.String |
getJtIdentifier()
|
int |
hashCode()
|
java.lang.String |
toString()
|
Methods inherited from class p2pMapReduce.mapreduceModule.ID |
getId |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
JOB
protected static final java.lang.String JOB
- See Also:
- Constant Field Values
idFormat
protected static final java.text.NumberFormat idFormat
JobID
public JobID(java.lang.String jtIdentifier,
int id)
- Constructs a JobID object
- Parameters:
jtIdentifier
- jobTracker identifierid
- job number
JobID
public JobID()
getJtIdentifier
public java.lang.String getJtIdentifier()
equals
public boolean equals(java.lang.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 java.lang.Comparable<ID>
- Overrides:
compareTo
in class ID
appendTo
public java.lang.StringBuilder appendTo(java.lang.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 java.lang.String toString()
- Overrides:
toString
in class ID
forName
public static JobID forName(java.lang.String str)
throws java.lang.IllegalArgumentException
- Construct a JobId object from given string
- Returns:
- constructed JobId object or null if the given String is null
- Throws:
java.lang.IllegalArgumentException
- if the given string is malformed