broken links

2010-06-15 Thread francisco treacy
Hi all, I have a document with some broken links (i.e. that point to a non-existent key), and want to apply a map/reduce there. var map = function(v, k, args) { ejsLog("/tmp/mr", "hello from map"); return [{from: "map"}] } db.link({ bucket: "highlights", keep: false }) .map({source: map})

Re: broken links

2010-06-15 Thread Kevin Smith
Francisco - You have perfect timing. This same question came up yesterday in #riak. The core of the issue is Riak runs map functions on the node hosting the relevant data. In the case of a 'not found', there is no hosting node -- the data doesn't exist -- so the map function is never invoked f

Re: rolling upgrade from 0.10 to 0.11

2010-06-15 Thread Sean Cribbs
Gareth, On 0.10 you can execute this sequence of commands from the console (or riak-admin attach) of any node, to remove the node you want: 1> {ok, Client} = riak:local_client(). 2> Client:remove_from_cluster('r...@10.1.5.37') Of course, replace 'r...@10.1.5.37' with the name of the node you wa

Re: broken links

2010-06-15 Thread francisco treacy
Thanks Kevin. Makes sense. For the record, this is how I have it now: var reduce = function(v) { return v.filter(function(n) { return !n.not_found }) } db.link({ bucket: "highlights", keep: false }) .map({name: 'Riak.mapValuesJson'}) .reduce({source: reduce}) .run([["user_chapters", id]]

Re: riak-java-client

2010-06-15 Thread Kevin Smith
I've just pushed a fix for this API oversight to the tip of the riak-java-client repository. You can pull and build source if you need the fix now or wait for the next release. Please feel free to report any problems you might encounter with this fix if you do decide to try it out. --Kevin On

Map Reduce in Ruby

2010-06-15 Thread matthew rathbone
Hi all, Does anyone know how I can specify one of the pre-existing javascript functions when running a map-reduce from ruby? For example, I want to run a reduce method that 1) specifies that I'm not creating an anonymous function, and 2) calls one of the predefined functions, eg 'reduce_sum' (as

Riak Recap for 6/14

2010-06-15 Thread Mark Phillips
Afternoon, Evening, Morning to all - For today's recap - an updated Java Client, a Riak Video (no, it's not a Riak Music Video), Riak at the upcoming Velocity Conference, and a Gist about embedding Riak. Enjoy, Mark Community Manager Basho Technologies wiki.basho.com twitter.com/pharkmillups

Re: Map Reduce in Ruby

2010-06-15 Thread Sean Cribbs
Matthew, The Ruby client gets a little clever here and tries to determine which kind of phase you are submitting. If its a String that starts with "function", it assumes you are passing the source. Otherwise, it assumes you are using a built-in JS function. If you want to use an Erlang funct

Updating objects in the Erlang PBC Client

2010-06-15 Thread Jon Meredith
I've been taking a look at how riakc_obj is used in the erlang PBC client after the issue of updating metadata was brought up by Mikl Kurkov a few weeks ago. The typical use case for the library is to get some data from the server, and then sometimes modify it/write it back again. With the