Browse Source

HADOOP-1931 Hbase scripts take --ARG=ARG_VALUE when should be like
hadoop and do ---ARG ARG_VALUE


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@578032 13f79535-47bb-0310-9956-ffa450edef68

Michael Stack 18 years ago
parent
commit
d4f7286917

+ 2 - 0
src/contrib/hbase/CHANGES.txt

@@ -4,6 +4,8 @@ HBase Change Log
 Trunk (unreleased changes)
 
   INCOMPATIBLE CHANGES
+    HADOOP-1931 Hbase scripts take --ARG=ARG_VALUE when should be like hadoop
+                and do ---ARG ARG_VALUE
 
   NEW FEATURES
     HADOOP-1768 FS command using Hadoop FsShell operations

+ 28 - 23
src/contrib/hbase/bin/hbase-config.sh

@@ -49,29 +49,34 @@ export HBASE_HOME=`dirname "$this"`/..
 #check to see if the conf dir or hadoop home are given as an optional arguments
 while [ $# -gt 1 ]
 do
-  case $1 in
-    --config=*)
-        HADOOP_CONF_DIR=`echo $1|sed 's/[^=]*=\(.*\)/\1/'`
-        shift
-      ;;
-    --hbaseconfig=*)
-        HBASE_CONF_DIR=`echo $1|sed 's/[^=]*=\(.*\)/\1/'`
-        shift
-      ;;
-
-    --hadoop=*)
-        HADOOP_HOME=`echo $1|sed 's/[^=]*=\(.*\)/\1/'`
-        shift
-      ;;
-    --hosts=*)
-        HBASE_REGIONSERVERS=`echo $1|sed 's/[^=]*=\(.*\)/\1/'`
-        shift
-      ;;
-
-    *)
-      break
-      ;; 
-  esac
+  if [ "--config" = "$1" ]
+  then
+    shift
+    confdir=$1
+    shift
+    HADOOP_CONF_DIR=$confdir
+  elif [ "--hbaseconfig" = "$1" ]
+  then
+    shift
+    confdir=$1
+    shift
+    HBASE_CONF_DIR=$confdir
+  elif [ "--hadoop" = "$1" ]
+  then
+    shift
+    home=$1
+    shift
+    HADOOP_HOME=$home
+  elif [ "--hosts" = "$1" ]
+  then
+    shift
+    hosts=$1
+    shift
+    HBASE_REGIONSERVERS=$hosts
+  else
+    # Presume we are at end of options and break
+    break
+  fi
 done
  
 # If no hadoop home specified, then we assume its above this directory.

+ 6 - 6
src/contrib/hbase/bin/hbase-daemon.sh

@@ -33,8 +33,8 @@
 #
 # Modelled after $HADOOP_HOME/bin/hadoop-daemon.sh
 
-usage="Usage: hbase-daemon.sh [--config=<hadoop-conf-dir>]\
- [--hbaseconfig=<hbase-conf-dir>] <hbase-command> (start|stop)\
+usage="Usage: hbase-daemon.sh [--config <hadoop-conf-dir>]\
+ [--hbaseconfig <hbase-conf-dir>] <hbase-command> (start|stop)\
  <args...>"
 
 # if no args specified, show usage
@@ -117,8 +117,8 @@ case $startStop in
     hbase_rotate_log $log
     echo starting $command, logging to $log
     nohup nice -n $HADOOP_NICENESS "$HBASE_HOME"/bin/hbase \
-        --hadoop="${HADOOP_HOME}" \
-        --config="${HADOOP_CONF_DIR}" --hbaseconfig="${HBASE_CONF_DIR}" \
+        --hadoop "${HADOOP_HOME}" \
+        --config "${HADOOP_CONF_DIR}" --hbaseconfig "${HBASE_CONF_DIR}" \
         $command $startStop "$@" > "$log" 2>&1 < /dev/null &
     echo $! > $pid
     sleep 1; head "$log"
@@ -129,8 +129,8 @@ case $startStop in
       if kill -0 `cat $pid` > /dev/null 2>&1; then
         echo -n stopping $command
         nohup nice -n $HADOOP_NICENESS "$HBASE_HOME"/bin/hbase \
