From ae89b628533c49ce334ce5b8b6dcb7681bf822db Mon Sep 17 00:00:00 2001 From: Ashish Singhi Date: Sat, 13 Dec 2014 17:12:59 +0530 Subject: [PATCH] HBASE-12681 truncate_preserve comand fails with undefined method `getTable' error --- hbase-shell/src/main/ruby/hbase/admin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb index 748a41c..e5c312b 100644 --- a/hbase-shell/src/main/ruby/hbase/admin.rb +++ b/hbase-shell/src/main/ruby/hbase/admin.rb @@ -384,7 +384,7 @@ module Hbase #---------------------------------------------------------------------------------------------- # Truncates table while maintaing region boundaries (deletes all records by recreating the table) def truncate_preserve(table_name, conf = @conf) - h_table = @connection.getTable(table_name) + h_table = @conn.getTable(table_name) splits = h_table.getRegionLocations().keys().map{|i| Bytes.toString(i.getStartKey)}.delete_if{|k| k == ""}.to_java :String splits = org.apache.hadoop.hbase.util.Bytes.toByteArrays(splits) table_description = h_table.getTableDescriptor() -- 1.9.2.msysgit.0