Hi Sohil,
On 21 Sep 2011, at 07:07, raghwani sohil wrote:
> Hi ,
>
> I am using mapreduce technique to access all keys between perticular period .
>
> This is my keys.json file .
>
> {"inputs":{"bucket":"test",
> "key_filters":[["matches" ,"2011_09_11"]]},
> "query":[{"map":{"language":"javascript",
> "source":"function(v) {
> return [v.key] ;
> }",
> "keep":true} } ]
> }
>
> I am invoking mapreduce call using curl
>
> curl -X POST -H "content-type: application/json" http://127.0.0.1:8098/mapred
> --data @keys.json
>
> but it gives me timeout error :- {"error":"timeout"}
>
> so Is there any way to resolve this problem ??
Map reduce over an entire bucket is not recommended and can be slow. To lessen
the likelihood of a timeout error you can add a 'timeout' parameter to the map
reduce JSON.
{"inputs":{"bucket":"test", "key_filters":[["matches" ,"2011_09_11"]]},
"query":[{"map":{"language":"javascript", "source":"function(v) { return
[v.key] ;}", "keep":true} } ], "timeout" : 60000}
You can read more about it on the wiki
http://wiki.basho.com/MapReduce.html#MapReduce-via-the-HTTP-API
However, it might be a better strategy to write to a new bucket per time
period, or take advantage of riak search, or secondary indexes and use a range
query.
Cheers
Russell
>
> thanks ,
> Sohil Raghwani .
>
> _______________________________________________
> 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