HBASE-4886 - truncate fails in HBase shell (Lars H)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1207651 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
larsh 2011-11-28 22:12:25 +00:00
parent 01c389c879
commit 01652cecb9
1 changed files with 2 additions and 7 deletions

View File

@ -271,13 +271,8 @@ module Hbase
#----------------------------------------------------------------------------------------------
# Truncates table (deletes all records by recreating the table)
def truncate(table_name, conf = nil)
h_table = nil
unless conf
h_table = org.apache.hadoop.hbase.client.HTable.new(table_name)
else
h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name)
end
def truncate(table_name, conf = @conf)
h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name)
table_description = h_table.getTableDescriptor()
yield 'Disabling table...' if block_given?
disable(table_name)