Permalink
Browse files

Merge branch 'riak-pipe-testing'

Conflicts:
	priv/tests.def
	src/mapred_verify.erl
  • Loading branch information...
2 parents 25e62e5 + cf887cb commit fde2f7d51a00cb674cf22b213b763c27d18c6950 Bryan Fink committed Jul 13, 2012
Showing with 27 additions and 7 deletions.
  1. +14 −1 priv/tests.def
  2. +13 −6 src/mapred_verify.erl
View
@@ -73,7 +73,7 @@
{[{map, {jsfun, <<"Riak.mapValuesJson">>}, none, true}],
map}}.
-{"Link prev", %% Do not change this name!
+{"Erlang/JS Link prev", %% Do not remove "Link" from this name!
{[{link, '_', <<"prev">>, false},
{map, {jsanon,
<<"function(v,d) {
@@ -84,3 +84,16 @@
}">>},
none, true}],
map}}.
+
+{"Erlang/Erlang link prev",
+{[{link, '_', <<"prev">>, false},
+ {map, {modfun, riak_kv_mapreduce, map_object_value},
+ <<"include_notfound">>, true}],
+ map}}.
+
+{"Erlang/Erlang SLF hack 2",
+{[{map, {modfun, riak_kv_mapreduce, map_object_value},
+ <<"filter_notfound">>, false},
+ {reduce,{modfun, riak_kv_mapreduce, reduce_sort}, none,true}],
+ sorted}}.
+
View
@@ -83,7 +83,7 @@ test_descriptions(TestFile) ->
end.
verify_job(Client, Bucket, KeyCount, Label, JobDesc, Verifier) ->
- case re:run(Label, "link prev", [caseless]) of
+ case re:run(Label, "link", [caseless]) of
{match, _} ->
%% The link phase of a MapReduce query does not return any
%% results on a missing key, so it makes checking for the
@@ -115,7 +115,8 @@ verify_job(Client, Bucket, KeyCount, Label, JobDesc, Verifier) ->
verify_missing_job(Client, _Bucket, _KeyCount, JobDesc, Verifier) ->
Inputs = [{<<"mrv_missing">>, <<"mrv_missing">>}],
Start = erlang:now(),
- {ok, Result} = Client:mapred(Inputs, JobDesc, 120000),
+ {_, Node, _} = Client,
+ {ok, Result} = rpc:call(Node, riak_kv_mrc_pipe, mapred, [Inputs, JobDesc]),
End = erlang:now(),
{mapred_verifiers:Verifier(missing, Result, 1),
erlang:round(timer:now_diff(End, Start) / 1000)}.
@@ -124,7 +125,8 @@ verify_missing_twice_job(Client, _Bucket, _KeyCount, JobDesc, Verifier) ->
Inputs = [{<<"mrv_missing">>, <<"mrv_missing">>},
{<<"mrv_missing">>, <<"mrv_missing">>}],
Start = erlang:now(),
- {ok, Result} = Client:mapred(Inputs, JobDesc, 120000),
+ {_, Node, _} = Client,
+ {ok, Result} = rpc:call(Node, riak_kv_mrc_pipe, mapred, [Inputs, JobDesc]),
End = erlang:now(),
{mapred_verifiers:Verifier(missing, Result, 2),
erlang:round(timer:now_diff(End, Start) / 1000)}.
@@ -135,23 +137,28 @@ verify_filter_job(Client, Bucket, KeyCount, JobDesc, Verifier) ->
[[<<"ends_with">>,<<"5">>]]
]],
Start = erlang:now(),
- {ok, Result} = Client:mapred_bucket({Bucket,Filter}, JobDesc, 120000),
+ {_, Node, _} = Client,
+ {ok, Result} = rpc:call(Node, riak_kv_mrc_pipe, mapred,
+ [{Bucket,Filter}, JobDesc]),
End = erlang:now(),
Inputs = compute_filter(KeyCount, Filter),
{mapred_verifiers:Verifier(filter, Result, length(Inputs)),
erlang:round(timer:now_diff(End, Start) / 1000)}.
verify_bucket_job(Client, Bucket, KeyCount, JobDesc, Verifier) ->
Start = erlang:now(),
- {ok, Result} = Client:mapred_bucket(Bucket, JobDesc, 600000),
+ {_, Node, _} = Client,
+ {ok, Result} = rpc:call(Node, riak_kv_mrc_pipe, mapred,
+ [Bucket, JobDesc, 600000]),
End = erlang:now(),
{mapred_verifiers:Verifier(bucket, Result, KeyCount),
erlang:round(timer:now_diff(End, Start) / 1000)}.
verify_entries_job(Client, Bucket, KeyCount, JobDesc, Verifier) ->
Inputs = select_inputs(Bucket, KeyCount),
Start = erlang:now(),
- {ok, Result} = Client:mapred(Inputs, JobDesc, 600000),
+ {_, Node, _} = Client,
+ {ok, Result} = rpc:call(Node, riak_kv_mrc_pipe, mapred, [Inputs, JobDesc]),
End = erlang:now(),
{mapred_verifiers:Verifier(entries, Result, length(Inputs)),
erlang:round(timer:now_diff(End, Start) / 1000)}.

0 comments on commit fde2f7d

Please sign in to comment.