Skip to content

Commit

Permalink
Added rocksdb bloom filter settings for kstore.
Browse files Browse the repository at this point in the history
Signed-off-by: Ted-Chang <[email protected]>
  • Loading branch information
Ted-Chang committed Jan 22, 2017
1 parent 60c008d commit 981c8e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/common/config_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ OPTION(kstore_max_ops, OPT_U64, 512)
OPTION(kstore_max_bytes, OPT_U64, 64*1024*1024)
OPTION(kstore_backend, OPT_STR, "rocksdb")
OPTION(kstore_rocksdb_options, OPT_STR, "compression=kNoCompression")
OPTION(kstore_rocksdb_bloom_bits_per_key, OPT_INT, 0)
OPTION(kstore_fsck_on_mount, OPT_BOOL, false)
OPTION(kstore_nid_prealloc, OPT_U64, 1024)
OPTION(kstore_sync_transaction, OPT_BOOL, false)
Expand Down
5 changes: 5 additions & 0 deletions src/kv/RocksDBStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ int RocksDBStore::do_open(ostream &out, bool create_if_missing)
rocksdb::BlockBasedTableOptions bbt_opts;
bbt_opts.block_size = g_conf->rocksdb_block_size;
bbt_opts.block_cache = cache;
if (g_conf->kstore_rocksdb_bloom_bits_per_key > 0) {
dout(10) << __func__ << " set bloom filter bits per key to "
<< g_conf->kstore_rocksdb_bloom_bits_per_key << dendl;
bbt_opts.filter_policy.reset(rocksdb::NewBloomFilterPolicy(g_conf->kstore_rocksdb_bloom_bits_per_key));
}
opt.table_factory.reset(rocksdb::NewBlockBasedTableFactory(bbt_opts));
dout(10) << __func__ << " set block size to " << g_conf->rocksdb_block_size
<< " cache size to " << g_conf->rocksdb_cache_size
Expand Down

0 comments on commit 981c8e7

Please sign in to comment.