Skip to content

Commit b47812f

Browse files
committed
[rocksdb] new CompactionFilterV2 API
Summary: This diff adds a new CompactionFilterV2 API that roll up the decisions of kv pairs during compactions. These kv pairs must share the same key prefix. They are buffered inside the db. typedef std::vector<Slice> SliceVector; virtual std::vector<bool> Filter(int level, const SliceVector& keys, const SliceVector& existing_values, std::vector<std::string>* new_values, std::vector<bool>* values_changed ) const = 0; Application can override the Filter() function to operate on the buffered kv pairs. More details in the inline documentation. Test Plan: make check. Added unit tests to make sure Keep, Delete, Change all works. Reviewers: haobo CCs: leveldb Differential Revision: https://reviews.facebook.net/D15087
1 parent cda4006 commit b47812f

12 files changed

+850
-94
lines changed

HISTORY.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
* Added Env::GetThreadPoolQueueLen(), which returns the waiting queue length of thread pools
1616
* Added a command "checkconsistency" in ldb tool, which checks
1717
if file system state matches DB state (file existence and file sizes)
18+
* CompactionFilter::Context is now CompactionFilterContext. It is shared by CompactionFilter and CompactionFilterV2
1819

1920
### New Features
2021
* If we find one truncated record at the end of the MANIFEST or WAL files,
2122
we will ignore it. We assume that writers of these records were interrupted
2223
and that we can safely ignore it.
24+
* Now compaction filter has a V2 interface. It buffers the kv-pairs sharing the same key prefix, process them in batches, and return the batched results back to DB.
2325

2426
## 2.7.0 (01/28/2014)
2527

0 commit comments

Comments
 (0)