Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CB36F86F7 for ; Fri, 12 Aug 2011 07:34:37 +0000 (UTC) Received: (qmail 46366 invoked by uid 500); 12 Aug 2011 07:34:32 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 45955 invoked by uid 500); 12 Aug 2011 07:34:24 -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 45945 invoked by uid 99); 12 Aug 2011 07:34:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 07:34:20 +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 hailunyan@gmail.com designates 209.85.213.169 as permitted sender) Received: from [209.85.213.169] (HELO mail-yx0-f169.google.com) (209.85.213.169) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 07:34:13 +0000 Received: by yxn22 with SMTP id 22so2276308yxn.14 for ; Fri, 12 Aug 2011 00:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=msjogVL0tWuyWgmap7M4DVBanwLL84tW6UmSST6N0kM=; b=SMt7M1ltPgkgI5tYX6Sn6rejmiKmaR3/DlvL4qp/KQoIEKvkYSuqUq57iURxjt+zHA MIELcyhNPyWxEr1jyUjrILdPq/5r4GkZHtqzhEOlkctkJXXR/14PZo/6gM6QYMf5xgf6 QUZfbwGIKN5IGc4cu+FdSTOaOV7VRpgXhvDhE= MIME-Version: 1.0 Received: by 10.150.213.10 with SMTP id l10mr1555691ybg.283.1313134432360; Fri, 12 Aug 2011 00:33:52 -0700 (PDT) Received: by 10.151.50.12 with HTTP; Fri, 12 Aug 2011 00:33:52 -0700 (PDT) In-Reply-To: <84B5E4309B3B9F4ABFF7664C3CD7698302D0DD14@kairo.scch.at> References: <6F4660EF6A95604382F58BC9C07FF4BF1811238F6A@P3PW5EX1MB13.EX1.SECURESERVER.NET> <84B5E4309B3B9F4ABFF7664C3CD7698302D0DD14@kairo.scch.at> Date: Fri, 12 Aug 2011 00:33:52 -0700 Message-ID: Subject: Re: autoFlush From: Allan Yan 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 HTablePool uses HTableInterfaceFactory to return a HTableInterface. While HTable implements HTableInterface, it doesn't mean calling getTable method will always return HTable. Depends on how your HTablePool is instantiated, your HTablePool instance may or may not gives you HTable instance when you call getTable. For example, if you create HTablePool instance without passing your own HTableInterfaceFactory instance, as following: HTablePool htablePool =3D new HTablePool(config, 10); Internally, a HTableFactory is created and used for returning a HTable instance whenever the htablePool.getTable() method is called. However, to make your code bug free, you could check the object type first before you cast it , like this: HTableInterface table =3D tablePool.getTable(myTable); if(table instanceof HTable) ((HTable)table).setAutoFlush(true) On Thu, Aug 11, 2011 at 11:32 PM, Steinmaurer Thomas wrote: > Typecast the return value of the table pool to HTable and you shoud be > fine. E.g. I'm doing this: > > ... > HTable table =3D (HTable) tablePool.getTable(this.hbaseTable); > table.setAutoFlush(this.hbaseAPIuseAutoFlush); > table.setWriteBufferSize(this.hbaseAPIwriteBufferSize); > ... > > > lg, > Thomas > > -----Original Message----- > From: steve.boyle@connexity.com [mailto:steve.boyle@connexity.com] > Sent: Freitag, 12. August 2011 08:01 > To: user@hbase.apache.org > Subject: autoFlush > > I want to do client-side write-caching to hbase. =A0I see the setAutoFlus= h > method in HTable. =A0I do not see that in the HTableInterface that is > returned from HTablePool. =A0Is there something equivalent to setAutoFlus= h > on table instances from HTablePool? > > Thanks! >