HBASE-14354 Minor improvements for usage of the mlock agent

This commit is contained in:
Esteban Gutierrez 2015-09-01 18:36:39 -07:00
parent 5bb36f1594
commit f8dd99d738
1 changed files with 6 additions and 8 deletions

View File

@ -98,22 +98,20 @@ if [ -z "$HBASE_ENV_INIT" ] && [ -f "${HBASE_CONF_DIR}/hbase-env.sh" ]; then
export HBASE_ENV_INIT="true"
fi
# Set default value for regionserver uid if not present
if [ -z "$HBASE_REGIONSERVER_UID" ]; then
HBASE_REGIONSERVER_UID="hbase"
fi
# Verify if hbase has the mlock agent
if [ "$HBASE_REGIONSERVER_MLOCK" = "true" ]; then
MLOCK_AGENT="$HBASE_HOME/native/libmlockall_agent.so"
MLOCK_AGENT="$HBASE_HOME/lib/native/libmlockall_agent.so"
if [ ! -f "$MLOCK_AGENT" ]; then
cat 1>&2 <<EOF
Unable to find mlockall_agent, hbase must be compiled with -Pnative
EOF
exit 1
fi
HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -agentpath:$MLOCK_AGENT=user=$HBASE_REGIONSERVER_UID"
if [ -z "$HBASE_REGIONSERVER_UID" ] || [ "$HBASE_REGIONSERVER_UID" == "$USER" ]; then
HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -agentpath:$MLOCK_AGENT"
else
HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -agentpath:$MLOCK_AGENT=user=$HBASE_REGIONSERVER_UID"
fi
fi
# Newer versions of glibc use an arena memory allocator that causes virtual