Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new ValGens + riak_dt+pb driver(s) #211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions examples/riak_dt_maps.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{mode, {rate, max}}.
{duration, 5}.
{concurrent, 10}.
{report_interval, 1}.

%% This bucket type must be created and set to be datatype, maps.
{riakc_dt_bucket, {<<"maps">>, <<"test">>}}.

{key_generator, {int_to_bin_bigendian, {uniform_int, 10}}}.
{value_generator, {var_bin_set, 1000, 100, poisson}}.

{operations, [{{map, counter, insert_no_ctx}, 20}, {{map, register, modify}, 2},
{{map, read}, 5}, {{map, map, insert}, 1},
{{map, flag, modify}, 1}, {{map, multi_ops, insert_no_ctx}, 1}]}.

{riakc_dt_map_multi_ops, [map_counter, map_register, map_flag, map_set,
map_map]}.

{riakc_dt_ips, [{{127,0,0,1}, [10017, 10027, 10037, 10047, 10057]}]}.

{driver, basho_bench_driver_riakc_dt_pb}.
18 changes: 18 additions & 0 deletions examples/riak_dt_maps_single.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{mode, {rate, max}}.
{duration, 2}.
{concurrent, 5}.
{report_interval, 1}.

%% This bucket type must be created and set to be datatype, maps.
{riakc_dt_bucket, {<<"maps">>, <<"test">>}}.

{key_generator, {int_to_bin_bigendian, {uniform_int, 10}}}.
{value_generator, {fixed_bin, 10000}}.

{operations, [{{map, map, modify}, 1}]}.

{riakc_dt_run_one_map, true}.

{riakc_dt_ips, [{{127,0,0,1}, [10017, 10027, 10037, 10047, 10057]}]}.

{driver, basho_bench_driver_riakc_dt_pb}.
19 changes: 19 additions & 0 deletions examples/riak_dt_sets.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{mode, {rate, max}}.
{duration, 2}.
{concurrent, 5}.
{report_interval, 1}.

%% This bucket type must be created and set to be datatype, sets.
{riakc_dt_bucket, {<<"sets">>, <<"test">>}}.

{key_generator, {int_to_bin_bigendian, {uniform_int, 10}}}.
%% {value_generator, {keygen, {int_to_bin_bigendian, {sequential_int, 10000}}}}.
{value_generator, {var_bin_set, 10, 100, 1000}}.

%% 50 writes to 1 read
{operations, [{{set, insert}, 50}, {{set, read}, 1}, {{set, is_element}, 1},
{{set, remove}, 1}]}.

{riakc_dt_ips, [{{127,0,0,1}, [10017, 10027, 10037, 10047, 10057]}]}.

{driver, basho_bench_driver_riakc_dt_pb}.
21 changes: 21 additions & 0 deletions examples/riak_dt_sets_aws.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{mode, {rate, max}}.
{duration, 1}.
{concurrent, 1}.
{report_interval, 1}.

%% This bucket type must be created and set to be datatype, sets.
{riakc_dt_bucket, {<<"sets">>, <<"test">>}}.

{key_generator, {int_to_bin_bigendian, {uniform_int, 1000}}}.
{value_generator, {keygen, {int_to_bin_bigendian, {sequential_int, 10000}}}}.

{operations, [{{set, insert}, 1}]}.

{riakc_dt_ips,
[{"riak101.aws", 8087},
{"riak102.aws", 8087},
{"riak103.aws", 8087},
{"riak104.aws", 8087},
{"riak105.aws", 8087}]}.

{driver, basho_bench_driver_riakc_dt_pb}.
21 changes: 21 additions & 0 deletions examples/riak_dt_sets_batch.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{mode, {rate, max}}.
{duration, 3}.
{concurrent, 5}.
{report_interval, 1}.

%% This bucket type must be created and set to be datatype, sets.
{riakc_dt_bucket, {<<"sets">>, <<"test">>}}.

{key_generator, {int_to_bin_bigendian, {uniform_int, 10}}}.

%% 1000 per batch, means 10 sets w/ 1000 items that are 100 (4 + 96) bytes each
{value_generator, {keygen, {concat_binary, {valgen, {bin_seed, 96}},
{int_to_bin_bigendian, {sequential_int, 1000000}}}}}.

{riakc_dt_sets_batchsize, 1000}.

{operations, [{{set, batch_insert}, 1}]}.

{riakc_dt_ips, [{{127,0,0,1}, [10017, 10027, 10037, 10047, 10057]}]}.

{driver, basho_bench_driver_riakc_dt_pb}.
16 changes: 16 additions & 0 deletions examples/riak_dt_sets_big_elements.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{mode, {rate, max}}.
{duration, 1}.
{concurrent, 1}.
{report_interval, 1}.

%% This bucket type must be created and set to be datatype, sets.
{riakc_dt_bucket, {<<"sets">>, <<"test">>}}.

{key_generator, {int_to_bin_bigendian, {sequential_int, 100}}}.
{value_generator, {fixed_bin_set, 1000, 200}}.

{operations, [{{set, insert}, 1}]}.

{riakc_dt_ips, [{{127,0,0,1}, [10017, 10027, 10037, 10047, 10057]}]}.

{driver, basho_bench_driver_riakc_dt_pb}.
22 changes: 22 additions & 0 deletions examples/riak_dt_sets_preload.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{mode, {rate, max}}.
{duration, 5}.
{concurrent, 5}.
{report_interval, 1}.

