diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn index 8e86b26cf2..6ef4e2c8e2 100755 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn @@ -110,6 +110,10 @@ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}" globalpolicygenerator) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.globalpolicygenerator.GlobalPolicyGenerator' + # Backwards compatibility + if [[ -n "${YARN_GLOBALPOLICYGENERATOR_HEAPSIZE}" ]]; then + HADOOP_HEAPSIZE_MAX="${YARN_GLOBALPOLICYGENERATOR_HEAPSIZE}" + fi ;; jar) HADOOP_CLASSNAME=org.apache.hadoop.util.RunJar diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd b/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd index 5207de816b..89dc5a3f3d 100644 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd @@ -273,6 +273,9 @@ goto :eof set CLASSPATH=%CLASSPATH%;%YARN_CONF_DIR%\globalpolicygenerator-config\log4j.properties set CLASS=org.apache.hadoop.yarn.server.globalpolicygenerator.GlobalPolicyGenerator set YARN_OPTS=%YARN_OPTS% %YARN_GLOBALPOLICYGENERATOR_OPTS% + if defined YARN_GLOBALPOLICYGENERATOR_HEAPSIZE ( + set JAVA_HEAP_MAX=-Xmx%YARN_GLOBALPOLICYGENERATOR_HEAPSIZE%m + ) goto :eof :routeradmin diff --git a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh index 8d2ab06578..55d03668de 100644 --- a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh +++ b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh @@ -164,6 +164,11 @@ # Global Policy Generator specific parameters ### +# Specify the max heapsize for the Global Policy Generator. If no units are +# given, it will be assumed to be in MB. +# Default is the same as HADOOP_HEAPSIZE_MAX +#export YARN_GLOBALPOLICYGENERATOR_HEAPSIZE= + # Specify the JVM options to be used when starting the GPG. # These options will be appended to the options specified as HADOOP_OPTS # and therefore may override any similar flags set in HADOOP_OPTS