Class Apps

java.lang.Object
org.apache.hadoop.yarn.util.Apps

@Private public class Apps extends Object
YARN internal application-related utilities
  • Field Details

  • Constructor Details

    • Apps

      public Apps()
  • Method Details

    • toAppID

      public static org.apache.hadoop.yarn.api.records.ApplicationId toAppID(String aid)
    • toAppID

      public static org.apache.hadoop.yarn.api.records.ApplicationId toAppID(String prefix, String s, Iterator<String> it)
    • shouldHaveNext

      public static void shouldHaveNext(String prefix, String s, Iterator<String> it)
    • throwParseException

      public static void throwParseException(String name, String s)
    • setEnvFromInputString

      public static void setEnvFromInputString(Map<String,String> env, String envString, String classPathSeparator)
    • setEnvFromInputProperty

      public static void setEnvFromInputProperty(Map<String,String> env, String propName, String defaultPropValue, org.apache.hadoop.conf.Configuration conf, String classPathSeparator)
      Set environment variables from the given environment input property. For example, given the property mapreduce.map.env, this method will extract environment variables from: the comma-separated string value of mapreduce.map.env, and the values of any properties of the form mapreduce.map.env.VAR_NAME Variables specified via the latter syntax take precedence over those specified using the former syntax.
      Parameters:
      env - the environment to update
      propName - the name of the property
      defaultPropValue - the default value for propName
      conf - configuration containing properties
      classPathSeparator - Separator used when appending to an existing var
    • getEnvVarsFromInputProperty

      public static Set<String> getEnvVarsFromInputProperty(String propName, String defaultPropValue, org.apache.hadoop.conf.Configuration conf)
      Return the list of environment variable names specified in the given property or default string and those specified individually with the propname.VARNAME syntax (e.g., mapreduce.map.env.VARNAME=value).
      Parameters:
      propName - the name of the property
      defaultPropValue - the default value for propName
      conf - configuration containing properties
      Returns:
      Set of environment variable names
    • setEnvFromInputString

      @Deprecated public static void setEnvFromInputString(Map<String,String> env, String envString)
      Deprecated.
      This older version of this method is kept around for compatibility because downstream frameworks like Spark and Tez have been using it. Downstream frameworks are expected to move off of it.
      Parameters:
      env - the environment to update.
      envString - String containing env variable definitions.
    • addToEnvironment

      @Public @Unstable public static void addToEnvironment(Map<String,String> environment, String variable, String value, String classPathSeparator)
    • addToEnvironment

      @Deprecated public static void addToEnvironment(Map<String,String> environment, String variable, String value)
      Deprecated.
      This older version of this method is kept around for compatibility because downstream frameworks like Spark and Tez have been using it. Downstream frameworks are expected to move off of it.
      Parameters:
      environment - map of environment variable.
      variable - variable.
      value - value.
    • crossPlatformify

      public static String crossPlatformify(String var)
    • shouldCountTowardsNodeBlacklisting

      @Private @Unstable public static boolean shouldCountTowardsNodeBlacklisting(int exitStatus)
    • isApplicationFinalState

      public static boolean isApplicationFinalState(org.apache.hadoop.yarn.api.records.YarnApplicationState appState)
      Returns whether a given application state is final: FINISHED, FAILED or KILLED.
      Parameters:
      appState - application state
      Returns:
      whether the appState is final.