So in playing with things a little bit, I don't think that this list of bucket-key pairs is going to work for me.

I'm using riak counters to keep tabs of various customers ID's as they travel through our system. So when Bob first shows up, he's seen by one set of servers. Adding 1 to the counter for Bob within some bucket. When he interacts with us, we'll see Bob again in another service. And thus add 1 to another counter for Bob within another bucket.

so:
buckets/initial/counters/Bob => 1
and:
buckets/interact/counters/Bob => 1

Currently I'm using 2 MR queries to get the list of counts for all customers from both buckets and combine these data sets within the client. I'm trying to see if its possible to do this within 1 query. Maybe return something like:
{"Bob": [1,1]}
in json.

I know that riak_kv_counter:value() requires a RiakObject to get the data. I the case of a MR I know the key and that its in another bucket. Is it possible to get the RiakObject based on those two items?




On 12/17/2013 05:09 PM, Jeremiah Peschka wrote:

The allowable inputs to an MR map phase include a list of bucket key pairs. If you know your keys in advance the problem is solved.

Can you describe a bit more about how you're using MR? Is this an ad hoc query? A predictable report? Time based?

---
sent from a tiny portion of the hive mind...
in this case, a phone

On Dec 17, 2013 4:51 PM, "Bryce Verdier" <[email protected] <mailto:[email protected]>> wrote:

    Hi All,

    I have a question concerning map-reduce. I have two buckets with
    counters enabled that have similar keys to track two different
    metrics. At the moment in order to combine these two datasets
    together I have to make 2 different map-reduce queries and combine
    the data within the client. I'm wondering if/how it might be
    possible to combine both of these queries into one. I'm thinking
    that Links are a possibility, but I'm not sure if it would or how
    viable a solution it would be.

    Any and all advice is welcomed.

    Thanks in advance,
    Bryce

    _______________________________________________
    riak-users mailing list
    [email protected] <mailto:[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