You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Jerry Lam <ch...@gmail.com> on 2012/10/19 16:31:17 UTC

Question on Scanner REST API Usage

Hi HBase community:

I have a few questions on the usage of Scanner via REST API:

- From the XML schema (
http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/rest/package-summary.html#xmlschema),
we can set the maximum number of values to return for each call to next()
by specifying the batch attribute. Is there a way to set the number of rows
for caching that will be passed to scanners (setCaching)?

- Also, I cannot find a way to get all columns of a single row for each
call to next(). Can someone tell me if this is possible? Note that setting
the batch size won't work because, for example, some rows might have 10
columns and the other rows might have 5 columns, setting batch to 10 will
include cells that are from other rows. I want a API that behaves like the
Java native API that will get all columns of a row when I call next().

Any help is greatly appreciated.

Best Regards,

Jerry

Re: Question on Scanner REST API Usage

Posted by Andrew Purtell <ap...@apache.org>.
Hi Jerry,

> Is there a way to set the number of rows for caching that will be passed
to scanners (setCaching)?

No.

Scanners on the REST server will use the default value for setCaching
provided in the hbase-site.xml deployed for the REST server. Overriding it
hasn't been considered a good idea because the REST server is a shared
client among many tenants.

> Note that setting the batch size won't work because, for example, some
rows might have 10 columns and the other rows might have 5 columns, setting
batch to 10 will include cells that are from other rows.

Yes, REST scanners will pull in cells from subsequent rows if one row
doesn't have sufficient cells to fill the 'batch' parameter given.

> I want a API that behaves like the Java native API that will get all
columns of a row when I call next().

Patches which provide this behavior as an option would gladly be accepted!

On Fri, Oct 19, 2012 at 7:31 AM, Jerry Lam <ch...@gmail.com> wrote:

> Hi HBase community:
>
> I have a few questions on the usage of Scanner via REST API:
>
> - From the XML schema (
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/rest/package-summary.html#xmlschema
> ),
> we can set the maximum number of values to return for each call to next()
> by specifying the batch attribute. Is there a way to set the number of rows
> for caching that will be passed to scanners (setCaching)?
>
> - Also, I cannot find a way to get all columns of a single row for each
> call to next(). Can someone tell me if this is possible? Note that setting
> the batch size won't work because, for example, some rows might have 10
> columns and the other rows might have 5 columns, setting batch to 10 will
> include cells that are from other rows. I want a API that behaves like the
> Java native API that will get all columns of a row when I call next().
>
> Any help is greatly appreciated.
>
> Best Regards,
>
> Jerry
>



-- 
Best regards,

   - Andy

Problems worthy of attack prove their worth by hitting back. - Piet Hein
(via Tom White)