Author: stack Date: Fri May 30 12:19:46 2008 New Revision: 661825 URL: http://svn.apache.org/viewvc?rev=661825&view=rev Log: HBASE-487 New hbase shell Part 3: Avoid the help problem. Output banner that tells user instead to type 'hbase' for list of commands. Update jruby to 1.1.2 release.
Added: hadoop/hbase/trunk/lib/jruby-complete-1.1.2.jar (with props) hadoop/hbase/trunk/lib/jruby-complete-LICENSE.txt - copied unchanged from r661535, hadoop/hbase/trunk/lib/jruby-complete-1.1.1.LICENSE.txt Removed: hadoop/hbase/trunk/lib/jruby-complete-1.1.1.LICENSE.txt hadoop/hbase/trunk/lib/jruby-complete-1.1.1.jar Modified: hadoop/hbase/trunk/bin/hbase hadoop/hbase/trunk/bin/hirb.rb Modified: hadoop/hbase/trunk/bin/hbase URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/bin/hbase?rev=661825&r1=661824&r2=661825&view=diff ============================================================================== --- hadoop/hbase/trunk/bin/hbase (original) +++ hadoop/hbase/trunk/bin/hbase Fri May 30 12:19:46 2008 @@ -55,11 +55,11 @@ if [ $# = 0 ]; then echo "Usage: hbase <command>" echo "where <command> is one of:" - echo " shell run the Hbase shell" - echo " master run an Hbase HMaster node" - echo " regionserver run an Hbase HRegionServer node" - echo " rest run an Hbase REST server" - echo " thrift run an Hbase Thrift server" + echo " shell run the HBase shell" + echo " master run an HBase HMaster node" + echo " regionserver run an HBase HRegionServer node" + echo " rest run an HBase REST server" + echo " thrift run an HBase Thrift server" echo " migrate upgrade an hbase.rootdir" echo " or" echo " CLASSNAME run the class named CLASSNAME" Modified: hadoop/hbase/trunk/bin/hirb.rb URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/bin/hirb.rb?rev=661825&r1=661824&r2=661825&view=diff ============================================================================== --- hadoop/hbase/trunk/bin/hirb.rb (original) +++ hadoop/hbase/trunk/bin/hirb.rb Fri May 30 12:19:46 2008 @@ -1,5 +1,13 @@ -# Some goodies for hirb -require 'irb/completion' +# Module passed to jirb using the '-r' flag when bin/hbase shell is invoked. +# Pollutes jirb with hbase imports and hbase commands. Outputs a banner +# that tells user where to find help, shell version, etc. + +# TODO: Process command-line arguments: e.g. --master= or -Dhbase.etc and --formatter +# or read hbase shell configurations from irbrc +# TODO: Read from environment which outputter to use (outputter should +# be able to output to a passed Stream as well as STDIN and STDOUT) +# TODO: Write a base class for formatters with ascii, xhtml, and json subclasses. +# TODO: Intercept 'help' # Run the java magic include and import basic HBase types. include Java @@ -11,20 +19,25 @@ import org.apache.hadoop.hbase.HTableDescriptor import org.apache.hadoop.hbase.io.BatchUpdate +# Some goodies for hirb. Should these be left up to the user's discretion? +require 'irb/completion' + # Set the irb shell name to be hbase. IRB.conf[:IRB_NAME] = "hbase" -# TODO: Read from environment which outputter to use (outputter should -# be able to output to a passed Stream as well as STDIN and STDOUT) - - -def help - puts 'HBase Commands:' - puts ' version Output the hbase version' +def hbase + puts 'HBase Shell Commands:' + puts ' version Output HBase version' end def version - puts "HBase Version: #{org.apache.hadoop.hbase.util.VersionInfo.getVersion()}" - puts "SVN Revision: #{org.apache.hadoop.hbase.util.VersionInfo.getRevision()}" - puts "HBase Compiled: #{org.apache.hadoop.hbase.util.VersionInfo.getDate()}" + puts "Version: #{org.apache.hadoop.hbase.util.VersionInfo.getVersion()},\ + r#{org.apache.hadoop.hbase.util.VersionInfo.getRevision()},\ + #{org.apache.hadoop.hbase.util.VersionInfo.getDate()}" end + +# Output a banner message that tells users where to go for help +# TODO: Test that we're in irb context. For now presume it. +# TODO: Test that we are in shell context. +puts "HBase Shell; type 'hbase<RETURN>' for the list of supported HBase commands" +version Added: hadoop/hbase/trunk/lib/jruby-complete-1.1.2.jar URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/lib/jruby-complete-1.1.2.jar?rev=661825&view=auto ============================================================================== Binary file - no diff available. Propchange: hadoop/hbase/trunk/lib/jruby-complete-1.1.2.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream