diff --git a/database.cc b/database.cc index 1c2e488d00..a84b4d85c3 100644 --- a/database.cc +++ b/database.cc @@ -146,8 +146,9 @@ column_family::make_partition_presence_checker(lw_shared_ptrfilter_has_key(*_schema, key.key())) { + if (s->filter_has_key(hk)) { return partition_presence_checker_result::maybe_exists; } } diff --git a/sstables/sstables.cc b/sstables/sstables.cc index b46c9ccb48..0760df9df4 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -2627,6 +2627,10 @@ sstable::get_shards_for_this_sstable() const { return boost::copy_range>(shards); } +utils::hashed_key sstable::make_hashed_key(const schema& s, const partition_key& key) { + return utils::make_hashed_key(static_cast(key::from_partition_key(s, key))); +} + std::ostream& operator<<(std::ostream& os, const sstable_to_delete& std) { return os << std.name << "(" << (std.shared ? "shared" : "unshared") << ")"; diff --git a/sstables/sstables.hh b/sstables/sstables.hh index 8fdcd3c9e0..749476280d 100644 --- a/sstables/sstables.hh +++ b/sstables/sstables.hh @@ -607,10 +607,16 @@ public: return _filter->is_present(bytes_view(key)); } + bool filter_has_key(utils::hashed_key key) { + return _filter->is_present(key); + } + bool filter_has_key(const schema& s, partition_key_view key) { return filter_has_key(key::from_partition_key(s, key)); } + static utils::hashed_key make_hashed_key(const schema& s, const partition_key& key); + uint64_t filter_get_false_positive() { return _filter_tracker.false_positive; }