CorrugatedIron Link Walking

OJ Reeves oj at buffered.io
Thu Feb 7 04:24:38 EST 2013


Kevin,

A few points:

   - It's recommended that you avoid passing in a whole bucket as an
   argument to a map/reduce query as this results in keys for the bucket being
   listed, which as you know is an expensive operation.
   - The .Link() function is a function that says "please extract links
   from the objects specified by the .Inputs() function".
   - The lambda function that is passed to the .Link() function in the
   example you listed says "please look for links that are called "friend"
   that point at the "people" bucket.
   - .ReduceErlang() says "perform a reduce phase on the results from the
   previous phase using an Erlang module". The inputs to this phase are the
   outputs from the link thanks to the use of the .Link() function.
   - When using .ReduceErlang() you use the lambda to specify which module
   and function you want called on the inputs. The example below says "filter
   out duplicates using the reduce_set_union function that comes with Riak's
   riak_kv_mapreduce module".

I hope that clears things up a bit. I would recommend reading Basho's
documentation on map/reduces phases to help you get your head around what
they are and how they work.

Best of luck
OJ

On Thu, Feb 7, 2013 at 4:46 PM, Kevin Burton <rkevinburton at charter.net>wrote:

> I am trying out link walking with CorrugatedIron. I see in the
> documentation (http://corrugatediron.org/documentation/MapReduce.html):***
> *
>
> ** **
>
> *var* query1 = *new* RiakMapReduceQuery()****
>
>                  .Inputs("people")****
>
>                  .Link(l => l.Tag("friend").Bucket("people"))****
>
>                  .ReduceErlang(r => r.ModFun("riak_kv_mapreduce",
> "reduce_set_union").Keep(*true*));****
>
> ** **
>
> I am unclear what the function of the last ‘ReduceErlang’ method is?****
>
> ** **
>
> Also I want all links of a certain tag. Isn’t the bucket and key specified
> in the link? What is the purpose of the ‘Bucket’?****
>
> ** **
>
> Finally this is probably my ignorance on Map/Reduce but I don’t understand
> the different phase results.****
>
> ** **
>
> Thank you.****
>
> ** **
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 

OJ Reeves
+61 431 952 586
http://buffered.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20130207/6dcb277b/attachment.html>


More information about the riak-users mailing list