%% This bucket type must be created and set to be datatype, sets.
{riakc_dt_bucket, {<<"sets">>, <<"test">>}}.

{key_generator, {uniform_int, 100}}.

%% 1000 elements, exponential binary
{value_generator, {exponential_bin, 100, 500}}.

{riakc_dt_preload_sets, true}.
{riakc_dt_preload_sets_num, 10}.
{riakc_dt_max_vals_for_preload, 1000}.

{operations, [{{set, insert}, 1}]}.

{riakc_dt_ips, [{{127,0,0,1}, [10017, 10027, 10037, 10047, 10057]}]}.

{driver, basho_bench_driver_riakc_dt_pb}.
23 changes: 23 additions & 0 deletions examples/riak_dt_sets_read.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{mode, {rate, max}}.
{duration, 2}.
{concurrent, 5}.
{report_interval, 1}.

%% This bucket type must be created and set to be datatype, sets.
{riakc_dt_bucket, {<<"sets">>, <<"test">>}}.

{key_generator, {int_to_bin_bigendian, {uniform_int, 10}}}.
{value_generator, {keygen, {int_to_bin_bigendian, {sequential_int, 100}}}}.

%% For preloaded_sets:
%% {riakc_dt_preload_sets, true}.
%% {riakc_dt_preload_sets_num, 10}.

%% For run once:
%% {riakc_dt_run_one_set, true}.

{operations, [{{set, read}, 1}]}.

{riakc_dt_ips, [{{127,0,0,1}, [10017, 10027, 10037, 10047, 10057]}]}.

{driver, basho_bench_driver_riakc_dt_pb}.
20 changes: 20 additions & 0 deletions examples/riak_dt_sets_single.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{mode, {rate, max}}.
{duration, 3}.
{concurrent, 5}.
{report_interval, 1}.

%% This bucket type must be created and set to be datatype, sets.
{riakc_dt_bucket, {<<"sets">>, <<"test">>}}.

{key_generator, {int_to_bin_bigendian, {uniform_int, 10}}}.

%% MinSize=10, MaxSize=100, 1000 items
{value_generator, {var_bin_set, 10, 100, 1000}}.

{riakc_dt_run_one_set, true}.

{operations, [{{set, insert_no_ctx}, 1}]}.

{riakc_dt_ips, [{{127,0,0,1}, [10017, 10027, 10037, 10047, 10057]}]}.

{driver, basho_bench_driver_riakc_dt_pb}.
6 changes: 3 additions & 3 deletions examples/riakclient.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

{driver, basho_bench_driver_riakclient}.

{code_paths, ["/Users/jmeredith/basho/riak/apps/riak_kv",
"/Users/jmeredith/basho/riak/apps/riak_core"]}.
{code_paths, ["/Users/VINCESTAPLES/riak_ee/deps/riak_kv",
"/Users/VINCESTAPLES/riak_ee/deps/riak_core"]}.

{key_generator, {int_to_bin_bigendian, {uniform_int, 35000}}}.

{value_generator, {fixed_bin, 10000}}.

{riakclient_nodes, ['riak@127.0.0.1']}.
{riakclient_nodes, ['dev1@127.0.0.1']}.

{riakclient_mynode, ['[email protected]', longnames]}.

Expand Down
22 changes: 22 additions & 0 deletions examples/riakclient_sets.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{mode, {rate, max}}.
{duration, 2}.
{concurrent, 5}.
{report_interval, 1}.
{mode, max}.

{riakclient_bucket, {<<"sets">>, <<"test">>}}.

{key_generator, {int_to_bin_bigendian, {pareto_int, 100}}}.
{value_generator, {keygen, {int_to_bin_bigendian, {sequential_int, 100000}}}}.

{code_paths, ["/Users/VINCESTAPLES/riak_ee/deps/riak_kv/ebin",
"/Users/VINCESTAPLES/riak_ee/deps/riak_dt/ebin",
"/Users/VINCESTAPLES/riak_ee/deps/riak_core/ebin"]}.

{riakclient_mynode, ['[email protected]', longnames]}.
{riakclient_nodes, ['[email protected]', '[email protected]', '[email protected]',
'[email protected]', '[email protected]']}.

{operations, [{insert, 10}, {read, 3}, {remove_last_read, 1}]}.

{driver, basho_bench_driver_riakclient_sets}.
26 changes: 26 additions & 0 deletions priv/riak_kv_bench_clientsets.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/src/riak_kv_crdt.erl b/src/riak_kv_crdt.erl
index 01ac9a0..769e799 100644
--- a/src/riak_kv_crdt.erl
+++ b/src/riak_kv_crdt.erl
@@ -29,7 +29,8 @@
%% MR helper funs
-export([value/1, counter_value/1, set_value/1, map_value/1]).
%% Other helper funs
--export([is_crdt/1]).
+-export([is_crdt/1, operation/3]).
+-compile([export_all]).

-include("riak_kv_wm_raw.hrl").
-include("riak_object.hrl").
@@ -510,6 +511,11 @@ get_context(Type, Value) ->
false -> <<>>
end.

+%% @TODO remove, added for hack up benchmarking sets
+operation(Mod, Op, Ctx) ->
+ #crdt_op{mod=Mod, op=Op, ctx=Ctx}.
+
+
%% ===================================================================
%% EUnit tests
%% ===================================================================
Loading