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 AD890F449 for ; Sat, 6 Apr 2013 05:16:46 +0000 (UTC) Received: (qmail 38956 invoked by uid 500); 6 Apr 2013 05:16:45 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 38740 invoked by uid 500); 6 Apr 2013 05:16:45 -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 38708 invoked by uid 99); 6 Apr 2013 05:16:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Apr 2013 05:16:44 +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; Sat, 06 Apr 2013 05:16:41 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id EC24C23888E4; Sat, 6 Apr 2013 05:16:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1465186 - /hbase/branches/0.94/src/main/ruby/hbase/admin.rb Date: Sat, 06 Apr 2013 05:16:20 -0000 To: commits@hbase.apache.org From: larsh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130406051620.EC24C23888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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)