Package org.apache.hadoop.mapreduce
Class ID
java.lang.Object
org.apache.hadoop.mapreduce.ID
- All Implemented Interfaces:
Comparable<ID>,Writable,WritableComparable<ID>
- Direct Known Subclasses:
ID
A general identifier, which internally stores the id
as an integer. This is the super class of
JobID,
TaskID and TaskAttemptID.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompare IDs by associated numbersbooleanintgetId()returns the int which represents the identifierinthashCode()voidreadFields(DataInput in) Deserialize the fields of this object fromin.toString()voidwrite(DataOutput out) Serialize the fields of this object toout.
-
Field Details
-
SEPARATOR
protected static final char SEPARATOR- See Also:
-
id
protected int id
-
-
Constructor Details
-
ID
public ID(int id) constructs an ID object from the given int -
ID
protected ID()
-
-
Method Details
-
getId
public int getId()returns the int which represents the identifier -
toString
-
hashCode
public int hashCode() -
equals
-
compareTo
Compare IDs by associated numbers- Specified by:
compareToin interfaceComparable<ID>
-
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- 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- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-