org.apache.hadoop.yarn.api.records

## Class ReservationId

- java.lang.Object
- - org.apache.hadoop.yarn.api.records.ReservationId

- All Implemented Interfaces:
    Comparable<ReservationId>

      @InterfaceAudience.Public
       @InterfaceStability.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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `clusterTimestamp`
    `protected long` | `id`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReservationId()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `build()`
    `int` | `compareTo(ReservationId other)`
    `boolean` | `equals(Object obj)`
    `abstract long` | `getClusterTimestamp()` Get the start time of the `ResourceManager` which is used to generate globally unique `ReservationId`.
    `abstract long` | `getId()` Get the long identifier of the `ReservationId` which is unique for all Reservations started by a particular instance of the `ResourceManager`.
    `int` | `hashCode()`
    `static ReservationId` | `parseReservationId(String reservationId)` Parse the string argument as a `ReservationId`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### clusterTimestamp

          protected long clusterTimestamp

    - #### id

          protected long id

  - ### Constructor Detail

    - #### ReservationId

          public ReservationId()

  - ### Method Detail

    - #### getId

          @InterfaceAudience.Public
           @InterfaceStability.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`

    - #### getClusterTimestamp

          @InterfaceAudience.Public
           @InterfaceStability.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`

    - #### 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

          @InterfaceAudience.Public
           @InterfaceStability.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`

Copyright © 2022 Apache Software Foundation. All rights reserved.