Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5530FEE80 for ; Sat, 9 Mar 2013 12:33:21 +0000 (UTC) Received: (qmail 82798 invoked by uid 500); 9 Mar 2013 12:33:21 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 82499 invoked by uid 500); 9 Mar 2013 12:33:16 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 82233 invoked by uid 99); 9 Mar 2013 12:33:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Mar 2013 12:33:13 +0000 Date: Sat, 9 Mar 2013 12:33:13 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-7961) truncate on disabled table should throw TableNotEnabledException. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-7961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13597908#comment-13597908 ] Hudson commented on HBASE-7961: ------------------------------- Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #438 (See [https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/438/]) HBASE-7961 truncate on disabled table should throw TableNotEnabledException. (Rajesh) (Revision 1454677) Result = FAILURE ramkrishna : Files : * /hbase/trunk/hbase-server/src/main/ruby/hbase/admin.rb > truncate on disabled table should throw TableNotEnabledException. > ----------------------------------------------------------------- > > Key: HBASE-7961 > URL: https://issues.apache.org/jira/browse/HBASE-7961 > Project: HBase > Issue Type: Bug > Components: Admin > Reporter: rajeshbabu > Assignee: rajeshbabu > Fix For: 0.98.0, 0.94.7 > > Attachments: HBASE-7961.patch > > > presently truncate on disabled table is deleting existing table and recreating(ENABLED) > disable(table_name) call in truncate returing if table is disabled without nofifying to user. > {code} > def disable(table_name) > tableExists(table_name) > return if disabled?(table_name) > @admin.disableTable(table_name) > end > {code} > one more thing is we are calling tableExists in disable(table_name) as well as drop(table_name) which is un necessary. > Any way below HTable object creation will check whether table exists or not. > {code} > h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name) > {code} > We can change it to > {code} > h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name) > table_description = h_table.getTableDescriptor() > yield 'Disabling table...' if block_given? > @admin.disableTable(table_name) > yield 'Dropping table...' if block_given? > @admin.deleteTable(table_name) > yield 'Creating table...' if block_given? > @admin.createTable(table_description) > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira