You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by anil gupta <an...@gmail.com> on 2012/11/30 19:54:57 UTC
Why InternalScanner doesn't have a method that returns entire row or
object of Result
Hi All,
I am developing a Coprocessor to sort results on the basis of Cell Value.
Basically an equivalent of order by clause in RDBMS.
In my subclass of BaseEndpointCoprocessor i would like to do fetch of
entire rows rather than individual KeyValue using the InternalScanner. But,
surprisingly there is no method to do that. Can any one tell me why we dont
have a method for fetching rows? What is the most optimized way to fetch
rows through current InternalScanner methods?
--
Thanks & Regards,
Anil Gupta
RE: Why InternalScanner doesn't have a method that returns entire
row or object of Result
Posted by Anoop Sam John <an...@huawei.com>.
Asaf
You are correct!
You mean the RegionScanner I think.. The 'limit' is applied at this level. HRegion$RegionScannerImpl
-Anoop-
________________________________________
From: Asaf Mesika [asaf.mesika@gmail.com]
Sent: Thursday, March 07, 2013 6:04 PM
To: user@hbase.apache.org
Subject: Re: Why InternalScanner doesn't have a method that returns entire row or object of Result
Guys,
Just to make things clear:
if I have a row which have 12 keys values, and then another row with 5 KVs,
and I called InternelScanner(results, 10), where 10 is the limit, then I
would get:
1. 10 KV of the 1st row
2. 2 KV of the 1st row
3. 5 KV of the 2nd row
Is this correct?
On Sat, Dec 1, 2012 at 4:01 AM, anil gupta <an...@gmail.com> wrote:
> Hi Ted,
>
> I figured out that i have to use next from InternalScanner. Thanks for the
> response.
> The comment for method "Grab the next row's worth of values." was a little
> confusing to me.
> "Get the keyValue's for the next row" would have been better. Just
> saying....
>
> Thanks,
> Anil
>
> On Fri, Nov 30, 2012 at 5:20 PM, Ted Yu <yu...@gmail.com> wrote:
>
> > Right.
> >
> > Take a look at AggregateImplementation.getAvg(), you would see how the
> > following method is used.
> >
> > On Fri, Nov 30, 2012 at 1:53 PM, anil gupta <an...@gmail.com>
> wrote:
> >
> > > Does this method in InternalScanner gets KeyValue's for only 1 row in 1
> > > call. Am i right?
> > >
> > > boolean *next<
> > >
> >
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html#next%28java.util.List%29
> > > >
> > > *(List<
> > >
> >
> http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true
> > > >
> > > <KeyValue<
> > > http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/KeyValue.html>
> > > > results)
> > > Grab the next row's worth of values.
> > >
> > >
> >
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html
> > >
> > > Thanks,
> > > Anil Gupta
> > >
> > > On Fri, Nov 30, 2012 at 10:54 AM, anil gupta <an...@gmail.com>
> > > wrote:
> > >
> > > > Hi All,
> > > >
> > > > I am developing a Coprocessor to sort results on the basis of Cell
> > Value.
> > > > Basically an equivalent of order by clause in RDBMS.
> > > > In my subclass of BaseEndpointCoprocessor i would like to do fetch of
> > > > entire rows rather than individual KeyValue using the
> InternalScanner.
> > > But,
> > > > surprisingly there is no method to do that. Can any one tell me why
> we
> > > dont
> > > > have a method for fetching rows? What is the most optimized way to
> > fetch
> > > > rows through current InternalScanner methods?
> > > > --
> > > > Thanks & Regards,
> > > > Anil Gupta
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks & Regards,
> > > Anil Gupta
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Anil Gupta
>
Re: Why InternalScanner doesn't have a method that returns entire row
or object of Result
Posted by Asaf Mesika <as...@gmail.com>.
Guys,
Just to make things clear:
if I have a row which have 12 keys values, and then another row with 5 KVs,
and I called InternelScanner(results, 10), where 10 is the limit, then I
would get:
1. 10 KV of the 1st row
2. 2 KV of the 1st row
3. 5 KV of the 2nd row
Is this correct?
On Sat, Dec 1, 2012 at 4:01 AM, anil gupta <an...@gmail.com> wrote:
> Hi Ted,
>
> I figured out that i have to use next from InternalScanner. Thanks for the
> response.
> The comment for method "Grab the next row's worth of values." was a little
> confusing to me.
> "Get the keyValue's for the next row" would have been better. Just
> saying....
>
> Thanks,
> Anil
>
> On Fri, Nov 30, 2012 at 5:20 PM, Ted Yu <yu...@gmail.com> wrote:
>
> > Right.
> >
> > Take a look at AggregateImplementation.getAvg(), you would see how the
> > following method is used.
> >
> > On Fri, Nov 30, 2012 at 1:53 PM, anil gupta <an...@gmail.com>
> wrote:
> >
> > > Does this method in InternalScanner gets KeyValue's for only 1 row in 1
> > > call. Am i right?
> > >
> > > boolean *next<
> > >
> >
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html#next%28java.util.List%29
> > > >
> > > *(List<
> > >
> >
> http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true
> > > >
> > > <KeyValue<
> > > http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/KeyValue.html>
> > > > results)
> > > Grab the next row's worth of values.
> > >
> > >
> >
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html
> > >
> > > Thanks,
> > > Anil Gupta
> > >
> > > On Fri, Nov 30, 2012 at 10:54 AM, anil gupta <an...@gmail.com>
> > > wrote:
> > >
> > > > Hi All,
> > > >
> > > > I am developing a Coprocessor to sort results on the basis of Cell
> > Value.
> > > > Basically an equivalent of order by clause in RDBMS.
> > > > In my subclass of BaseEndpointCoprocessor i would like to do fetch of
> > > > entire rows rather than individual KeyValue using the
> InternalScanner.
> > > But,
> > > > surprisingly there is no method to do that. Can any one tell me why
> we
> > > dont
> > > > have a method for fetching rows? What is the most optimized way to
> > fetch
> > > > rows through current InternalScanner methods?
> > > > --
> > > > Thanks & Regards,
> > > > Anil Gupta
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks & Regards,
> > > Anil Gupta
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Anil Gupta
>
Re: Why InternalScanner doesn't have a method that returns entire row
or object of Result
Posted by anil gupta <an...@gmail.com>.
Hi Ted,
I figured out that i have to use next from InternalScanner. Thanks for the
response.
The comment for method "Grab the next row's worth of values." was a little
confusing to me.
"Get the keyValue's for the next row" would have been better. Just
saying....
Thanks,
Anil
On Fri, Nov 30, 2012 at 5:20 PM, Ted Yu <yu...@gmail.com> wrote:
> Right.
>
> Take a look at AggregateImplementation.getAvg(), you would see how the
> following method is used.
>
> On Fri, Nov 30, 2012 at 1:53 PM, anil gupta <an...@gmail.com> wrote:
>
> > Does this method in InternalScanner gets KeyValue's for only 1 row in 1
> > call. Am i right?
> >
> > boolean *next<
> >
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html#next%28java.util.List%29
> > >
> > *(List<
> >
> http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true
> > >
> > <KeyValue<
> > http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/KeyValue.html>
> > > results)
> > Grab the next row's worth of values.
> >
> >
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html
> >
> > Thanks,
> > Anil Gupta
> >
> > On Fri, Nov 30, 2012 at 10:54 AM, anil gupta <an...@gmail.com>
> > wrote:
> >
> > > Hi All,
> > >
> > > I am developing a Coprocessor to sort results on the basis of Cell
> Value.
> > > Basically an equivalent of order by clause in RDBMS.
> > > In my subclass of BaseEndpointCoprocessor i would like to do fetch of
> > > entire rows rather than individual KeyValue using the InternalScanner.
> > But,
> > > surprisingly there is no method to do that. Can any one tell me why we
> > dont
> > > have a method for fetching rows? What is the most optimized way to
> fetch
> > > rows through current InternalScanner methods?
> > > --
> > > Thanks & Regards,
> > > Anil Gupta
> > >
> >
> >
> >
> > --
> > Thanks & Regards,
> > Anil Gupta
> >
>
--
Thanks & Regards,
Anil Gupta
Re: Why InternalScanner doesn't have a method that returns entire row
or object of Result
Posted by Ted Yu <yu...@gmail.com>.
Right.
Take a look at AggregateImplementation.getAvg(), you would see how the
following method is used.
On Fri, Nov 30, 2012 at 1:53 PM, anil gupta <an...@gmail.com> wrote:
> Does this method in InternalScanner gets KeyValue's for only 1 row in 1
> call. Am i right?
>
> boolean *next<
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html#next%28java.util.List%29
> >
> *(List<
> http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true
> >
> <KeyValue<
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/KeyValue.html>
> > results)
> Grab the next row's worth of values.
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html
>
> Thanks,
> Anil Gupta
>
> On Fri, Nov 30, 2012 at 10:54 AM, anil gupta <an...@gmail.com>
> wrote:
>
> > Hi All,
> >
> > I am developing a Coprocessor to sort results on the basis of Cell Value.
> > Basically an equivalent of order by clause in RDBMS.
> > In my subclass of BaseEndpointCoprocessor i would like to do fetch of
> > entire rows rather than individual KeyValue using the InternalScanner.
> But,
> > surprisingly there is no method to do that. Can any one tell me why we
> dont
> > have a method for fetching rows? What is the most optimized way to fetch
> > rows through current InternalScanner methods?
> > --
> > Thanks & Regards,
> > Anil Gupta
> >
>
>
>
> --
> Thanks & Regards,
> Anil Gupta
>
Re: Why InternalScanner doesn't have a method that returns entire row
or object of Result
Posted by anil gupta <an...@gmail.com>.
Does this method in InternalScanner gets KeyValue's for only 1 row in 1
call. Am i right?
boolean *next<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html#next%28java.util.List%29>
*(List<http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true>
<KeyValue<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/KeyValue.html>
> results)
Grab the next row's worth of values.
http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/InternalScanner.html
Thanks,
Anil Gupta
On Fri, Nov 30, 2012 at 10:54 AM, anil gupta <an...@gmail.com> wrote:
> Hi All,
>
> I am developing a Coprocessor to sort results on the basis of Cell Value.
> Basically an equivalent of order by clause in RDBMS.
> In my subclass of BaseEndpointCoprocessor i would like to do fetch of
> entire rows rather than individual KeyValue using the InternalScanner. But,
> surprisingly there is no method to do that. Can any one tell me why we dont
> have a method for fetching rows? What is the most optimized way to fetch
> rows through current InternalScanner methods?
> --
> Thanks & Regards,
> Anil Gupta
>
--
Thanks & Regards,
Anil Gupta