You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Peter Haidinyak <ph...@local.com> on 2011/04/20 19:08:16 UTC
HTable not thread safe
If the HTable is not thread safe how would one use multiple threads to read/write to a table?
Thanks
-Pete
RE: HTable not thread safe
Posted by Peter Haidinyak <ph...@local.com>.
Thanks, I'll do that. I need to redesign my client to be multi-threaded so it's a good time to look at it.
-Pete
-----Original Message-----
From: tsuna [mailto:tsunanet@gmail.com]
Sent: Wednesday, April 20, 2011 1:28 PM
To: user@hbase.apache.org
Subject: Re: HTable not thread safe
On Wed, Apr 20, 2011 at 10:12 AM, Peter Haidinyak <ph...@local.com> wrote:
> Sorry, my bad, I assumed each thread would have its own Table instance not using a shared instance.
Yeah you'd need to use one HTable instance per thread.
<plug>Alternatively, you can look at asynchbase, an alternative HBase
client that's fully asynchronous and non-blocking and written from the
ground-up to be thread safe. It performs much better than HTable for
high-throughput low-latency multi-threaded applications:
github.com/stumbleupon/asynchbase </plug>
--
Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com
Re: HTable not thread safe
Posted by tsuna <ts...@gmail.com>.
On Wed, Apr 20, 2011 at 10:12 AM, Peter Haidinyak <ph...@local.com> wrote:
> Sorry, my bad, I assumed each thread would have its own Table instance not using a shared instance.
Yeah you'd need to use one HTable instance per thread.
<plug>Alternatively, you can look at asynchbase, an alternative HBase
client that's fully asynchronous and non-blocking and written from the
ground-up to be thread safe. It performs much better than HTable for
high-throughput low-latency multi-threaded applications:
github.com/stumbleupon/asynchbase </plug>
--
Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com
RE: HTable not thread safe
Posted by Peter Haidinyak <ph...@local.com>.
Sorry, my bad, I assumed each thread would have its own Table instance not using a shared instance.
Thanks
-Pete
-----Original Message-----
From: Ted Yu [mailto:yuzhihong@gmail.com]
Sent: Wednesday, April 20, 2011 10:10 AM
To: user@hbase.apache.org
Subject: Re: HTable not thread safe
Each thread should maintain its own HTable instance.
On Wed, Apr 20, 2011 at 10:08 AM, Peter Haidinyak <ph...@local.com>wrote:
> If the HTable is not thread safe how would one use multiple threads to
> read/write to a table?
>
> Thanks
>
> -Pete
>
Re: HTable not thread safe
Posted by Ted Yu <yu...@gmail.com>.
Each thread should maintain its own HTable instance.
On Wed, Apr 20, 2011 at 10:08 AM, Peter Haidinyak <ph...@local.com>wrote:
> If the HTable is not thread safe how would one use multiple threads to
> read/write to a table?
>
> Thanks
>
> -Pete
>