You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by li...@apache.org on 2012/12/19 20:19:08 UTC

svn commit: r1424044 - /hbase/branches/0.89-fb/bin/hbase-daemon.sh

Author: liyin
Date: Wed Dec 19 19:19:07 2012
New Revision: 1424044

URL: http://svn.apache.org/viewvc?rev=1424044&view=rev
Log:
[master] Add support in hbase-daemon for regionserver stop-for-restart

Author: mbm

Summary:
Since hadoopctl wants (and kind of needs) to own the stopping and starting
of its daemons for restarts, this exposes an interface to the the jruby used
in doing the localised restart of the regionserver. hadoopctl can pick this
up and use this during a restart.

Test Plan:
This has been tested successfully on hbase430.frc1 (though it gets reverted
by fbdeploy - or something similar - periodically). Basically - the tests
for the positive situation and negative situations with hadoopctl (other
types of stop, hbase-daemon.sh that doesn't support stop-for-restart etc)
all now pass.

Reviewers: arjen, aleksandr, paultuckfield, rthiessen, kannan, kranganathan, liyintang

Reviewed By: arjen

CC: hbase-prodeng@, hbase-eng@

Differential Revision: https://phabricator.fb.com/D645234

Task ID: 906907

Modified:
    hbase/branches/0.89-fb/bin/hbase-daemon.sh

Modified: hbase/branches/0.89-fb/bin/hbase-daemon.sh
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/bin/hbase-daemon.sh?rev=1424044&r1=1424043&r2=1424044&view=diff
==============================================================================
--- hbase/branches/0.89-fb/bin/hbase-daemon.sh (original)
+++ hbase/branches/0.89-fb/bin/hbase-daemon.sh Wed Dec 19 19:19:07 2012
@@ -33,7 +33,7 @@
 # Modelled after $HADOOP_HOME/bin/hadoop-daemon.sh
 
 usage="Usage: hbase-daemon.sh [--config <conf-dir>]\
- (start|stop|restart) <hbase-command> \
+ (start|stop|restart|stop-for-restart) <hbase-command> \
  <args...>"
 
 # if no args specified, show usage
@@ -54,6 +54,12 @@ shift
 command=$1
 shift
 
+if [ "x$startStop" = xstop-for-restart ]; then
+  if [ "x$command" != xregionserver ]; then
+    command=stop
+  fi
+fi
+
 hbase_rotate_log ()
 {
     log=$1;
@@ -185,7 +191,7 @@ case $startStop in
     fi
     ;;
 
-  (restart)
+  (restart|stop-for-restart)
     thiscmd=$0
     args=$@
     # stop the command
@@ -203,9 +209,11 @@ case $startStop in
         ;;
     esac
     wait_until_done $!
-    # start the command
-    $thiscmd --config "${HBASE_CONF_DIR}" start $command $args &
-    wait_until_done $!
+    if [ x$startStop = xrestart ]; then
+      # start the command
+      $thiscmd --config "${HBASE_CONF_DIR}" start $command $args &
+      wait_until_done $!
+    fi
     ;;
 
   (*)