hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Marc Spaggiari <jean-m...@spaggiari.org>
Subject Re: maxSize parameter in HTablePool class
Date Sat, 10 Aug 2013 13:14:24 GMT
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);
    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



2013/8/10 Vimal Jain <vkjk89@gmail.com>

> 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message