Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 af7e34f99 -> 7c287597a


HBASE-14354 Minor improvements for usage of the mlock agent


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7c287597
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7c287597
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7c287597

Branch: refs/heads/branch-1.2
Commit: 7c287597accefc1dea13af9760735b87fa3aeb3e
Parents: af7e34f
Author: Esteban Gutierrez <este...@apache.org>
Authored: Tue Sep 1 18:36:39 2015 -0700
Committer: Esteban Gutierrez <este...@apache.org>
Committed: Tue Sep 1 18:45:18 2015 -0700

----------------------------------------------------------------------
 bin/hbase-config.sh | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/7c287597/bin/hbase-config.sh
----------------------------------------------------------------------
diff --git a/bin/hbase-config.sh b/bin/hbase-config.sh
index 5c518b1..c113adb 100644
--- a/bin/hbase-config.sh
+++ b/bin/hbase-config.sh
@@ -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

Reply via email to