# See http://blog.cloudera.com/blog/2011/02/avoiding-full-gcs-in-hbase-with-memstore-local-allocation-buffers-part-1/ for information about best practices on garbage collection configuration
#
# About GC debugging:
# http://hbase.apache.org/book/trouble.log.html#trouble.log.gc
#
# The maximum amount of heap to use, in MB. Default is 1000.
export HADOOP_HEAPSIZE={{ hbase_regionserver_heap_size }}
export HBASE_HEAPSIZE=$HADOOP_HEAPSIZE
export HBASE_JVM_MAXDIRECTMEMORYSIZE="{{ hbase_regionserver_maxdirectmemory_size }}"
{% if hadoop_send_to_logstash %}
export HBASE_ROOT_LOGGER="{{ hadoop_log_level }},{{ hadoop_logstash_appender }}"
{% else %}
export HBASE_ROOT_LOGGER="{{ hadoop_log_level }},{{ hadoop_log_appender }}"
{% endif %}

export HBASE_REGIONSERVER_OPTS="{{ hadoop_default_java_opts }} {{ hbase_regionserver_java_opts }}"
{% if hadoop_jmx_enabled is defined and hadoop_jmx_enabled %}
HBASE_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false"
HBASE_JMX_OPTS="$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.password.file=/etc/hbase-jmx/conf/jmxremote.passwd"
HBASE_JMX_OPTS="$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.access.file=/etc/hbase-jmx/conf/jmxremote.access  -Dcom.sun.management.jmxremote.port={{ hbase_regionserver_jmx_port }}"
export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS $HBASE_JMX_OPTS"
{% endif %}


# Uncomment to activate debugging
#export HBASE_GC_DEBUG_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:/var/log/hbase/gc-hbase.log"
export HBASE_OPTS="-XX:+CMSIncrementalMode -XX:+HeapDumpOnOutOfMemoryError -XX:CMSInitiatingOccupancyFraction=60 $HBASE_GC_DEBUG_OPTS $HBASE_REGIONSERVER_OPTS $HBASE_JVM_MAXDIRECTMEMORYSIZE"
export HBASE_CLASSPATH=`echo $HBASE_CLASSPATH | sed -e "s|$ZOOKEEPER_CONF:||"`

