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 Details

  • 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