-            --hadoop="${HADOOP_HOME}" \
-            --config="${HADOOP_CONF_DIR}" --hbaseconfig="${HBASE_CONF_DIR}" \
+            --hadoop "${HADOOP_HOME}" \
+            --config "${HADOOP_CONF_DIR}" --hbaseconfig "${HBASE_CONF_DIR}" \
             $command $startStop "$@" > "$log" 2>&1 < /dev/null &
         while kill -0 `cat $pid` > /dev/null 2>&1; do
           echo -n "."

+ 7 - 7
src/contrib/hbase/bin/hbase-daemons.sh

@@ -23,9 +23,9 @@
 # Run a Hadoop hbase command on all slave hosts.
 # Modelled after $HADOOP_HOME/bin/hadoop-daemons.sh
 
-usage="Usage: hbase-daemons.sh [--hadoop=<hadoop-home>]
- [--config=<hadoop-confdir>] [--hbase=<hbase-home>]\
- [--hbaseconfig=<hbase-confdir>] [--hosts=regionserversfile]\
+usage="Usage: hbase-daemons.sh [--hadoop <hadoop-home>]
+ [--config <hadoop-confdir>] [--hbase <hbase-home>]\
+ [--hbaseconfig <hbase-confdir>] [--hosts regionserversfile]\
  command [start|stop] args..."
 
 # if no args specified, show usage
@@ -39,8 +39,8 @@ bin=`cd "$bin"; pwd`
 
 . $bin/hbase-config.sh
 
-exec "$bin/regionservers.sh" --config="${HADOOP_CONF_DIR}" \
- --hbaseconfig="${HBASE_CONF_DIR}" --hadoop="${HADOOP_HOME}" \
+exec "$bin/regionservers.sh" --config "${HADOOP_CONF_DIR}" \
+ --hbaseconfig "${HBASE_CONF_DIR}" --hadoop "${HADOOP_HOME}" \
  cd "${HBASE_HOME}" \; \
- "$bin/hbase-daemon.sh" --config="${HADOOP_CONF_DIR}" \
- --hbaseconfig="${HBASE_CONF_DIR}" --hadoop="${HADOOP_HOME}" "$@"
+ "$bin/hbase-daemon.sh" --config "${HADOOP_CONF_DIR}" \
+ --hbaseconfig "${HBASE_CONF_DIR}" --hadoop "${HADOOP_HOME}" "$@"

+ 2 - 2
src/contrib/hbase/bin/regionservers.sh

@@ -33,8 +33,8 @@
 #
 # Modelled after $HADOOP_HOME/bin/slaves.sh.
 
-usage="Usage: regionservers [--config=<hadoop-confdir>]\
- [--hbaseconfig=<hbase-confdir>] command..."
+usage="Usage: regionservers [--config <hadoop-confdir>]\
+ [--hbaseconfig <hbase-confdir>] command..."
 
 # if no args specified, show usage
 if [ $# -le 0 ]; then

+ 5 - 5
src/contrib/hbase/bin/start-hbase.sh

@@ -38,8 +38,8 @@ if [ $errCode -ne 0 ]
 then
   exit $errCode
 fi
-"$bin"/hbase-daemon.sh --config="${HADOOP_CONF_DIR}" \
-    --hbaseconfig="${HBASE_CONF_DIR}" master start
-"$bin"/hbase-daemons.sh --config="${HADOOP_CONF_DIR}" \
-    --hbaseconfig="${HBASE_CONF_DIR}" --hadoop="${HADOOP_HOME}" \
-    --hosts="${HBASE_REGIONSERVERS}" regionserver start
+"$bin"/hbase-daemon.sh --config "${HADOOP_CONF_DIR}" \
+    --hbaseconfig "${HBASE_CONF_DIR}" master start
+"$bin"/hbase-daemons.sh --config "${HADOOP_CONF_DIR}" \
+    --hbaseconfig "${HBASE_CONF_DIR}" --hadoop "${HADOOP_HOME}" \
+    --hosts "${HBASE_REGIONSERVERS}" regionserver start

+ 2 - 2
src/contrib/hbase/bin/stop-hbase.sh

@@ -29,5 +29,5 @@ bin=`cd "$bin"; pwd`
 
 . "$bin"/hbase-config.sh
 
-"$bin"/hbase-daemon.sh --config="${HADOOP_CONF_DIR}" \
-    --hbaseconfig="${HBASE_CONF_DIR}" master stop
+"$bin"/hbase-daemon.sh --config "${HADOOP_CONF_DIR}" \
+    --hbaseconfig "${HBASE_CONF_DIR}" master stop