# 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
#
# The maximum amount of heap to use, in MB. Default is 1000.
export HADOOP_HEAPSIZE={{ hbase_master_heap_size }}
export HBASE_HEAPSIZE=$HADOOP_HEAPSIZE
{% 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 %}

# Where log files are stored.  $HADOOP_HOME/logs by default.
if [ -z "$HBASE_LOG_DIR " ] ; then
    export HBASE_LOG_DIR=/var/log/hbase
fi 

export HBASE_MASTER_OPTS="{{ hadoop_default_java_opts }} {{ hbase_master_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_master_jmx_port }}"
export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS $HBASE_JMX_OPTS"
{% endif %}

export HBASE_OPTS="-XX:+HeapDumpOnOutOfMemoryError -XX:+CMSIncrementalMode $HBASE_MASTER_OPTS"
export HBASE_CLASSPATH=`echo $HBASE_CLASSPATH | sed -e "s|$ZOOKEEPER_CONF:||"`

export HBASE_THRIFT_OPTS="{{ hadoop_default_java_opts }} {{ hbase_thrift_java_opts }}"

{% if hadoop_jmx_enabled is defined and hadoop_jmx_enabled %}
# Thrift jmx options
HBASE_THRIFT_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false"
HBASE_THRIFT_JMX_OPTS="$HBASE_THRIFT_JMX_OPTS -Dcom.sun.management.jmxremote.password.file=/etc/hbase-jmx/conf/jmxremote.passwd"
HBASE_THRIFT_JMX_OPTS="$HBASE_THRIFT_JMX_OPTS -Dcom.sun.management.jmxremote.access.file=/etc/hbase-jmx/conf/jmxremote.access -Dcom.sun.management.jmxremote.port={{ hbase_thrift_jmx_port }}"
export HBASE_THRIFT_OPTS="$HBASE_THRIFT_OPTS $HBASE_THRIFT_JMX_OPTS"
{% endif %}

