Переглянути джерело

[YARN-10998] Add YARN_ROUTER_HEAPSIZE to yarn-env for routers (#3603)

minni31 3 роки тому
батько
коміт
8b159d296d

+ 4 - 0
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'

+ 3 - 0
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

+ 5 - 0
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