|
From e9bccdaa01ff7a32061d5da584671e7c88dffddc Mon Sep 17 00:00:00 2001 |
|
From: Eugene Koontz <[email protected]> |
|
Date: Fri, 24 Sep 2010 14:10:54 -0700 |
|
Subject: [PATCH] ticket 47-related code (to cause problem described) |
|
|
|
--- |
|
src/main/ruby/hbase/admin.rb | 6 +++++ |
|
src/main/ruby/shell.rb | 1 + |
|
src/main/ruby/shell/commands/killme.rb | 38 ++++++++++++++++++++++++++++++++ |
|
3 files changed, 45 insertions(+), 0 deletions(-) |
|
create mode 100644 src/main/ruby/shell/commands/killme.rb |
|
|
|
diff --git a/src/main/ruby/hbase/admin.rb b/src/main/ruby/hbase/admin.rb |
|
index 0d81c84..a4ffb76 100644 |
|
--- a/src/main/ruby/hbase/admin.rb |
|
+++ b/src/main/ruby/hbase/admin.rb |
|
@@ -214,6 +214,12 @@ module Hbase |
|
|
|
end |
|
|
|
+ def killme() |
|
+ 1.upto 11 do |x| |
|
+ get_first_region('foo') |
|
+ end |
|
+ end |
|
+ |
|
def get_first_region(table_name) |
|
#return the name of the first region for the given table name. |
|
#for example, given "foo", this will return something like: |
|
diff --git a/src/main/ruby/shell.rb b/src/main/ruby/shell.rb |
|
index bf00464..c39864b 100644 |
|
--- a/src/main/ruby/shell.rb |
|
+++ b/src/main/ruby/shell.rb |
|
@@ -217,6 +217,7 @@ Shell.load_command_group( |
|
enable |
|
exists |
|
grant |
|
+ killme |
|
list |
|
] |
|
) |
|
diff --git a/src/main/ruby/shell/commands/killme.rb b/src/main/ruby/shell/commands/killme.rb |
|
new file mode 100644 |
|
index 0000000..2266675 |
|
--- /dev/null |
|
+++ b/src/main/ruby/shell/commands/killme.rb |
|
@@ -0,0 +1,38 @@ |
|
+# |
|
+# Copyright 2010 The Apache Software Foundation |
|
+# |
|
+# Licensed to the Apache Software Foundation (ASF) under one |
|
+# or more contributor license agreements. See the NOTICE file |
|
+# distributed with this work for additional information |
|
+# regarding copyright ownership. The ASF licenses this file |
|
+# to you under the Apache License, Version 2.0 (the |
|
+# "License"); you may not use this file except in compliance |
|
+# with the License. You may obtain a copy of the License at |
|
+# |
|
+# http://www.apache.org/licenses/LICENSE-2.0 |
|
+# |
|
+# Unless required by applicable law or agreed to in writing, software |
|
+# distributed under the License is distributed on an "AS IS" BASIS, |
|
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
+# See the License for the specific language governing permissions and |
|
+# limitations under the License. |
|
+# |
|
+ |
|
+module Shell |
|
+ module Commands |
|
+ class Killme < Command |
|
+ def help |
|
+ return <<-EOF |
|
+ simply calls get_first_region('foo') |
|
+ hbase> killme |
|
+ EOF |
|
+ end |
|
+ |
|
+ def command() |
|
+ format_simple_command do |
|
+ admin.killme() |
|
+ end |
|
+ end |
|
+ end |
|
+ end |
|
+end |
|
-- |
|
1.7.1+GitX |