You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/05/07 08:52:44 UTC

svn commit: r1479778 - /hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb

Author: stack
Date: Tue May  7 06:52:44 2013
New Revision: 1479778

URL: http://svn.apache.org/r1479778
Log:
HBASE-5525 Truncate and preserve region boundaries option

Modified:
    hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb

Modified: hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb?rev=1479778&r1=1479777&r2=1479778&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb (original)
+++ hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb Tue May  7 06:52:44 2013
@@ -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?