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

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

# Class ApplicationId

java.lang.Object
org.apache.hadoop.yarn.api.records.ApplicationId

All Implemented Interfaces:
  `Comparable<ApplicationId>`

@Public @Stable public abstract class ApplicationId extends Object implements Comparable<ApplicationId>

`ApplicationId` represents the globally unique identifier for an application.

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 application.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `appIdStrPrefix`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ApplicationId()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract void`
  `build()`
  `int`
  `compareTo(ApplicationId other)`
  `boolean`
  `equals(Object obj)`
  `static ApplicationId`
  `fromString(String appIdStr)`
  `abstract long`
  `getClusterTimestamp()`
  Get the start time of the `ResourceManager` which is used to generate globally unique `ApplicationId`.
  `abstract int`
  `getId()`
  Get the short integer identifier of the `ApplicationId` which is unique for all applications started by a particular instance of the `ResourceManager`.
  `int`
  `hashCode()`
  `static ApplicationId`
  `newInstance(long clusterTimestamp, int id)`
  `protected abstract void`
  `setClusterTimestamp(long clusterTimestamp)`
  `protected abstract void`
  `setId(int id)`
  `String`
  `toString()`

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

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

- ## Field Details

  - ### appIdStrPrefix

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

- ## Constructor Details

  - ### ApplicationId

    public ApplicationId()

- ## Method Details

  - ### newInstance

    @Public @Unstable public static ApplicationId newInstance(long clusterTimestamp, int id)

  - ### getId

    @Public @Stable public abstract int getId()
    Get the short integer identifier of the `ApplicationId` which is unique for all applications started by a particular instance of the `ResourceManager`.
    Returns:
      short integer identifier of the `ApplicationId`

  - ### setId

    @Private @Unstable protected abstract void setId(int id)

  - ### getClusterTimestamp

    @Public @Stable public abstract long getClusterTimestamp()
    Get the start time of the `ResourceManager` which is used to generate globally unique `ApplicationId`.
    Returns:
      start time of the `ResourceManager`

  - ### setClusterTimestamp

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

  - ### build

    protected abstract void build()

  - ### compareTo

    public int compareTo(ApplicationId other)
    Specified by:
      `compareTo` in interface `Comparable<ApplicationId>`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### fromString

    @Public @Stable public static ApplicationId fromString(String appIdStr)

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

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