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 D6D798B2B for ; Fri, 12 Aug 2011 07:44:27 +0000 (UTC) Received: (qmail 58714 invoked by uid 500); 12 Aug 2011 07:44:18 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 57601 invoked by uid 500); 12 Aug 2011 07:44:03 -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 56900 invoked by uid 99); 12 Aug 2011 07:43:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 07:43:43 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zzdtsv@gmail.com designates 209.85.213.41 as permitted sender) Received: from [209.85.213.41] (HELO mail-yw0-f41.google.com) (209.85.213.41) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 07:43:38 +0000 Received: by ywm13 with SMTP id 13so1351231ywm.14 for ; Fri, 12 Aug 2011 00:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=J01csqYOkJLaPm9LyqiTOD9PaxVFxhymLbzjhB8TWY4=; b=WqqPC018KC+pPtTFVZuqLwASStkgKz1W3kKMyjHkQI8Xs3Dh5NVsSs2W+op18/5ZKc f3IYbrKykgrnCH5CX0BthyhdyJ+RN18uZmCGXa358IGBThVtlu+t360fVx9Z5KeFZXz1 ZhzbmBfoi+tovYWl4yPyKzB3HjafV+7XiX/Yc= Received: by 10.42.154.199 with SMTP id r7mr645111icw.277.1313134997139; Fri, 12 Aug 2011 00:43:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.96.10 with HTTP; Fri, 12 Aug 2011 00:42:57 -0700 (PDT) In-Reply-To: References: <6F4660EF6A95604382F58BC9C07FF4BF1811238F6A@P3PW5EX1MB13.EX1.SECURESERVER.NET> <84B5E4309B3B9F4ABFF7664C3CD7698302D0DD14@kairo.scch.at> From: zizon Date: Fri, 12 Aug 2011 15:42:57 +0800 Message-ID: Subject: Re: autoFlush To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=90e6ba6e89ea0bf25104aa4a11db --90e6ba6e89ea0bf25104aa4a11db Content-Type: text/plain; charset=UTF-8 or do something like this: HTablePool pool = new HTablePool(config, maxSize, new HTableFactory() { @Override public HTableInterface createHTableInterface(Configuration config, byte[] tableName) { try { HTable table= new HTable(config, tableName); *table.setAutoFlush(false);* return table; } catch (IOException ioe) { throw new RuntimeException(ioe); } } }); pass a user define HTableInterfaceFactory to instantiate htabl pool On Fri, Aug 12, 2011 at 3:33 PM, Allan Yan wrote: > 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 = 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 = 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 = (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. I see the setAutoFlush > > method in HTable. I do not see that in the HTableInterface that is > > returned from HTablePool. Is there something equivalent to setAutoFlush > > on table instances from HTablePool? > > > > Thanks! > > > --90e6ba6e89ea0bf25104aa4a11db--