hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Gray" <jl...@streamy.com>
Subject RE: Integer key range scan
Date Tue, 16 Dec 2008 21:25:05 GMT
I believe there are intToBytes/bytesToInt functions in Bytes.java.  Rather than padding and
storing as strings, you can just store as binary numbers.  If you can't find those functions
I can send you one of our helper classes that deals with binary data easily.

Though this does make things a bit less pretty in web ui/shell it's far more efficient.

JG

> -----Original Message-----
> From: edward@udanax.org [mailto:edward@udanax.org] On Behalf Of Edward
> J. Yoon
> Sent: Tuesday, December 16, 2008 9:39 AM
> To: hbase-user@hadoop.apache.org
> Subject: Re: Integer key range scan
> 
> Oh Yes, Thanks for tip J-D.
> 
> On Wed, Dec 17, 2008 at 2:27 AM, Jean-Daniel Cryans
> <jdcryans@apache.org> wrote:
> > Yes, then you would scan with startrow = 0000000035 and stoprow =
> 0000000236
> > if this is really what you want to do.
> >
> > J-D
> >
> > On Tue, Dec 16, 2008 at 12:25 PM, Edward J. Yoon
> <edwardyoon@apache.org>wrote:
> >
> >> Like this? 0000000035 ~ 0000000235
> >>
> >> On Wed, Dec 17, 2008 at 2:21 AM, Jean-Daniel Cryans
> <jdcryans@apache.org>
> >> wrote:
> >> > You can left pad with zeroes then use the scanning facility for
> faster
> >> > retrieval.
> >> >
> >> > J-D
> >> >
> >> > On Tue, Dec 16, 2008 at 12:18 PM, Edward J. Yoon
> <edwardyoon@apache.org
> >> >wrote:
> >> >
> >> >> I would use integer key and extract data from range scans. But,
> hbase
> >> >> row/column is alphabetically sorted.
> >> >>
> >> >> So, I wrote like below:
> >> >>
> >> >> for (int i = 35; i <= 235; i++) {
> >> >>  table.getRow(i, columns[]);
> >> >> }
> >> >>
> >> >> It seems, causes too many requests over hbase.
> >> >> Any suggestion?
> >> >>
> >> >> --
> >> >> Best Regards, Edward J. Yoon @ NHN, corp.
> >> >> edwardyoon@apache.org
> >> >> http://blog.udanax.org
> >> >>
> >> >
> >>
> >>
> >>
> >> --
> >> Best Regards, Edward J. Yoon @ NHN, corp.
> >> edwardyoon@apache.org
> >> http://blog.udanax.org
> >>
> >
> 
> 
> 
> --
> Best Regards, Edward J. Yoon @ NHN, corp.
> edwardyoon@apache.org
> http://blog.udanax.org


Mime
View raw message