Hi Vimal,

Here is, in the code, where this information is uses.

  private void returnTable(HTableInterface table) throws IOException {
    // this is the old putTable method renamed and made private
    String tableName = Bytes.toString(table.getTableName());
    if (tables.size(tableName) >= maxSize) {
      // release table instance since we're not reusing it
      this.tables.remove(tableName, table);
      this.tableFactory.releaseHTableInterface(table);
      return;
    }
    tables.put(tableName, table);
  }

As you can see, this value is used to limit the maximum size of the pool
i.e. the maximum number of the same table that we keep in the pool.

Let's say you have a pool for mytable with maxSize=10. If you open 12
tables, that will give you 12 tables. Byt if you close the 12 tables, only
10 of them are going to stay on the pool. The remaining 2 are going to be
released.

HTH

JM

2013/8/10 Vimal Jain <[email protected]>

> I am using HTablePool class in my client code to interact with Hbase. I see
> many constructors for this class ,one of them is :
>
> HTablePool(org.apache.hadoop.conf.Configuration config, int maxSize)
>
> Can anyone please help in understanding the second parameter (maxSize).
>
> --
> Thanks and Regards,
> Vimal Jain
>

Reply via email to