Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F0C7B9809 for ; Mon, 28 Nov 2011 22:12:47 +0000 (UTC) Received: (qmail 87205 invoked by uid 500); 28 Nov 2011 22:12:47 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 87178 invoked by uid 500); 28 Nov 2011 22:12:47 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 87155 invoked by uid 99); 28 Nov 2011 22:12:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2011 22:12:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2011 22:12:46 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D10CD2388860 for ; Mon, 28 Nov 2011 22:12:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1207651 - /hbase/trunk/src/main/ruby/hbase/admin.rb Date: Mon, 28 Nov 2011 22:12:26 -0000 To: commits@hbase.apache.org From: larsh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111128221226.D10CD2388860@eris.apache.org> 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)