hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Purtell <apurt...@yahoo.com>
Subject RE: Questions on client API
Date Mon, 13 Oct 2008 18:14:00 GMT
Configuration uses unsynchronized lists and hash set. On the other hand if it is used in a
read-only manner after initialization that would be ok. 

I don't think sharing a scanner across threads would be ok because of the cache of RowResults
as an unsynchronized linked list. Otherwise HTable looks ok to me. 

Am I being overly conservative?

--- On Mon, 10/13/08, Jim Kellerman (POWERSET) <Jim.Kellerman@microsoft.com> wrote:

> From: Jim Kellerman (POWERSET) <Jim.Kellerman@microsoft.com>
> Subject: RE: Questions on client API
> To: "hbase-user@hadoop.apache.org" <hbase-user@hadoop.apache.org>
> Date: Monday, October 13, 2008, 10:48 AM
> Andrew,
> 
> What methods in HBaseConfiguration and HTable do you think
> are not re-entrant?
> 
> ---
> Jim Kellerman, Powerset (Live Search, Microsoft
> Corporation)
> 
> 
> > -----Original Message-----
> > From: Michael Dagaev [mailto:michael.dagaev@gmail.com]
> > Sent: Monday, October 13, 2008 10:24 AM
> > To: hbase-user@hadoop.apache.org; apurtell@apache.org
> > Subject: Re: Questions on client API
> >
> > Hi Andrew
> >
> >      Hmmm ...I would not like to instantiate
> HBaseConfiguration per
> > thread. I would prefer to create it once per
> application so many
> > threads will use it concurrently.
> >
> > Thank you for pointing out this issue. I will check
> the code.
> > M.
> >
> > On Mon, Oct 13, 2008 at 6:54 PM, Andrew Purtell
> <apurtell@yahoo.com>
> > wrote:
> > > Hello Michael,
> > >
> > > Your understanding regarding connection pooling
> is correct.
> > >
> > > Looking at the code, I see that some methods of
> > > HBaseConfiguration and HTable are not fully
> reentrant, so I
> > > would not share them across multiple threads, or
> at least I
> > > would explicitly synchronize access to them.
> > >
> > >    - Andy
> > >
> > >
> > >> From: Michael Dagaev
> <michael.dagaev@gmail.com>
> > >> Subject: Questions on client API
> > >> To: hbase-user@hadoop.apache.org
> > >> Date: Monday, October 13, 2008, 2:54 AM
> > >> Hi All
> > >>
> > >>     As I understand, the HTable class uses
> > >> HConnectionManager class, which holds
> connections to the
> > >> master and region servers. The connections
> are pooled as
> > >> entries in a thread-safe static table (map).
> Thus, a
> > >> client application should not care about
> connection
> > >> pooling. Is it correct?
> > >>
> > >>    May several threads share the same
> instance of
> > >> HbaseConfiguration ? HTable?
> > >>
> > >> Thank you for your cooperation,
> > >> M.
> > >
> > >
> > >
> > >
> > >


      

Mime
View raw message