hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1479779 - /hbase/branches/0.95/hbase-server/src/main/ruby/hbase/admin.rb
Date Tue, 07 May 2013 06:53:05 GMT
Author: stack
Date: Tue May  7 06:53:05 2013
New Revision: 1479779

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

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

Modified: hbase/branches/0.95/hbase-server/src/main/ruby/hbase/admin.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/ruby/hbase/admin.rb?rev=1479779&r1=1479778&r2=1479779&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/ruby/hbase/admin.rb (original)
+++ hbase/branches/0.95/hbase-server/src/main/ruby/hbase/admin.rb Tue May  7 06:53:05 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?



Mime
View raw message