For the batchpool :
if (batchPool == null) {
int maxThreads = conf.getInt("hbase.hconnection.threads.max",
Integer.MAX_VALUE);
if (maxThreads == 0) {
maxThreads = Runtime.getRuntime().availableProcessors();
}
If you don't set "hbase.hconnection.threads.max" to 0, maxThreads would
take Integer.MAX_VALUE.
Roughly how many simultaneous HBase client requests are you expecting ?
bq. how about regions cache, if new regions are created, do I need to
create a new HConnection ?
Not needed.
bq. it might be a good idea to add a detailed explanation about HBase
client management
I agree.
Cheers
On Sun, Jan 19, 2014 at 2:10 AM, Amit Sela <[email protected]> wrote:
> I need to connect to HBase (0.94.12) from an application server - Jetty
> (Felix).
>
> Documentation says the way to go is to get HConnection with
> HConnectionManager.createConnection(Configuration) use it to get table,
> close table and close connection.
> I also see that when creating an HConnection, a batchpool is created
> (lazy).
>
> Can I use one instance of HConnection to serve all HBase client requests on
> the server and close it only when the server goes down ? will it affect
> performance ? go stale ? how about regions cache, if new regions are
> created, do I need to create a new HConnection ?
>
> I think it might be a good idea to add a detailed explanation about HBase
> client management in the manual, maybe some best-practice advice or
> something like that.
>
> Thanks,
>
> Amit.
>