diff options
author | sdong <siying.d@fb.com> | 2015-05-28 13:48:12 -0700 |
---|---|---|
committer | sdong <siying.d@fb.com> | 2015-06-01 18:21:14 -0700 |
commit | 4266d4fd904f7999f302883e0d8da9538842c957 (patch) | |
tree | d5bed3c5ba4c0dea81ac6e97797d2ee75213c377 /include | |
parent | d333820badb379666719d2511f8354a6c5fad5ae (diff) |
Allow users to migrate to options.level_compaction_dynamic_level_bytes=true using CompactRange()
Summary: In DB::CompactRange(), change parameter "reduce_level" to "change_level". Users can compact all data to the last level if needed. By doing it, users can migrate the DB to options.level_compaction_dynamic_level_bytes=true.
Test Plan: Add a unit test for it.
Reviewers: yhchiang, anthony, kradhakrishnan, igor, rven
Reviewed By: rven
Subscribers: leveldb, dhruba
Differential Revision: https://reviews.facebook.net/D39099
Diffstat (limited to 'include')
-rw-r--r-- | include/rocksdb/db.h | 10 | ||||
-rw-r--r-- | include/rocksdb/utilities/stackable_db.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/include/rocksdb/db.h b/include/rocksdb/db.h index 346870674..f9188e051 100644 --- a/include/rocksdb/db.h +++ b/include/rocksdb/db.h @@ -417,20 +417,20 @@ class DB { // Note that after the entire database is compacted, all data are pushed // down to the last level containing any data. If the total data size // after compaction is reduced, that level might not be appropriate for - // hosting all the files. In this case, client could set reduce_level + // hosting all the files. In this case, client could set change_level // to true, to move the files back to the minimum level capable of holding // the data set or a given level (specified by non-negative target_level). // Compaction outputs should be placed in options.db_paths[target_path_id]. // Behavior is undefined if target_path_id is out of range. virtual Status CompactRange(ColumnFamilyHandle* column_family, const Slice* begin, const Slice* end, - bool reduce_level = false, int target_level = -1, + bool change_level = false, int target_level = -1, uint32_t target_path_id = 0) = 0; virtual Status CompactRange(const Slice* begin, const Slice* end, - bool reduce_level = false, int target_level = -1, + bool change_level = false, int target_level = -1, uint32_t target_path_id = 0) { - return CompactRange(DefaultColumnFamily(), begin, end, reduce_level, - target_level, target_path_id); + return CompactRange(DefaultColumnFamily(), begin, end, change_level, + change_level, target_path_id); } virtual Status SetOptions(ColumnFamilyHandle* column_family, const std::unordered_map<std::string, std::string>& new_options) { diff --git a/include/rocksdb/utilities/stackable_db.h b/include/rocksdb/utilities/stackable_db.h index 86d5bdea6..2a7f8e64a 100644 --- a/include/rocksdb/utilities/stackable_db.h +++ b/include/rocksdb/utilities/stackable_db.h @@ -129,9 +129,9 @@ class StackableDB : public DB { using DB::CompactRange; virtual Status CompactRange(ColumnFamilyHandle* column_family, const Slice* begin, const Slice* end, - bool reduce_level = false, int target_level = -1, + bool change_level = false, int target_level = -1, uint32_t target_path_id = 0) override { - return db_->CompactRange(column_family, begin, end, reduce_level, + return db_->CompactRange(column_family, begin, end, change_level, target_level, target_path_id); } |