hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-21215 Figure how to invoke hbck2; make it easy to find
Date Thu, 25 Oct 2018 03:46:35 GMT
Repository: hbase
Updated Branches:
  refs/heads/master d4cc5eef4 -> 5dde5b787


HBASE-21215 Figure how to invoke hbck2; make it easy to find

Adds option parameter to the bin/hbase hbck command that allows
passing the hbck2 jar.

Signed-off-by: Sean Busbey <busbey@apache.org>


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

Branch: refs/heads/master
Commit: 5dde5b7878982c68e95f5a639a324eefe23179dd
Parents: d4cc5ee
Author: Michael Stack <stack@apache.org>
Authored: Wed Oct 24 11:32:22 2018 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Wed Oct 24 20:46:28 2018 -0700

----------------------------------------------------------------------
 bin/hbase | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5dde5b78/bin/hbase
----------------------------------------------------------------------
diff --git a/bin/hbase b/bin/hbase
index 559a02e..59a3b69 100755
--- a/bin/hbase
+++ b/bin/hbase
@@ -92,7 +92,8 @@ if [ $# = 0 ]; then
   echo "Commands:"
   echo "Some commands take arguments. Pass no args or -h for usage."
   echo "  shell           Run the HBase shell"
-  echo "  hbck            Run the hbase 'fsck' tool"
+  echo "  hbck            Run the HBase 'fsck' tool. Defaults read-only hbck1."
+  echo "                  Pass '-j /path/to/HBCK2.jar' to run hbase-2.x HBCK2."
   echo "  snapshot        Tool for managing snapshots"
   if [ "${in_omnibus_tarball}" = "true" ]; then
     echo "  wal             Write-ahead-log analyzer"
@@ -482,7 +483,25 @@ if [ "$COMMAND" = "shell" ] ; then
   HBASE_OPTS="$HBASE_OPTS $HBASE_SHELL_OPTS"
   CLASS="org.jruby.Main -X+O ${JRUBY_OPTS} ${HBASE_HOME}/bin/hirb.rb"
 elif [ "$COMMAND" = "hbck" ] ; then
-  CLASS='org.apache.hadoop.hbase.util.HBaseFsck'
+  # Look for the -j /path/to/HBCK2.jar parameter. Else pass through to hbck.
+  case "${1}" in
+    -j)
+    # Found -j parameter. Add arg to CLASSPATH and set CLASS to HBCK2.
+    shift
+    JAR="${1}"
+    if [ ! -f "${JAR}" ]; then
+      echo "${JAR} file not found!"
+      echo "Usage: hbase [<options>] hbck -jar /path/to/HBCK2.jar [<args>]"
+      exit 1
+    fi
+    CLASSPATH="${JAR}:${CLASSPATH}";
+    CLASS="org.apache.hbase.HBCK2"
+    shift # past argument=value
+    ;;
+    *)
+    CLASS='org.apache.hadoop.hbase.util.HBaseFsck'
+    ;;
+  esac
 elif [ "$COMMAND" = "wal" ] ; then
   CLASS='org.apache.hadoop.hbase.wal.WALPrettyPrinter'
 elif [ "$COMMAND" = "hfile" ] ; then


Mime
View raw message