ReservationId (Apache Hadoop YARN API 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.api.records, class: ReservationId

Package org.apache.hadoop.yarn.api.records

# 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

  Fields
  Modifier and Type
  Field
  Description
  `protected long`
  `clusterTimestamp`
  `protected long`
  `id`
  `static final String`
  `reserveIdStrPrefix`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReservationId()`

- ## Method Summary

  Modifier and Type
  Method
  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`
  `newInstance(long clusterTimestamp, long id)`
  `static ReservationId`
  `parseReservationId(String reservationId)`
  Parse the string argument as a `ReservationId`
  `protected abstract void`
  `setClusterTimestamp(long clusterTimestamp)`
  `protected abstract void`
  `setId(long id)`
  `String`
  `toString()`

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

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

- ## Field Details

  - ### reserveIdStrPrefix

    @Private @Unstable public static final String reserveIdStrPrefix
    See Also:
      - Constant Field Values

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