org.apache.hadoop.yarn.api.records

## Class ApplicationId

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

- All Implemented Interfaces:
    Comparable<ApplicationId>

      @InterfaceAudience.Public
       @InterfaceStability.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 and Description
    --- | ---
    `static String` | `appIdStrPrefix`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApplicationId()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### appIdStrPrefix

          @InterfaceAudience.Private
           @InterfaceStability.Unstable
          public static final String appIdStrPrefix

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ApplicationId

          public ApplicationId()

  - ### Method Detail

    - #### newInstance

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

    - #### getId

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

          @InterfaceAudience.Private
           @InterfaceStability.Unstable
          protected abstract void setId(int id)

    - #### getClusterTimestamp

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

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

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

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.