提交 7ecc5d4a 编写于 作者: D Dhruba Borthakur

Enable db_bench to specify block size.

Summary: Enable db_bench to specify block size.

Test Plan: compile and run

Reviewers: heyongqiang

Reviewed By: heyongqiang

Differential Revision: https://reviews.facebook.net/D5373
上级 407727b7
......@@ -91,6 +91,9 @@ static int FLAGS_write_buffer_size = 0;
// Negative means use default settings.
static long FLAGS_cache_size = -1;
// Number of bytes in a block.
static int FLAGS_block_size = 0;
// Maximum number of files to keep open at the same time (use default if == 0)
static int FLAGS_open_files = 0;
......@@ -783,6 +786,7 @@ class Benchmark {
options.create_if_missing = !FLAGS_use_existing_db;
options.block_cache = cache_;
options.write_buffer_size = FLAGS_write_buffer_size;
options.block_size = FLAGS_block_size;
options.filter_policy = filter_policy_;
options.max_open_files = FLAGS_open_files;
options.statistics = dbstats;
......@@ -1108,6 +1112,8 @@ int main(int argc, char** argv) {
FLAGS_write_buffer_size = n;
} else if (sscanf(argv[i], "--cache_size=%lld%c", &nn, &junk) == 1) {
FLAGS_cache_size = nn;
} else if (sscanf(argv[i], "--block_size=%d%c", &n, &junk) == 1) {
FLAGS_block_size = n;
} else if (sscanf(argv[i], "--cache_numshardbits=%d%c", &n, &junk) == 1) {
if (n < 20) {
FLAGS_cache_numshardbits = n;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册