You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2009/06/26 01:53:05 UTC
svn commit: r788550 - in /hadoop/hbase/trunk: CHANGES.txt bin/hirb.rb
Author: stack
Date: Thu Jun 25 23:53:04 2009
New Revision: 788550
URL: http://svn.apache.org/viewvc?rev=788550&view=rev
Log:
HBASE-1450 Scripts passed to hbase shell do not have shell context set up for them
Modified:
hadoop/hbase/trunk/CHANGES.txt
hadoop/hbase/trunk/bin/hirb.rb
Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=788550&r1=788549&r2=788550&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Thu Jun 25 23:53:04 2009
@@ -225,6 +225,8 @@
(Lars George via Stack)
HBASE-1563 incrementColumnValue does not write to WAL (Jon Gray via Stack)
HBASE-1569 rare race condition can take down a regionserver
+ HBASE-1450 Scripts passed to hbase shell do not have shell context set up
+ for them
IMPROVEMENTS
HBASE-1089 Add count of regions on filesystem to master UI; add percentage
Modified: hadoop/hbase/trunk/bin/hirb.rb
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/bin/hirb.rb?rev=788550&r1=788549&r2=788550&view=diff
==============================================================================
--- hadoop/hbase/trunk/bin/hirb.rb (original)
+++ hadoop/hbase/trunk/bin/hirb.rb Thu Jun 25 23:53:04 2009
@@ -18,6 +18,11 @@
# Some goodies for hirb. Should these be left up to the user's discretion?
require 'irb/completion'
+# Hack to turn down zk logging so it don't spew over the shell
+# log4j.logger.org.apache.zookeeper=INFO
+logger = org.apache.log4j.Logger.getLogger("org.apache.zookeeper")
+logger.setLevel(org.apache.log4j.Level::WARN);
+
# Add the $HBASE_HOME/bin directory, the location of this script, to the ruby
# load path so I can load up my HBase ruby modules
$LOAD_PATH.unshift File.dirname($PROGRAM_NAME)
@@ -35,6 +40,7 @@
found = []
format = 'console'
format_width = 110
+script2run = nil
for arg in ARGV
if arg =~ /^--format=(.+)/i
format = $1
@@ -53,9 +59,10 @@
puts cmdline_help
exit
else
- # Presume it a script and try running it. Will go on to run the shell unless
- # script calls 'exit' or 'exit 0' or 'exit errcode'.
- load(arg)
+ # Presume it a script. Save it off for running later below
+ # after we've set up some environment.
+ script2run = arg
+ found.push(arg)
end
end
for arg in found
@@ -91,6 +98,10 @@
promoteConstants(org.apache.hadoop.hbase.HTableDescriptor.constants)
promoteConstants(HBase.constants)
+# If script2run, try running it. Will go on to run the shell unless
+# script calls 'exit' or 'exit 0' or 'exit errcode'.
+load(script2run) if script2run
+
# Start of the hbase shell commands.
# General shell methods