What Jonathan said.  I create my threads and have each thread create their
own HTable connection.  So then there is no sharing - they all run
independent.  I use a shared queue to give each thread jobs.

liam



On Fri, Jun 6, 2014 at 3:57 PM, Jonathan Hsieh <[email protected]> wrote:

> Hotec04,
>
> Create one one HConnection for the process and then create an HTable
> instance for each thread that uses the same HConnection. In newer hbase it
> is HConnection.getTable(name), in older hbase it is new
> HTable(HConnection).
>
> HTablePool is deprecated, and shouldn't really be used.
>
> Jon.
>
>
> On Fri, Jun 6, 2014 at 3:01 PM, Hotec04 <[email protected]> wrote:
>
> > Hi HBase users,
> >
> > I try to implement multiple threads for HBase writing process, but looks
> > like the table.flushCommites() breaks thread easily. Then I add a
> > synchronized blocker for it, it flows but when I publish 50 messages,
> about
> > 2 of them are missing...I am using HTablePool as well, so when every
> thread
> > comes in, they grab one Htable but all Htables are using the same table.
> >
> > Any ideas on how to work with HTable put operation for multiple threads?
> >
> > Thank you!
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-hbase.679495.n3.nabble.com/Discuss-HBase-with-multiple-threads-tp4060081.html
> > Sent from the HBase User mailing list archive at Nabble.com.
> >
>
>
>
> --
> // Jonathan Hsieh (shay)
> // HBase Tech Lead, Software Engineer, Cloudera
> // [email protected] // @jmhsieh
>

Reply via email to