diff --git a/HISTORY.md b/HISTORY.md index 759592a3b..420377cbf 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,10 +3,18 @@ ### Unreleased ### New Features * Add include/utilities/write_batch_with_index.h, providing a utilitiy class to query data out of WriteBatch when building it. +* Move BlockBasedTable related options to BlockBasedTableOptions from Options. Change corresponding JNI interface. Options affected include: + no_block_cache, block_cache, block_cache_compressed, block_size, block_size_deviation, block_restart_interval, filter_policy, whole_key_filtering. filter_policy is changed to shared_ptr from a raw pointer. +* Remove deprecated options: disable_seek_compaction and db_stats_log_interval +* OptimizeForPointLookup() takes one parameter for block cache size. It now builds hash index, bloom filter, and block cache. ### Public API changes * The Prefix Extractor used with V2 compaction filters is now passed user key to SliceTransform::Transform instead of unparsed RocksDB key. + +----- Past Releases ----- + + ## 3.4.0 (8/18/2014) ### New Features * Support Multiple DB paths in universal style compactions @@ -21,9 +29,6 @@ * Add DB property rocksdb.estimate-num-keys, estimated number of live keys in DB. * Add DB::GetIntProperty(), which returns DB properties that are integer as uint64_t. * The Prefix Extractor used with V2 compaction filters is now passed user key to SliceTransform::Transform instead of unparsed RocksDB key. -* Move BlockBasedTable related options to BlockBasedTableOptions from Options. Change corresponding JNI interface. Options affected include: - no_block_cache, block_cache, block_cache_compressed, block_size, block_size_deviation, block_restart_interval, filter_policy, whole_key_filtering. filter_policy is changed to shared_ptr from a raw pointer. -* Remove deprecated options: disable_seek_compaction and db_stats_log_interval ## 3.3.0 (7/10/2014) ### New Features diff --git a/db/c.cc b/db/c.cc index f357a54e8..3114f3500 100644 --- a/db/c.cc +++ b/db/c.cc @@ -1137,8 +1137,8 @@ void rocksdb_options_increase_parallelism( } void rocksdb_options_optimize_for_point_lookup( - rocksdb_options_t* opt) { - opt->rep.OptimizeForPointLookup(); + rocksdb_options_t* opt, uint64_t block_cache_size_mb) { + opt->rep.OptimizeForPointLookup(block_cache_size_mb); } void rocksdb_options_optimize_level_style_compaction( diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index e4d4f6695..c54e6707f 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -383,7 +383,7 @@ extern void rocksdb_options_destroy(rocksdb_options_t*); extern void rocksdb_options_increase_parallelism( rocksdb_options_t* opt, int total_threads); extern void rocksdb_options_optimize_for_point_lookup( - rocksdb_options_t* opt); + rocksdb_options_t* opt, uint64_t block_cache_size_mb); extern void rocksdb_options_optimize_level_style_compaction( rocksdb_options_t* opt, uint64_t memtable_memory_budget); extern void rocksdb_options_optimize_universal_style_compaction( diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index 13a0a08a1..3569409c4 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -97,7 +97,8 @@ struct ColumnFamilyOptions { // Use this if you don't need to keep the data sorted, i.e. you'll never use // an iterator, only Put() and Get() API calls - ColumnFamilyOptions* OptimizeForPointLookup(); + ColumnFamilyOptions* OptimizeForPointLookup( + uint64_t block_cache_size_mb); // Default values for some parameters in ColumnFamilyOptions are not // optimized for heavy workloads and big datasets, which means you might diff --git a/util/options.cc b/util/options.cc index 1b1615e15..b16c6f2f5 100644 --- a/util/options.cc +++ b/util/options.cc @@ -458,10 +458,14 @@ Options::PrepareForBulkLoad() } // Optimization functions -ColumnFamilyOptions* ColumnFamilyOptions::OptimizeForPointLookup() { +ColumnFamilyOptions* ColumnFamilyOptions::OptimizeForPointLookup( + uint64_t block_cache_size_mb) { prefix_extractor.reset(NewNoopTransform()); BlockBasedTableOptions block_based_options; - block_based_options.index_type = BlockBasedTableOptions::kBinarySearch; + block_based_options.index_type = BlockBasedTableOptions::kHashSearch; + block_based_options.filter_policy.reset(NewBloomFilterPolicy(10)); + block_based_options.block_cache = + NewLRUCache(block_cache_size_mb * 1024 * 1024); table_factory.reset(new BlockBasedTableFactory(block_based_options)); #ifndef ROCKSDB_LITE memtable_factory.reset(NewHashLinkListRepFactory());