You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Lars George <la...@gmail.com> on 2011/04/05 12:22:17 UTC

HTablePool not using release

Hi,

I am wondering, shouldn't the putTable() also call
releaseHTableInterface on the discarded HTable instances, just like
the closeTablePool() does on the retaining instances?

Lars

Re: HTablePool not using release

Posted by Stack <st...@duboce.net>.
Sounds right.  Patch?
St.Ack

On Tue, Apr 5, 2011 at 3:22 AM, Lars George <la...@gmail.com> wrote:
> Hi,
>
> I am wondering, shouldn't the putTable() also call
> releaseHTableInterface on the discarded HTable instances, just like
> the closeTablePool() does on the retaining instances?
>
> Lars
>

Re: HTablePool not using release

Posted by Lars George <la...@gmail.com>.
Hi Ted,

I was referring to the discarded HTable instances. Not the ones that
are retained in the pool.

Lars

On Thu, Apr 7, 2011 at 4:44 AM, Ted Yu <yu...@gmail.com> wrote:
> The current behavior was intentional. See javadoc of closeTablePool():
>
>   * Note: this is a 'shutdown' of the given table pool and different from
>   * {@link #putTable(HTableInterface)}, that is used to return the table
>   * instance to the pool for future re-use.
> because releaseHTableInterface() calls
>      table.close();
>
> On Tue, Apr 5, 2011 at 3:22 AM, Lars George <la...@gmail.com> wrote:
>
>> Hi,
>>
>> I am wondering, shouldn't the putTable() also call
>> releaseHTableInterface on the discarded HTable instances, just like
>> the closeTablePool() does on the retaining instances?
>>
>> Lars
>>
>

Re: HTablePool not using release

Posted by Ted Yu <yu...@gmail.com>.
I think one potential issue would be a missing call to flushCommits() in
putTable().
Take a look at the example below:
    try {
      table = this.pool.getTable(tableName);
      table.put(puts);
      this.metrics.appliedOpsRate.inc(puts.size());
    } finally {
      if (table != null) {
        this.pool.putTable(table);
      }
    }

On Wed, Apr 6, 2011 at 7:44 PM, Ted Yu <yu...@gmail.com> wrote:

> The current behavior was intentional. See javadoc of closeTablePool():
>
>    * Note: this is a 'shutdown' of the given table pool and different from
>    * {@link #putTable(HTableInterface)}, that is used to return the table
>    * instance to the pool for future re-use.
> because releaseHTableInterface() calls
>       table.close();
>
>
> On Tue, Apr 5, 2011 at 3:22 AM, Lars George <la...@gmail.com> wrote:
>
>> Hi,
>>
>> I am wondering, shouldn't the putTable() also call
>> releaseHTableInterface on the discarded HTable instances, just like
>> the closeTablePool() does on the retaining instances?
>>
>> Lars
>>
>
>

Re: HTablePool not using release

Posted by Ted Yu <yu...@gmail.com>.
The current behavior was intentional. See javadoc of closeTablePool():

   * Note: this is a 'shutdown' of the given table pool and different from
   * {@link #putTable(HTableInterface)}, that is used to return the table
   * instance to the pool for future re-use.
because releaseHTableInterface() calls
      table.close();

On Tue, Apr 5, 2011 at 3:22 AM, Lars George <la...@gmail.com> wrote:

> Hi,
>
> I am wondering, shouldn't the putTable() also call
> releaseHTableInterface on the discarded HTable instances, just like
> the closeTablePool() does on the retaining instances?
>
> Lars
>