row_cache: Introduce row_cache::touch()
Useful in tests for ensuring that certain entries survive eviction.
This commit is contained in:
@@ -196,6 +196,13 @@ future<> row_cache::update(memtable& m, partition_presence_checker presence_chec
|
||||
});
|
||||
}
|
||||
|
||||
void row_cache::touch(const dht::decorated_key& dk) {
|
||||
auto i = _partitions.find(dk, cache_entry::compare(_schema));
|
||||
if (i != _partitions.end()) {
|
||||
_tracker.touch(*i);
|
||||
}
|
||||
}
|
||||
|
||||
row_cache::row_cache(schema_ptr s, mutation_source fallback_factory, cache_tracker& tracker)
|
||||
: _tracker(tracker)
|
||||
, _schema(std::move(s))
|
||||
|
||||
@@ -150,6 +150,10 @@ public:
|
||||
// The memtable can be queried during the process, but must not be written.
|
||||
// After the update is complete, memtable is empty.
|
||||
future<> update(memtable&, partition_presence_checker underlying_negative);
|
||||
|
||||
// Moves given partition to the front of LRU if present in cache.
|
||||
void touch(const dht::decorated_key&);
|
||||
|
||||
auto num_entries() const {
|
||||
return _partitions.size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user