diff options
author | Yanqin Jin <yanqin@fb.com> | 2020-11-12 11:40:52 -0800 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2020-11-12 11:43:24 -0800 |
commit | cf9d8e45c08dee5b6d607c71078a225d4af26a21 (patch) | |
tree | 1fcf5ae57f805880fe79fa8ffe482a448f9c1bcd /table | |
parent | 0dc437d65cefd6119cac0162b8bf381312928d04 (diff) |
Add full_history_ts_low_ to CompactionJob (#7657)
Summary:
https://github.com/facebook/rocksdb/issues/7556 enables `CompactionIterator` to perform garbage collection during compaction according
to a lower bound (user-defined) timestamp `full_history_ts_low_`.
This PR adds a data member `full_history_ts_low_` of type `std::string` to `CompactionJob`, and
`full_history_ts_low_` does not change during compaction. `CompactionJob` will pass a pointer to this
data member to the `CompactionIterator` used during compaction.
Also refactored compaction_job_test.cc to re-use some existing code, which is actually the majority of this PR.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/7657
Test Plan: make check
Reviewed By: ltamasi
Differential Revision: D24913803
Pulled By: riversand963
fbshipit-source-id: 11ad5329ddac365667152e7b3b02f84182c0ca8e
Diffstat (limited to 'table')
-rw-r--r-- | table/mock_table.cc | 4 | ||||
-rw-r--r-- | table/mock_table.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/table/mock_table.cc b/table/mock_table.cc index c8a19a076..117639df1 100644 --- a/table/mock_table.cc +++ b/table/mock_table.cc @@ -18,8 +18,8 @@ namespace mock { KVVector MakeMockFile(std::initializer_list<KVPair> l) { return KVVector(l); } -void SortKVVector(KVVector* kv_vector) { - InternalKeyComparator icmp(BytewiseComparator()); +void SortKVVector(KVVector* kv_vector, const Comparator* ucmp) { + InternalKeyComparator icmp(ucmp); std::sort(kv_vector->begin(), kv_vector->end(), [icmp](KVPair a, KVPair b) -> bool { return icmp.Compare(a.first, b.first) < 0; diff --git a/table/mock_table.h b/table/mock_table.h index 0ab9674d6..4c57bee82 100644 --- a/table/mock_table.h +++ b/table/mock_table.h @@ -31,7 +31,8 @@ using KVPair = std::pair<std::string, std::string>; using KVVector = std::vector<KVPair>; KVVector MakeMockFile(std::initializer_list<KVPair> l = {}); -void SortKVVector(KVVector* kv_vector); +void SortKVVector(KVVector* kv_vector, + const Comparator* ucmp = BytewiseComparator()); struct MockTableFileSystem { port::Mutex mutex; |