8ef7d36
#!/usr/bin/bash
6e9b93d
8ef7d36
# This file is sourced by /usr/bin/accumulo before launching java. It will use
8ef7d36
# the $ACCUMULO_OPTS environment variable created here to add options to the
8ef7d36
# java command line. This file can be overridden per-user by creating a
8ef7d36
# $HOME/.accumulorc to be sourced after this file.
6e9b93d
8ef7d36
# The $1 parameter is passed with the first argument provided to
8ef7d36
# /usr/bin/accumulo, which is usually the name of the accumulo service or
8ef7d36
# function to run.
6e9b93d
8ef7d36
# Append some common arguments
8ef7d36
#
8ef7d36
# Note: app isn't used for anything, but makes it easier to locate services
8ef7d36
# quickly with ps/top/etc output
8ef7d36
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')
6e9b93d
8ef7d36
# Append some service-specific arguments
6e9b93d
case "$1" in
8ef7d36
  gc)      ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx256m' '-Xms256m') ;;
8ef7d36
  master)  ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx1g' '-Xms1g') ;;
8ef7d36
  monitor) ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx1g' '-Xms256m') ;;
8ef7d36
  tserver) ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx1g' '-Xms1g' '-XX:NewSize=500m' '-XX:MaxNewSize=500m') ;;
8ef7d36
  *)       ACCUMULO_OPTS=("${ACCUMULO_OPTS[@]}" '-Xmx1g' '-Xms256m') ;;
6e9b93d
esac
6e9b93d
8ef7d36
# Set this because it's read by the VFS classloader
8ef7d36
export ACCUMULO_HOME=/etc/accumulo
8ef7d36
# Set these because they could be referenced by logger configuration
8ef7d36
export ACCUMULO_CONF_DIR=/etc/accumulo
8ef7d36
export ACCUMULO_LOG_DIR=/var/log/accumulo
6e9b93d
8ef7d36
# See HADOOP-7154 and ACCUMULO-847
8ef7d36
export MALLOC_ARENA_MAX=1