You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ec...@apache.org on 2014/08/01 00:08:15 UTC
[39/50] [abbrv] git commit: [HBASE-11431] Add support of running from
command line for 'hbase shell'
[HBASE-11431] Add support of running from command line for 'hbase shell'
Summary: Process the arguments and run it.
Test Plan: Tested on dev cluster
Reviewers: gauravm, adela, elliott, manukranthk
Reviewed By: manukranthk
Subscribers: hbase-eng@
Differential Revision: https://phabricator.fb.com/D1409512
Tasks: 4571191
git-svn-id: svn+ssh://tubbs/svnhive/hadoop/branches/titan/VENDOR.hbase/hbase-trunk@43674 e7acf4d4-3532-417f-9e73-7a9ae25a1f51
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/89949ea1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/89949ea1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/89949ea1
Branch: refs/heads/0.89-fb
Commit: 89949ea164f553949f18d7eac3fed792cf180dfe
Parents: 14758a6
Author: daviddeng <da...@e7acf4d4-3532-417f-9e73-7a9ae25a1f51>
Authored: Thu Jul 24 17:07:05 2014 +0000
Committer: Elliott Clark <el...@fb.com>
Committed: Thu Jul 31 14:44:24 2014 -0700
----------------------------------------------------------------------
bin/hirb.rb | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/89949ea1/bin/hirb.rb
----------------------------------------------------------------------
diff --git a/bin/hirb.rb b/bin/hirb.rb
index d6892b5..a1c6baa 100644
--- a/bin/hirb.rb
+++ b/bin/hirb.rb
@@ -54,9 +54,11 @@ cmdline_help = <<HERE # HERE document output as shell usage
HBase Shell command-line options:
format Formatter for outputting results: console | html. Default: console
-d | --debug Set DEBUG log levels.
+ --exec='cmd' Run the command and exit immediately.
HERE
found = []
format = 'console'
+cmdline = nil
script2run = nil
log_level = org.apache.log4j.Level::ERROR
for arg in ARGV
@@ -77,6 +79,11 @@ for arg in ARGV
log_level = org.apache.log4j.Level::DEBUG
$fullBackTrace = true
puts "Setting DEBUG log level..."
+ elsif arg =~ /^--exec=(.+)/i
+ cmdline = $1
+ puts "exec " + cmdline
+ found.push(arg)
+ break
else
# Presume it a script. Save it off for running later below
# after we've set up some environment.
@@ -146,6 +153,9 @@ end
# Include hbase constants
include HBaseConstants
+eval(cmdline) if cmdline
+exit if cmdline
+
# 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