Return-Path: Delivered-To: apmail-hbase-user-archive@www.apache.org Received: (qmail 23153 invoked from network); 14 Feb 2011 18:20:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Feb 2011 18:20:38 -0000 Received: (qmail 58422 invoked by uid 500); 14 Feb 2011 18:20:37 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 58317 invoked by uid 500); 14 Feb 2011 18:20:35 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 58305 invoked by uid 99); 14 Feb 2011 18:20:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Feb 2011 18:20:34 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jdcryans@gmail.com designates 209.85.215.41 as permitted sender) Received: from [209.85.215.41] (HELO mail-ew0-f41.google.com) (209.85.215.41) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Feb 2011 18:20:27 +0000 Received: by ewy27 with SMTP id 27so2494669ewy.14 for ; Mon, 14 Feb 2011 10:20:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+Wd6f8TPXVePSAug9ZEywoEstCgO4l/Oz4QMovd9xOs=; b=qWWlqjDgCtbFIWP9z92WpwsSLGemo6yJHlmaIbBaDhSdFIsbh+5fPM+uTw/nYVjFxW kNkF2ATc9NEBlpfrFYZmSN9MZmwyEnHnsmMKTApPxh6a59LfHTmZoJu19kmFRQttp6T5 ys9BE9A6yYP+m1GFETziF0sl0g9cA2RjaoZgQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=cadg3LxVmoYjWlKUMSbKcE8v9kK1j+mPYmBGefdqBCJk4HC07rV8tuq0slvmsIldMw tlA98IILqkip1THNnjyiwPxKbNJCENUEGYjGxIcKgjg5WCVB5NZmgUhsVFDbnKriLy5I OM37D1LZNjBwahH9jOvT+O6cVJUSPnNK3tz6M= MIME-Version: 1.0 Received: by 10.223.53.68 with SMTP id l4mr4968693fag.44.1297707607399; Mon, 14 Feb 2011 10:20:07 -0800 (PST) Sender: jdcryans@gmail.com Received: by 10.223.74.144 with HTTP; Mon, 14 Feb 2011 10:20:07 -0800 (PST) In-Reply-To: <321C2E54215EEB41A581FDD9DAECBC5DFCD94ACF@IRV1EXMB01.eLiberation.com> References: <321C2E54215EEB41A581FDD9DAECBC5DFCD94AC7@IRV1EXMB01.eLiberation.com> <321C2E54215EEB41A581FDD9DAECBC5DFCD94ACF@IRV1EXMB01.eLiberation.com> Date: Mon, 14 Feb 2011 10:20:07 -0800 X-Google-Sender-Auth: gFnqrK51CGWYu6UMegXR-3pSLXE Message-ID: Subject: Re: Truncate tables From: Jean-Daniel Cryans To: user@hbase.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Can you enable DEBUG for HBase, run your code, and post the output in a pastebin? J-D On Mon, Feb 14, 2011 at 10:14 AM, Peter Haidinyak wr= ote: > Each table is taking 30 seconds. Without looking at the HBase code I assu= med it was doing the same process as I am. Just quicker. > > Thanks > > -Pete > > -----Original Message----- > From: jdcryans@gmail.com [mailto:jdcryans@gmail.com] On Behalf Of Jean-Da= niel Cryans > Sent: Monday, February 14, 2011 10:12 AM > To: user@hbase.apache.org > Subject: Re: Truncate tables > > Erm well could it be that your script is truncating a bunch of tables > whereas in the shell it only does one? Apart from that I can't think > of anything obvious, the truncate command really does the same thing > as you. > > J-D > > On Mon, Feb 14, 2011 at 9:43 AM, Peter Haidinyak w= rote: >> Hi, >> =A0 =A0 =A0 =A0I've setup a little utility to truncate my tables during = development but I found that if I truncate a table from the HBase shell it = takes 2.5 seconds, from my program it take 30 seconds. The code to truncate= is pretty simple. Any ideas on what I've done wrong? >> >> Thanks >> >> -Pete >> >> =A0private void truncateTables() >> =A0 =A0throws IOException >> =A0{ >> =A0 =A0m_hbaseConnection =3D new HbaseConnection(); >> =A0 =A0m_hbaseConnection.setupHBaseConnection(); >> =A0 =A0final HBaseAdmin hBaseAdmin =3D m_hbaseConnection.getAdmin(); >> >> =A0 =A0int counter =3D 1; >> =A0 =A0for (final String tableName : CLUSTER_TABLES) >> =A0 =A0{ >> =A0 =A0 =A0final HTableDescriptor hTableDescriptor =3D hBaseAdmin.getTab= leDescriptor(tableName.getBytes()); >> =A0 =A0 =A0m_logger.info("Truncating Table {}.",tableName); >> =A0 =A0 =A0hBaseAdmin.disableTable(tableName); >> =A0 =A0 =A0hBaseAdmin.deleteTable(tableName); >> =A0 =A0 =A0hBaseAdmin.createTable(hTableDescriptor); >> =A0 =A0 =A0m_logger.info("Truncated Table {}.", tableName); >> =A0 =A0 =A0m_logger.info("Finished {} of {} Tables.", counter++, CLUSTER= _TABLES.length); >> >> =A0 =A0} // - End for each table. >> >> =A0} // - End truncateTables Method. >> >> >> =A0public void setupHBaseConnection() >> =A0 =A0throws IOException >> =A0{ >> =A0 =A0m_hbaseConfiguration =3D HBaseConfiguration.create(); >> =A0 =A0m_hbaseConfiguration.clear(); >> >> // - Get the m_hbaseConfiguration properties from the Command line -D pa= rameters. >> =A0 =A0m_hbaseConfiguration.set("hbase.zookeeper.quorum", System.getProp= erty("hbase.zookeeper.quorum")); >> =A0 =A0m_hbaseConfiguration.set("hbase.zookeeper.property.clientPort", S= ystem.getProperty("hbase.zookeeper.property.clientPort")); >> >> =A0 =A0m_logger.info("Using hbase.zookeeper.quorum : {}", m_hbaseConfigu= ration.get("hbase.zookeeper.quorum")); >> =A0 =A0m_logger.info("Using hbase.zookeeper.property.clientPort : {}", m= _hbaseConfiguration.get("hbase.zookeeper.property.clientPort")); >> >> =A0} // - End setupHBaseConnection Method. >> >> >