hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1207651 - /hbase/trunk/src/main/ruby/hbase/admin.rb
Date Mon, 28 Nov 2011 22:12:26 GMT
Author: larsh
Date: Mon Nov 28 22:12:25 2011
New Revision: 1207651

URL: http://svn.apache.org/viewvc?rev=1207651&view=rev
Log:
HBASE-4886 - truncate fails in HBase shell (Lars H)

Modified:
    hbase/trunk/src/main/ruby/hbase/admin.rb

Modified: hbase/trunk/src/main/ruby/hbase/admin.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/ruby/hbase/admin.rb?rev=1207651&r1=1207650&r2=1207651&view=diff
==============================================================================
--- hbase/trunk/src/main/ruby/hbase/admin.rb (original)
+++ hbase/trunk/src/main/ruby/hbase/admin.rb Mon Nov 28 22:12:25 2011
@@ -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)



Mime
View raw message