|
|
@ -2549,12 +2549,13 @@ class DeleteFilter : public CompactionFilter { |
|
|
|
|
|
|
|
|
|
|
|
class ChangeFilter : public CompactionFilter { |
|
|
|
class ChangeFilter : public CompactionFilter { |
|
|
|
public: |
|
|
|
public: |
|
|
|
explicit ChangeFilter(int argv) : argv_(argv) {} |
|
|
|
explicit ChangeFilter(int argv) { |
|
|
|
|
|
|
|
assert(argv == 100); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
virtual bool Filter(int level, const Slice& key, |
|
|
|
virtual bool Filter(int level, const Slice& key, |
|
|
|
const Slice& value, std::string* new_value, |
|
|
|
const Slice& value, std::string* new_value, |
|
|
|
bool* value_changed) const override { |
|
|
|
bool* value_changed) const override { |
|
|
|
assert(argv_ == 100); |
|
|
|
|
|
|
|
assert(new_value != nullptr); |
|
|
|
assert(new_value != nullptr); |
|
|
|
*new_value = NEW_VALUE; |
|
|
|
*new_value = NEW_VALUE; |
|
|
|
*value_changed = true; |
|
|
|
*value_changed = true; |
|
|
@ -2564,9 +2565,6 @@ class ChangeFilter : public CompactionFilter { |
|
|
|
virtual const char* Name() const override { |
|
|
|
virtual const char* Name() const override { |
|
|
|
return "ChangeFilter"; |
|
|
|
return "ChangeFilter"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
|
|
|
const int argv_; |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class KeepFilterFactory : public CompactionFilterFactory { |
|
|
|
class KeepFilterFactory : public CompactionFilterFactory { |
|
|
|