You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by James Andrew-Smith <ja...@archfashion.com.au> on 2013/03/15 06:38:40 UTC

Stargate / Rest - Get Multiple Rows by their keys in one call

Hi All,

I want to use Stargate to get multiple rows by their
ID/Rowkey, essentially what's described here, but via REST.

http://stackoverflow.com/questions/13310434/hbase-api-get-data-rows-information-by-list-of-row-ids

1. Is this possible?
2. If so, Could someone give me an example of the syntax I should use to do
this?
3. If not, is their some alternative?

Many thanks,
JR

Re: Stargate / Rest - Get Multiple Rows by their keys in one call

Posted by Suraj Varma <sv...@gmail.com>.
Also - this was added in 0.92
(https://issues.apache.org/jira/browse/HBASE-3541) ... since you
didn't mention your hbase version.
--Suraj

On Fri, Mar 15, 2013 at 4:12 PM, Suraj Varma <sv...@gmail.com> wrote:
> Per http://svn.apache.org/repos/asf/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java
> and
> http://svn.apache.org/repos/asf/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java,
> it appears you can. Also, see
> http://svn.apache.org/repos/asf/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/MultiRowResource.java,
>
> The syntax seems to be /multiget?row=id1&row=id2&row=id3 and so forth.
>
>  @Path("multiget")
>   public MultiRowResource getMultipleRowResource(
>
> and you get back a MultiRowResource.
>
> Let us know if this works as expected.
> --Suraj
>
> On Thu, Mar 14, 2013 at 10:38 PM, James Andrew-Smith
> <ja...@archfashion.com.au> wrote:
>> Hi All,
>>
>> I want to use Stargate to get multiple rows by their
>> ID/Rowkey, essentially what's described here, but via REST.
>>
>> http://stackoverflow.com/questions/13310434/hbase-api-get-data-rows-information-by-list-of-row-ids
>>
>> 1. Is this possible?
>> 2. If so, Could someone give me an example of the syntax I should use to do
>> this?
>> 3. If not, is their some alternative?
>>
>> Many thanks,
>> JR

Re: Stargate / Rest - Get Multiple Rows by their keys in one call

Posted by Suraj Varma <sv...@gmail.com>.
Per http://svn.apache.org/repos/asf/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java
and
http://svn.apache.org/repos/asf/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java,
it appears you can. Also, see
http://svn.apache.org/repos/asf/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/MultiRowResource.java,

The syntax seems to be /multiget?row=id1&row=id2&row=id3 and so forth.

 @Path("multiget")
  public MultiRowResource getMultipleRowResource(

and you get back a MultiRowResource.

Let us know if this works as expected.
--Suraj

On Thu, Mar 14, 2013 at 10:38 PM, James Andrew-Smith
<ja...@archfashion.com.au> wrote:
> Hi All,
>
> I want to use Stargate to get multiple rows by their
> ID/Rowkey, essentially what's described here, but via REST.
>
> http://stackoverflow.com/questions/13310434/hbase-api-get-data-rows-information-by-list-of-row-ids
>
> 1. Is this possible?
> 2. If so, Could someone give me an example of the syntax I should use to do
> this?
> 3. If not, is their some alternative?
>
> Many thanks,
> JR