Skip to content

Commit

Permalink
Add dump all keys for cache dumper impl
Browse files Browse the repository at this point in the history
  • Loading branch information
lhsoft committed Apr 12, 2024
1 parent ee3159e commit 1841523
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions unreleased_history/behavior_changes/dump_all_keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dump all keys for cache dumper impl if `SetDumpFilter()` is not called
3 changes: 2 additions & 1 deletion utilities/cache_dump_load_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace ROCKSDB_NAMESPACE {
// requirement.
Status CacheDumperImpl::SetDumpFilter(std::vector<DB*> db_list) {
Status s = Status::OK();
dump_all_keys_ = false;
for (size_t i = 0; i < db_list.size(); i++) {
assert(i < db_list.size());
TablePropertiesCollection ptc;
Expand Down Expand Up @@ -140,7 +141,7 @@ CacheDumperImpl::DumpOneBlockCallBack(std::string& buf) {
}

// based on the key prefix, check if the block should be filter out.
if (ShouldFilterOut(key)) {
if (!dump_all_keys_ && ShouldFilterOut(key)) {
return;
}

Expand Down
2 changes: 2 additions & 0 deletions utilities/cache_dump_load_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class CacheDumperImpl : public CacheDumper {
// improvement can be applied like BloomFilter or others to speedup the
// filtering.
std::set<std::string> prefix_filter_;
// dump all keys of cache if user doesn't call SetDumpFilter
bool dump_all_keys_ = true;
};

// The default implementation of CacheDumpedLoader
Expand Down

0 comments on commit 1841523

Please sign in to comment.