From 181b1debb898a60f6bcbd4fb8d44a667030035b4 Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Fri, 11 May 2012 12:23:29 +0200 Subject: [PATCH] Update basho_bench driver to recognize config flags Also, add default values to template configuration --- src/basho_bench_driver_hanoidb.erl | 3 ++- src/hanoidb_bbench.config | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/basho_bench_driver_hanoidb.erl b/src/basho_bench_driver_hanoidb.erl index ec20c1b..5844d54 100644 --- a/src/basho_bench_driver_hanoidb.erl +++ b/src/basho_bench_driver_hanoidb.erl @@ -59,6 +59,7 @@ new(_Id) -> %% Get the target directory Dir = basho_bench_config:get(hanoidb_dir, "."), Filename = filename:join(Dir, "test.hanoidb"), + Config = basho_bench_config:get(hanoidb_flags, []), %% Look for sync interval config case basho_bench_config:get(hanoidb_sync_interval, infinity) of @@ -69,7 +70,7 @@ new(_Id) -> end, %% Get any bitcask flags - case hanoidb:open(Filename) of + case hanoidb:open(Filename, Config) of {error, Reason} -> ?FAIL_MSG("Failed to open hanoidb in ~s: ~p\n", [Filename, Reason]); {ok, FBTree} -> diff --git a/src/hanoidb_bbench.config b/src/hanoidb_bbench.config index 941a860..5978fc0 100644 --- a/src/hanoidb_bbench.config +++ b/src/hanoidb_bbench.config @@ -21,6 +21,11 @@ "../hanoidb/deps/ebloom/ebin" ]}. -{bitcask_dir, "/tmp/hanoidb.bench"}. +% {hanoidb_dir, "/tmp/hanoidb.bench"}. -{bitcask_flags, [o_sync]}. +{hanoidb_flags, [{expiry_secs, 0}, + {sync_strategy, none}, %% |sync|{seconds, N} + {compress, none}, %% |gzip + {page_size, 8192}, % + {merge_strategy, fast} %% |predictable + ]}.