You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by in...@apache.org on 2021/11/11 17:49:54 UTC

[hadoop] branch trunk updated: [YARN-10998] Add YARN_ROUTER_HEAPSIZE to yarn-env for routers (#3603)

This is an automated email from the ASF dual-hosted git repository.

inigoiri pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8b159d2  [YARN-10998] Add YARN_ROUTER_HEAPSIZE to yarn-env for routers (#3603)
8b159d2 is described below

commit 8b159d296dfb8a2660d027dda1fc030ec9bff0ca
Author: minni31 <mi...@gmail.com>
AuthorDate: Thu Nov 11 23:19:29 2021 +0530

    [YARN-10998] Add YARN_ROUTER_HEAPSIZE to yarn-env for routers (#3603)
---
 hadoop-yarn-project/hadoop-yarn/bin/yarn         | 4 ++++
 hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd     | 3 +++
 hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh | 5 +++++
 3 files changed, 12 insertions(+)

diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn
index 54daeaa..dbab397 100755
--- a/hadoop-yarn-project/hadoop-yarn/bin/yarn
+++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn
@@ -175,6 +175,10 @@ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}"
     router)
       HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true"
       HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.router.Router'
+      # Backwards compatibility
+      if [[ -n "${YARN_ROUTER_HEAPSIZE}" ]]; then
+        HADOOP_HEAPSIZE_MAX="${YARN_ROUTER_HEAPSIZE}"
+      fi
     ;;
     schedulerconf)
     HADOOP_CLASSNAME='org.apache.hadoop.yarn.client.cli.SchedConfCLI'
diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd b/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd
index e1ac112..3a60794 100644
--- a/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd
+++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd
@@ -260,6 +260,9 @@ goto :eof
   set CLASSPATH=%CLASSPATH%;%YARN_CONF_DIR%\router-config\log4j.properties
   set CLASS=org.apache.hadoop.yarn.server.router.Router
   set YARN_OPTS=%YARN_OPTS% %HADOOP_ROUTER_OPTS%
+  if defined YARN_ROUTER_HEAPSIZE (
+    set JAVA_HEAP_MAX=-Xmx%YARN_ROUTER_HEAPSIZE%m
+  )
   goto :eof
 
 :nodemanager
diff --git a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh
index 7cd1390..b3650a6 100644
--- a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh
+++ b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh
@@ -147,6 +147,11 @@
 # Router specific parameters
 ###
 
+# Specify the max heapsize for the Router.  If no units are
+# given, it will be assumed to be in MB.
+# Default is the same as HADOOP_HEAPSIZE_MAX
+#export YARN_ROUTER_HEAPSIZE=
+
 # Specify the JVM options to be used when starting the Router.
 # These options will be appended to the options specified as HADOOP_OPTS
 # and therefore may override any similar flags set in HADOOP_OPTS

---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org