Package org.apache.hadoop.yarn.util
Class Apps
java.lang.Object
org.apache.hadoop.yarn.util.Apps
YARN internal application-related utilities
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeprecated.static voidaddToEnvironment(Map<String, String> environment, String variable, String value, String classPathSeparator) static StringcrossPlatformify(String var) 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).static booleanisApplicationFinalState(org.apache.hadoop.yarn.api.records.YarnApplicationState appState) Returns whether a given application state is final: FINISHED, FAILED or KILLED.static voidsetEnvFromInputProperty(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.static voidsetEnvFromInputString(Map<String, String> env, String envString) Deprecated.static voidstatic booleanshouldCountTowardsNodeBlacklisting(int exitStatus) static voidshouldHaveNext(String prefix, String s, Iterator<String> it) static voidthrowParseException(String name, String s) static org.apache.hadoop.yarn.api.records.ApplicationIdstatic org.apache.hadoop.yarn.api.records.ApplicationId
-
Field Details
-
APP
- See Also:
-
ID
- See Also:
-
-
Constructor Details
-
Apps
public Apps()
-
-
Method Details
-
toAppID
-
toAppID
-
shouldHaveNext
-
throwParseException
-
setEnvFromInputString
-
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 updatepropName- the name of the propertydefaultPropValue- the default value for propNameconf- configuration containing propertiesclassPathSeparator- 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 propertydefaultPropValue- the default value for propNameconf- configuration containing properties- Returns:
- Set of environment variable names
-
setEnvFromInputString
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
-
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
-
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.
-