Skip to content

Commit

Permalink
HBASE-14354 Minor improvements for usage of the mlock agent
Browse files Browse the repository at this point in the history
  • Loading branch information
esteban committed Sep 2, 2015
1 parent 5bb36f1 commit f8dd99d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions bin/hbase-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f8dd99d

Please sign in to comment.