You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Jianshi Huang <ji...@gmail.com> on 2014/08/11 11:40:10 UTC
How to create a connection pool with specified pool size?
I followed the manual and uses HConnectionManager.createConnection to
create a connection pool.
However I couldn't find reference about how to specify the pool size? It
should be in the second parameter pool of type ExecutorService, right? How
can I do that?
Cheers,
--
Jianshi Huang
LinkedIn: jianshi
Twitter: @jshuang
Github & Blog: http://huangjs.github.com/
Re: How to create a connection pool with specified pool size?
Posted by Jianshi Huang <ji...@gmail.com>.
I see. Thank you Ted for the help. :)
Jianshi
On Mon, Aug 11, 2014 at 9:57 PM, Ted Yu <yu...@gmail.com> wrote:
> If you use the following method:
>
> public static HConnection
> <
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/HConnection.html
> >
> createConnection(org.apache.hadoop.conf.Configuration conf,
> ExecutorService
> <
> http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html?is-external=true
> >
> pool)
>
> You can pass your own ExecutorService.
>
> See example in
> http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html?is-external=true
>
> Cheers
>
>
>
> On Mon, Aug 11, 2014 at 2:40 AM, Jianshi Huang <ji...@gmail.com>
> wrote:
>
> > I followed the manual and uses HConnectionManager.createConnection to
> > create a connection pool.
> >
> > However I couldn't find reference about how to specify the pool size? It
> > should be in the second parameter pool of type ExecutorService, right?
> How
> > can I do that?
> >
> > Cheers,
> > --
> > Jianshi Huang
> >
> > LinkedIn: jianshi
> > Twitter: @jshuang
> > Github & Blog: http://huangjs.github.com/
> >
>
--
Jianshi Huang
LinkedIn: jianshi
Twitter: @jshuang
Github & Blog: http://huangjs.github.com/
Re: How to create a connection pool with specified pool size?
Posted by Ted Yu <yu...@gmail.com>.
If you use the following method:
public static HConnection
<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/HConnection.html>
createConnection(org.apache.hadoop.conf.Configuration conf,
ExecutorService
<http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html?is-external=true>
pool)
You can pass your own ExecutorService.
See example in http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html?is-external=true
Cheers
On Mon, Aug 11, 2014 at 2:40 AM, Jianshi Huang <ji...@gmail.com>
wrote:
> I followed the manual and uses HConnectionManager.createConnection to
> create a connection pool.
>
> However I couldn't find reference about how to specify the pool size? It
> should be in the second parameter pool of type ExecutorService, right? How
> can I do that?
>
> Cheers,
> --
> Jianshi Huang
>
> LinkedIn: jianshi
> Twitter: @jshuang
> Github & Blog: http://huangjs.github.com/
>