hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vimal Jain <vkj...@gmail.com>
Subject Re: maxSize parameter in HTablePool class
Date Sun, 11 Aug 2013 03:38:06 GMT
Thanks a lot Jean-Marc and Ted.
Now its clear.


On Sat, Aug 10, 2013 at 6:52 PM, Ted Yu <yuzhihong@gmail.com> wrote:

> Vimal:
> Please also take a look at HBASE-6580 which would be in the upcoming
> 0.94.11
>
> HTablePool class is being deprecated.
>
> Cheers
>
> On Sat, Aug 10, 2013 at 6:14 AM, Jean-Marc Spaggiari <
> jean-marc@spaggiari.org> wrote:
>
> > 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 <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
> > >
> >
>



-- 
Thanks and Regards,
Vimal Jain

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