hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1465186 - /hbase/branches/0.94/src/main/ruby/hbase/admin.rb
Date Sat, 06 Apr 2013 05:16:20 GMT
Author: larsh
Date: Sat Apr  6 05:16:20 2013
New Revision: 1465186

URL: http://svn.apache.org/r1465186
Log:
HBASE-7961 truncate on disabled table should throw TableNotEnabledException. (rajeshbabu)

Modified:
    hbase/branches/0.94/src/main/ruby/hbase/admin.rb

Modified: hbase/branches/0.94/src/main/ruby/hbase/admin.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/ruby/hbase/admin.rb?rev=1465186&r1=1465185&r2=1465186&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/ruby/hbase/admin.rb (original)
+++ hbase/branches/0.94/src/main/ruby/hbase/admin.rb Sat Apr  6 05:16:20 2013
@@ -310,11 +310,12 @@ module Hbase
     def truncate(table_name, conf = @conf)
       h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name)
       table_description = h_table.getTableDescriptor()
+      raise ArgumentError, "Table #{table_name} is not enabled. Enable it first.'" unless
enabled?(table_name)
       yield 'Disabling table...' if block_given?
-      disable(table_name)
+      @admin.disableTable(table_name)
 
       yield 'Dropping table...' if block_given?
-      drop(table_name)
+      @admin.deleteTable(table_name)
 
       yield 'Creating table...' if block_given?
       @admin.createTable(table_description)



Mime
View raw message