hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nspiegelb...@apache.org
Subject svn commit: r1160890 - in /hbase/trunk: CHANGES.txt bin/hbase src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java
Date Tue, 23 Aug 2011 21:37:33 GMT
Author: nspiegelberg
Date: Tue Aug 23 21:37:32 2011
New Revision: 1160890

URL: http://svn.apache.org/viewvc?rev=1160890&view=rev
Log:
HBASE-4244 Refactor bin/hbase help

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/bin/hbase
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1160890&r1=1160889&r2=1160890&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Tue Aug 23 21:37:32 2011
@@ -396,6 +396,7 @@ Release 0.91.0 - Unreleased
                (Benoit Sigoure)
    HBASE-4199  blockCache summary - backend (Doug Meil)
    HBASE-4240  Allow Loadbalancer to be pluggable
+   HBASE-4244  Refactor bin/hbase help
 
   TASKS
    HBASE-3559  Move report of split to master OFF the heartbeat channel

Modified: hbase/trunk/bin/hbase
URL: http://svn.apache.org/viewvc/hbase/trunk/bin/hbase?rev=1160890&r1=1160889&r2=1160890&view=diff
==============================================================================
--- hbase/trunk/bin/hbase (original)
+++ hbase/trunk/bin/hbase Tue Aug 23 21:37:32 2011
@@ -65,20 +65,28 @@ fi
 # if no args specified, show usage
 if [ $# = 0 ]; then
   echo "Usage: hbase <command>"
-  echo "where <command> is one of:"
+  echo "where <command> an option from one of these categories:"
+  echo ""
+  echo "DBA TOOLS"
   echo "  shell            run the HBase shell"
+  echo "  hbck             run the hbase 'fsck' tool"
+  echo "  hlog             write-ahead-log analyzer"
+  echo "  hfile            store file analyzer"
+  echo "  migrate          upgrade an hbase.rootdir"
   echo "  zkcli            run the ZooKeeper shell"
+  echo ""
+  echo "PROCESS MANAGEMENT"
   echo "  master           run an HBase HMaster node" 
   echo "  regionserver     run an HBase HRegionServer node" 
   echo "  zookeeper        run a Zookeeper server"
   echo "  rest             run an HBase REST server" 
   echo "  thrift           run an HBase Thrift server" 
   echo "  avro             run an HBase Avro server" 
-  echo "  migrate          upgrade an hbase.rootdir"
-  echo "  hbck             run the hbase 'fsck' tool"
+  echo ""
+  echo "PACKAGE MANAGEMENT"
   echo "  classpath        dump hbase CLASSPATH"
   echo "  version          print the version"
-
+  echo ""
   echo " or"
   echo "  CLASSNAME        run the class named CLASSNAME"
   echo "Most commands print help when invoked w/o parameters."
@@ -243,6 +251,19 @@ unset IFS
 # figure out which class to run
 if [ "$COMMAND" = "shell" ] ; then
   CLASS="org.jruby.Main ${HBASE_HOME}/bin/hirb.rb"
+elif [ "$COMMAND" = "hbck" ] ; then
+  CLASS='org.apache.hadoop.hbase.util.HBaseFsck'
+elif [ "$COMMAND" = "hlog" ] ; then
+  CLASS='org.apache.hadoop.hbase.regionserver.wal.HLogPrettyPrinter'
+elif [ "$COMMAND" = "hfile" ] ; then
+  CLASS='org.apache.hadoop.hbase.io.hfile.HFile'
+elif [ "$COMMAND" = "migrate" ] ; then
+  CLASS='org.apache.hadoop.hbase.util.Migrate'
+elif [ "$COMMAND" = "zkcli" ] ; then
+  # ZooKeeperMainServerArg returns '-server HOST:PORT' or empty string.
+  SERVER_ARG=`"$bin"/hbase org.apache.hadoop.hbase.zookeeper.ZooKeeperMainServerArg`
+  CLASS="org.apache.zookeeper.ZooKeeperMain ${SERVER_ARG}"
+
 elif [ "$COMMAND" = "master" ] ; then
   CLASS='org.apache.hadoop.hbase.master.HMaster'
   if [ "$1" != "stop" ] ; then
@@ -268,19 +289,12 @@ elif [ "$COMMAND" = "avro" ] ; then
   if [ "$1" != "stop" ] ; then
     HBASE_OPTS="$HBASE_OPTS $HBASE_AVRO_OPTS"
   fi
-elif [ "$COMMAND" = "migrate" ] ; then
-  CLASS='org.apache.hadoop.hbase.util.Migrate'
-elif [ "$COMMAND" = "hbck" ] ; then
-  CLASS='org.apache.hadoop.hbase.util.HBaseFsck'
 elif [ "$COMMAND" = "zookeeper" ] ; then
   CLASS='org.apache.hadoop.hbase.zookeeper.HQuorumPeer'
   if [ "$1" != "stop" ] ; then
     HBASE_OPTS="$HBASE_OPTS $HBASE_ZOOKEEPER_OPTS"
   fi
-elif [ "$COMMAND" = "zkcli" ] ; then
-  # ZooKeeperMainServerArg returns '-server HOST:PORT' or empty string.
-  SERVER_ARG=`"$bin"/hbase org.apache.hadoop.hbase.zookeeper.ZooKeeperMainServerArg` 
-  CLASS="org.apache.zookeeper.ZooKeeperMain ${SERVER_ARG}"
+
 elif [ "$COMMAND" = "classpath" ] ; then
   echo $CLASSPATH
   exit 0

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java?rev=1160890&r1=1160889&r2=1160890&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java
Tue Aug 23 21:37:32 2011
@@ -298,6 +298,10 @@ public class HLogPrettyPrinter {
     }
   }
 
+  public static void main(String[] args) throws IOException {
+    run(args);
+  }
+
   /**
    * Pass one or more log file names and formatting options and it will dump out
    * a text version of the contents on <code>stdout</code>.
@@ -329,7 +333,7 @@ public class HLogPrettyPrinter {
       files = cmd.getArgList();
       if (files.size() == 0 || cmd.hasOption("h")) {
         HelpFormatter formatter = new HelpFormatter();
-        formatter.printHelp("HFile filename(s) ", options, true);
+        formatter.printHelp("HLog <filename...>", options, true);
         System.exit(-1);
       }
       // configure the pretty printer using command line options



Mime
View raw message