On 21 Sep 2011, at 20:13, Jeremiah Peschka wrote:

> Have you implemented any wrappers to make querying easier in the Java client 
> or are you leaving that up to the users to find?

Yes, wrappers to make it easy.

So in the java client I have added a fetchIndex method to the Bucket class. You 
specify the index name, the value (or start, end of a range) and then (behind 
the curtain) I either call the HTTP API for the HTTP transport, or generate a 
M/R query for the PB transport. The M/R query has a reduce phase that makes 
sure only the keys are returned to bring it inline with the HTTP API's return 
value.

I also expose a simple builder for creating M/R jobs that have an Index Query 
as an input.

So, as much as possible, I have made it so the user just calls fetchIndex and 
the client takes care of the 'how'.

This test[1] illustrates it.

Cheers

Russell

[1] 
https://github.com/basho/riak-java-client/blob/cd67a3ffc1e2cede0a8957a015a697eac2c2b421/src/test/java/com/basho/riak/client/itest/ITestBucket.java#L298

> ---
> Jeremiah Peschka - Founder, Brent Ozar PLF, LLC
> Microsoft SQL Server MVP
> 
> On Sep 21, 2011, at 12:03 PM, Russell Brown wrote:
> 
>> 
>> On 21 Sep 2011, at 19:57, Jeremiah Peschka wrote:
>> 
>>> So far, the documentation on querying secondary indexes is using the HTTP 
>>> APIs (see http://blog.basho.com/2011/09/14/Secondary-Indexes-in-Riak/). The 
>>> riakclient.proto doesn't show anything that's overwhelmingly obvious. 
>>> 
>>> Do secondary indexes currently require either using the HTTP API or writing 
>>> an MR job?
>> 
>> Yes.
>> 
>>> ---
>>> Jeremiah Peschka - Founder, Brent Ozar PLF, LLC
>>> Microsoft SQL Server MVP
>>> 
>>> 
>>> _______________________________________________
>>> riak-users mailing list
>>> [email protected]
>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>> 
> 
> 
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to