hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Holstad <erikhols...@gmail.com>
Subject Re: HTablePool question
Date Sat, 11 Jul 2009 00:39:56 GMT
Hey Vaibhav!
I haven't used HTablePool myself, but we used to have something very similar
that we used internally.
But just looked at the code and will try to answer your questions.


On Thu, Jul 9, 2009 at 6:48 PM, Vaibhav Puranik <vpuranik@gmail.com> wrote:

> Hi,
>
> It looks like HTablePool is designed to have one instance of HTablePool per
> table.

Yes, it looks that way.


>
>
> I am confused by the static map inside HTablePool class. If we can
> instantiate one HTablePool per table, what's the use of the map?

The reason I think you are a little bit confused is because the classes
mixes a static getter with a non static class, so what you do is that you
use the static getPool to get you HTablePool and then you use the non static
methods to work on it.


>
> Furthermore, the map is static and there is no way to add multiple tables
> to
> it.

Yes, it is static, but not final, so every time  you ask for a pool for a
table that is not in the static map, it creates that key value pair. What
you cannot do though is to change the number of HTable instances after you
called it ones, not sure if you need this, but should be to hard to add if
you do.

>
>
> Regards,
> Vaibhav
>

Regards Erik

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