소스 검색

HUE-271. Beeswax_server should have configurable java heap size

This patch adds a configuration variable for the heap size.  It also
improves beeswax_server.sh to read hadoop-env.sh by default, since
that's not happening on account of the $HADOOP_CONF_DIR trickiness
that it's doing.
Philip Zeyliger 15 년 전
부모
커밋
a6b854cb6c

+ 3 - 0
apps/beeswax/beeswax_server.sh

@@ -46,6 +46,9 @@ echo \$HADOOP_CLASSPATH=$HADOOP_CLASSPATH
 if [ -z "$HADOOP_CONF_DIR" ]; then
   HADOOP_CONF_DIR="$HADOOP_HOME/conf"
 fi
+if [ -f $HADOOP_CONF_DIR/hadoop-env.sh ]; then
+  . $HADOOP_CONF_DIR/hadoop-env.sh
+fi
 export HADOOP_CONF_DIR=${BEESWAX_HIVE_LIB}/hive-default-xml-0.5.0.jar:${HADOOP_CONF_DIR}:$(find $BEESWAX_HIVE_LIB -name "libfb303.jar" | head -1)
 echo \$HADOOP_CONF_DIR=$HADOOP_CONF_DIR
 

+ 7 - 0
apps/beeswax/src/beeswax/conf.py

@@ -50,6 +50,13 @@ BEESWAX_SERVER_BIN = Config(
   private=True,
   default=os.path.join(os.path.dirname(__file__), "..", "..", "beeswax_server.sh"))
 
+BEESWAX_SERVER_HEAPSIZE = Config(
+  key="beeswax_server_heapsize",
+  help="Maximum Java heapsize (in megabytes) used by Beeswax Server.  " + \
+    "Note that the setting of HADOOP_HEAPSIZE in $HADOOP_CONF_DIR/hadoop-env.sh " + \
+    "may override this setting.",
+  default=None)
+
 BEESWAX_HIVE_CONF_DIR = Config(
   key='hive_conf_dir',
   help='Hive configuration directory, where hive-site.xml is located',

+ 2 - 0
apps/beeswax/src/beeswax/management/commands/beeswax_server.py

@@ -37,6 +37,8 @@ class Command(NoArgsCommand):
       env['HADOOP_CONF_DIR'] = hadoop.conf.HADOOP_CONF_DIR.get()
     if beeswax.conf.BEESWAX_HIVE_CONF_DIR.get():
       env['HIVE_CONF_DIR'] = beeswax.conf.BEESWAX_HIVE_CONF_DIR.get()
+    if beeswax.conf.BEESWAX_SERVER_HEAPSIZE.get():
+      env['HADOOP_HEAPSIZE'] = beeswax.conf.BEESWAX_SERVER_HEAPSIZE.get()
     bin = beeswax.conf.BEESWAX_SERVER_BIN.get()
 
     # Host that desktop is running on

+ 1 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -48,3 +48,4 @@ ganglia_url=http://%(gmetad_host)s:80/ganglia/
 [beeswax]
 # Point this variable to your Hive installation config dir (if applicable)
 # hive_conf_dir=
+beeswax_server_heapsize=128