Skip to content

Instantly share code, notes, and snippets.

@dermoth
Created June 6, 2012 17:53
Show Gist options
  • Save dermoth/2883573 to your computer and use it in GitHub Desktop.
Save dermoth/2883573 to your computer and use it in GitHub Desktop.
mapred test
{
"inputs":{
"bucket":"webaccesslogs",
"index":"ts_int",
"start":1338712811,
"end":1338712814,
"timeout":60000
},
"query":[
{
"map":{"language":"javascript","source":"
function(value, keyData, arg) {
var data = Riak.mapValuesJson(value)[0];
r = {};
if(data.remote_addr)
r[data.remote_addr] = 1;
return [r];
}
"}},{"reduce":{
"language":"javascript","source":"
function(values, arg){
return values.reduce(function(acc, item){
for (ip in item) {
if(acc[ip]) {
acc[ip] += item[ip];
} else {
acc[ip] = item[ip];
}
}
return acc;
});
}
"}
}
]
}
@dermoth
Copy link
Author

dermoth commented Jun 7, 2012

                {<<"eleveldb_mult">>, riak_kv_eleveldb_backend, [
                        %% eleveldb configuration
                        {write_buffer_size_min, 3670016 }, %% 3.5MB in bytes
                        {write_buffer_size_max, 4194304}, %% 4MB in bytes
                        {max_open_files, 20}, %% Maximum number of files open at once per partition
                        {block_size, 4096}, %% 4K blocks
                        {cache_size, 8388608}, %% 8MB default cache size per-partition
                        {sync, false}
                ]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment