Blob Blame History Raw
#!/usr/bin/bash

# This file is sourced by /usr/bin/accumulo before launching java. It will use
# the $ACCUMULO_OPTS environment variable created here to add options to the
# java command line. This file can be overridden per-user by creating a
# $HOME/.accumulorc to be sourced after this file.

# The $1 parameter is passed with the first argument provided to
# /usr/bin/accumulo, which is usually the name of the accumulo service or
# function to run.

# Append some common arguments
#
# Note: app isn't used for anything, but makes it easier to locate services
# quickly with ps/top/etc output
ACCUMULO_OPTS=("-Dapp=$1" '-XX:+UseConcMarkSweepGC' '-XX:CMSInitiatingOccupancyFraction=75' '-Djava.net.preferIPv4Stack=true' '-XX:-OmitStackTraceInFastThrow' '-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl' '-XX:OnOutOfMemoryError=kill -9 %p')

# Append some service-specific arguments
case "$1" in
  gc)      ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx256m' '-Xms256m') ;;
  master)  ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx1g' '-Xms1g') ;;
  monitor) ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx1g' '-Xms256m') ;;
  tserver) ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx1g' '-Xms1g' '-XX:NewSize=500m' '-XX:MaxNewSize=500m') ;;
  *)       ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx1g' '-Xms256m') ;;
esac

# Set this because it's read by the VFS classloader
export ACCUMULO_HOME=/etc/accumulo
# Set these because they could be referenced by logger configuration
export ACCUMULO_CONF_DIR=/etc/accumulo
export ACCUMULO_LOG_DIR=/var/log/accumulo

# See HADOOP-7154 and ACCUMULO-847
export MALLOC_ARENA_MAX=1