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 Details

    • reserveIdStrPrefix

      @Private @Unstable public static final String reserveIdStrPrefix
      See Also:
    • clusterTimestamp

      protected long clusterTimestamp
    • id

      protected long id
  • Constructor Details

    • ReservationId

      public ReservationId()
  • Method Details

    • newInstance

      @Private @Unstable public static ReservationId newInstance(long clusterTimestamp, long id)
    • getId

      @Public @Unstable public abstract long getId()
      Get the long identifier of the ReservationId which is unique for all Reservations started by a particular instance of the ResourceManager.
      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 the ResourceManager which is used to generate globally unique ReservationId.
      Returns:
      start time of the ResourceManager
    • setClusterTimestamp

      @Private @Unstable protected abstract void setClusterTimestamp(long clusterTimestamp)
    • build

      protected abstract void build()
    • compareTo

      public int compareTo(ReservationId other)
      Specified by:
      compareTo in interface Comparable<ReservationId>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parseReservationId

      @Public @Unstable public static ReservationId parseReservationId(String reservationId) throws IOException
      Parse the string argument as a ReservationId
      Parameters:
      reservationId - the string representation of the ReservationId
      Returns:
      the ReservationId corresponding to the input string if valid, null if input is null
      Throws:
      IOException - if unable to parse the input string
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object