Skip to content

Commit

Permalink
Revert bloom filter name extension (tikv#794)
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Zhang <[email protected]>
  • Loading branch information
v01dstar committed Aug 5, 2024
1 parent f9615d6 commit 35ebb48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions librocksdb_sys/crocksdb/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3843,9 +3843,8 @@ void crocksdb_filterpolicy_destroy(crocksdb_filterpolicy_t* filter) {
// supplied C functions.
struct FilterPolicyWrapper : public crocksdb_filterpolicy_t {
const FilterPolicy* rep_;
std::string full_name_;
~FilterPolicyWrapper() override { delete rep_; }
const char* Name() const override { return full_name_.c_str(); }
const char* Name() const override { return rep_->Name(); }
void CreateFilter(const Slice* keys, int n, std::string* dst) const override {
return rep_->CreateFilter(keys, n, dst);
}
Expand All @@ -3867,12 +3866,6 @@ crocksdb_filterpolicy_t* crocksdb_filterpolicy_create_bloom_format(
double bits_per_key, bool original_format) {
FilterPolicyWrapper* wrapper = new FilterPolicyWrapper;
wrapper->rep_ = NewBloomFilterPolicy(bits_per_key, original_format);
wrapper->full_name_ = wrapper->rep_->Name();
if (original_format) {
wrapper->full_name_ += ".BlockBloom";
} else {
wrapper->full_name_ += ".FullBloom";
}
wrapper->state_ = nullptr;
wrapper->delete_filter_ = nullptr;
wrapper->destructor_ = &FilterPolicyWrapper::DoNothing;
Expand All @@ -3894,8 +3887,6 @@ crocksdb_filterpolicy_t* crocksdb_filterpolicy_create_ribbon(
FilterPolicyWrapper* wrapper = new FilterPolicyWrapper;
wrapper->rep_ =
NewRibbonFilterPolicy(bloom_equivalent_bits_per_key, bloom_before_level);
wrapper->full_name_ = wrapper->rep_->Name();
wrapper->full_name_ += ".Ribbon";
wrapper->state_ = nullptr;
wrapper->delete_filter_ = nullptr;
wrapper->destructor_ = &FilterPolicyWrapper::DoNothing;
Expand Down
2 changes: 1 addition & 1 deletion librocksdb_sys/rocksdb

0 comments on commit 35ebb48

Please sign in to comment.