Class ReservationId
java.lang.Object
org.apache.hadoop.yarn.api.records.ReservationId
- All Implemented Interfaces:
Comparable<ReservationId>
@Public
@Unstable
public abstract class ReservationId
extends Object
implements Comparable<ReservationId>
ReservationId represents the globally unique identifier for
a reservation.
The globally unique nature of the identifier is achieved by using the
cluster timestamp i.e. start-time of the ResourceManager
along with a monotonically increasing counter for the reservation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected longstatic final StringreserveIdStrPrefix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidbuild()intcompareTo(ReservationId other) booleanabstract longGet the start time of theResourceManagerwhich is used to generate globally uniqueReservationId.abstract longgetId()Get the long identifier of theReservationIdwhich is unique for all Reservations started by a particular instance of theResourceManager.inthashCode()static ReservationIdnewInstance(long clusterTimestamp, long id) static ReservationIdparseReservationId(String reservationId) Parse the string argument as aReservationIdprotected abstract voidsetClusterTimestamp(long clusterTimestamp) protected abstract voidsetId(long id) toString()
-
Field Details
-
reserveIdStrPrefix
- See Also:
-
clusterTimestamp
protected long clusterTimestamp -
id
protected long id
-
-
Constructor Details
-
ReservationId
public ReservationId()
-
-
Method Details
-
newInstance
-
getId
@Public @Unstable public abstract long getId()Get the long identifier of theReservationIdwhich is unique for all Reservations started by a particular instance of theResourceManager.- Returns:
- long identifier of the
ReservationId
-
setId
@Private @Unstable protected abstract void setId(long id) -
getClusterTimestamp
@Public @Unstable public abstract long getClusterTimestamp()Get the start time of theResourceManagerwhich is used to generate globally uniqueReservationId.- Returns:
- start time of the
ResourceManager
-
setClusterTimestamp
@Private @Unstable protected abstract void setClusterTimestamp(long clusterTimestamp) -
build
protected abstract void build() -
compareTo
- Specified by:
compareToin interfaceComparable<ReservationId>
-
toString
-
parseReservationId
@Public @Unstable public static ReservationId parseReservationId(String reservationId) throws IOException Parse the string argument as aReservationId- Parameters:
reservationId- the string representation of theReservationId- Returns:
- the
ReservationIdcorresponding to the input string if valid, null if input is null - Throws:
IOException- if unable to parse the input string
-
hashCode
public int hashCode() -
equals
-