You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2013/04/06 07:16:20 UTC
svn commit: r1465186 - /hbase/branches/0.94/src/main/ruby/hbase/admin.rb
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)