You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ra...@apache.org on 2013/03/09 10:25:22 UTC
svn commit: r1454677 - /hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb
Author: ramkrishna
Date: Sat Mar 9 09:25:22 2013
New Revision: 1454677
URL: http://svn.apache.org/r1454677
Log:
HBASE-7961 truncate on disabled table should throw TableNotEnabledException.
(Rajesh)
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=1454677&r1=1454676&r2=1454677&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb (original)
+++ hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb Sat Mar 9 09:25:22 2013
@@ -327,11 +327,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)