hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manjeet Singh <manjeet.chand...@gmail.com>
Subject Re: How to get Last 1000 records from 1 millions records
Date Thu, 25 Aug 2016 07:06:53 GMT
I am using some logical salt say I have mobile number in my row key so I am
using some algo and fitting this mobile number into some ASCII char
So each time I know what will be the salt so its clear to me and it will
never change the order
example
if based on my algo I get A for 9811111111
so each time it will always return me A for 9811111111
so if I have my row key Like
A_9811111111_101
A_9811111111_102
A_9811111111_103
A_9811111111_104
A_9811111111_105
A_9811111111_106
A_9811111111_107
A_9811111111_108

it will sort my row key in same manner as showing above now these are
millions of record now i want to get last 10000 records
is their any way to get it, my concern is to perform all calcuation on
server side not client side.


Thanks
Manjeet


On Thu, Aug 25, 2016 at 1:06 AM, Esteban Gutierrez <esteban@cloudera.com>
wrote:

> As long as new rows are added to the latest region that "might" work. But
> if the table is using hashed keys or rows are added randomly to the table
> then retrieving the last million will be trickier and you will have to scan
> based on timestamp (if not modified) and then filter one more time.
>
> esteban.
>
>
> --
> Cloudera, Inc.
>
>
> On Wed, Aug 24, 2016 at 12:31 PM, Ted Yu <yuzhihong@gmail.com> wrote:
>
> > The following API should help in your case:
> >
> >   public Scan setReversed(boolean reversed) {
> >
> > Cheers
> >
> > On Wed, Aug 24, 2016 at 12:05 PM, Manjeet Singh <
> > manjeet.chandhok@gmail.com>
> > wrote:
> >
> > > Hi all
> > >
> > > Hbase didnt provide sorting on column but rowkey store in sorted form
> > > like small value first and greater value last
> > >
> > > example
> > > 1
> > > 2
> > > 3
> > > 4
> > > 5
> > > 6
> > > 7
> > > and so on
> > >
> > > Assume I have 1 Miilions record but i want to look last 1000 records
> only
> > > Is their any way to do this? I don't want to perform any calculation on
> > > client side so may be any filter can help on it?
> > >
> > > Thanks
> > > Manjeet
> > >
> > > --
> > > luv all
> > >
> >
>



-- 
luv all

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message