From 8a466909446c4a5d526f747ef7cffcab6acbe145 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 7 May 2013 06:52:44 +0000 Subject: [PATCH] HBASE-5525 Truncate and preserve region boundaries option git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1479778 13f79535-47bb-0310-9956-ffa450edef68 --- hbase-server/src/main/ruby/hbase/admin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/ruby/hbase/admin.rb b/hbase-server/src/main/ruby/hbase/admin.rb index c10e7b75ac9..d5722b88ab8 100644 --- a/hbase-server/src/main/ruby/hbase/admin.rb +++ b/hbase-server/src/main/ruby/hbase/admin.rb @@ -349,7 +349,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 = org.apache.hadoop.hbase.client.HTable.new(conf, table_name) - splits = h_table.getRegionsInfo().keys().map{|i| Bytes.toString(i.getStartKey)}.delete_if{|k| k == ""}.to_java :String + 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() yield 'Disabling table...' if block_given?