<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">Hi David,</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">This one is actually documented:</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"> <a href="http://basho.github.com/riak-python-client/mapreduce.html#riak.mapreduce.RiakMapReduce.run">http://basho.github.com/riak-python-client/mapreduce.html#riak.mapreduce.RiakMapReduce.run</a></span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">results = query.run(timeout=300000) #milliseconds = 5 minutes</span></div><br><span style="-webkit-text-size-adjust: auto;">adam</span><div style="-webkit-text-size-adjust: auto; ">(mobile)</div></div><div style="-webkit-text-size-adjust: auto; "><br>On 13 Oct 2012, at 08:40, David Montgomery <<a href="mailto:davidmontgomery@gmail.com">davidmontgomery@gmail.com</a>> wrote:<br><br></div><blockquote type="cite" style="-webkit-text-size-adjust: auto; "><div><span>Hi,</span><br><span></span><br><span>I am trying to run this map reduce job.  I get a time out.  Logic</span><br><span>would dictate that I add a time out to the RiakClient but that flag is</span><br><span>not there.  How do I deal with timeouts with the python api?  I have</span><br><span>data...I just cant get it out.</span><br><span></span><br><span>ile "/usr/local/lib/python2.7/dist-packages/riak-1.5.0-py2.7.egg/riak/transports/http.py",</span><br><span>line 321, in mapred</span><br><span>    (repr(response[0]), repr(response[1])))</span><br><span>Exception: Error running MapReduce operation. Headers: {'date': 'Sat,</span><br><span>13 Oct 2012 07:26:31 GMT', 'content-length': '19', 'content-type':</span><br><span>'application/json', 'http_code': 500, 'server': 'MochiWeb/1.1</span><br><span>WebMachine/1.9.0 (someone had painted it blue)'} Body:</span><br><span>'{"error":"timeout"}'</span><br><span></span><br><span>client  = riak.RiakClient(host='111.111.111.111',port=8087,</span><br><span>transport_class=riak.RiakPbcTransport)</span><br><span>    query = client.add('impressions')</span><br><span>    query.map('''</span><br><span>    function(value, keyData, arg) {</span><br><span>        var data = Riak.mapValuesJson(value)[0];</span><br><span></span><br><span>        if(data['adx']=='gdn'){</span><br><span>            var alt_key = data['hw'] + '_' + data['adx'];</span><br><span>            var obj = {};</span><br><span>            obj[alt_key] = 1;</span><br><span>            return [ obj ];</span><br><span>        }else{</span><br><span>           return [];</span><br><span>        }</span><br><span></span><br><span></span><br><span>    }''')</span><br><span></span><br><span>    query.reduce('''</span><br><span>    function(values, arg){</span><br><span>        return [ values.reduce( function(acc, item) {</span><br><span>            for (var state in item) {</span><br><span>                if (acc[state])</span><br><span>                    acc[state] += item[state];</span><br><span>                else</span><br><span>                    acc[state] = item[state];</span><br><span>            }</span><br><span>            return acc;</span><br><span>        })];</span><br><span>    }</span><br><span>    ''')</span><br><span></span><br><span>    for result in query.run():</span><br><span>        print result</span><br><span></span><br><span>_______________________________________________</span><br><span>riak-users mailing list</span><br><span><a href="mailto:riak-users@lists.basho.com">riak-users@lists.basho.com</a></span><br><span><a href="http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com">http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com</a></span><br></div></blockquote></body></html>