From d4853f0379faaaab649f4bbe914d60b1bc706b0d Mon Sep 17 00:00:00 2001 From: tedyu Date: Sat, 13 Dec 2014 09:01:53 -0800 Subject: [PATCH] HBASE-12681 truncate_preserve command fails with undefined method 'getTable' error (Ashish) --- 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 748a41ccb02..e5c312bf1cd 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()