mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
use rt:systest_write instead of listcomp of riakc_pb_socket:put
Yay for using builtin utilities instead of hand-rolled hacks.
This commit is contained in:
parent
c8efe95dac
commit
b6a6066d65
@ -50,14 +50,13 @@ confirm() ->
|
|||||||
rt:stop(ToKill),
|
rt:stop(ToKill),
|
||||||
|
|
||||||
%% store our test data
|
%% store our test data
|
||||||
C = rt:pbc(Primary),
|
|
||||||
Bucket = <<"verify_mr_prereduce_node_down">>,
|
Bucket = <<"verify_mr_prereduce_node_down">>,
|
||||||
ObjCount = 100,
|
ObjCount = 100,
|
||||||
lager:info("Loading ~b objects of test data", [ObjCount]),
|
lager:info("Loading ~b objects of test data", [ObjCount]),
|
||||||
[ ok = riakc_pb_socket:put(C, test_object(Bucket, N), [{w, 3}])
|
[] = rt:systest_write(Primary, 1, ObjCount, Bucket, 3),
|
||||||
|| N <- lists:seq(1, ObjCount) ],
|
|
||||||
|
|
||||||
%% run the query a bunch
|
%% run the query a bunch
|
||||||
|
C = rt:pbc(Primary),
|
||||||
TestCount = 100,
|
TestCount = 100,
|
||||||
lager:info("Running the MR query ~b times", [TestCount]),
|
lager:info("Running the MR query ~b times", [TestCount]),
|
||||||
Runs = [ run_query(C, Bucket) || _ <- lists:seq(1, TestCount) ],
|
Runs = [ run_query(C, Bucket) || _ <- lists:seq(1, TestCount) ],
|
||||||
@ -81,10 +80,6 @@ confirm() ->
|
|||||||
lager:info("~s: PASS", [atom_to_list(?MODULE)]),
|
lager:info("~s: PASS", [atom_to_list(?MODULE)]),
|
||||||
pass.
|
pass.
|
||||||
|
|
||||||
%% objects keyed by an ordinal, with a value of N
|
|
||||||
test_object(Bucket, N) ->
|
|
||||||
riakc_obj:new(Bucket, list_to_binary(integer_to_list(N)), N).
|
|
||||||
|
|
||||||
%% result should be a count of the objects in the bucket
|
%% result should be a count of the objects in the bucket
|
||||||
run_query(C, Bucket) ->
|
run_query(C, Bucket) ->
|
||||||
riakc_pb_socket:mapred(
|
riakc_pb_socket:mapred(
|
||||||
|
Loading…
Reference in New Issue
Block a user