hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Segel <michael_se...@hotmail.com>
Subject RE: Why and When to use HTablePool?
Date Tue, 09 Nov 2010 16:14:08 GMT

> Date: Tue, 9 Nov 2010 09:57:42 -0600
> Subject: Re: Why and When to use HTablePool?
> From: barneyfranks1@gmail.com
> To: user@hbase.apache.org
> Two differences that I know of:)
> With htable you bear the overhead of instantiating the htable for each time
> you need access to it.  The overhead can be substantial if response time is
> your biggest concern.
> Example:  contact = *new* HTable(config, "contact");

Sorry, but that's a bit of an overly broad statement.

When you're using hbase in a map/reduce environment, you set up a single htable instance in
then reference it in your map() method. So you incur the cost of setting up the htable once.

If you're working in a single node, and a multi-threaded application like a web service reading
from HBase, then you may want to have a pool 
of connections. Totally different design. 

The use case for the HTablePool is pretty much the same as any application where you need
to fetch a resource from a pool rather than constantly instantiate them. 

Really the driving factor on which to use (HTable or HTablePool) is going to be your use case,
or rather what it is you hope to achieve.

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