mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 02:15:45 +02:00
feat(lru): add generic lru class (#2351)
Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
parent
a1d85b7cb2
commit
014a86fc88
11 changed files with 388 additions and 220 deletions
|
@ -179,7 +179,7 @@ class PrimeEvictionPolicy {
|
|||
|
||||
class PrimeBumpPolicy {
|
||||
public:
|
||||
PrimeBumpPolicy(const absl::flat_hash_set<CompactObjectView, PrimeHasher>& bumped_items)
|
||||
PrimeBumpPolicy(const absl::flat_hash_set<CompactObjectView>& bumped_items)
|
||||
: bumped_items_(bumped_items) {
|
||||
}
|
||||
// returns true if key can be made less important for eviction (opposite of bump up)
|
||||
|
@ -188,7 +188,7 @@ class PrimeBumpPolicy {
|
|||
}
|
||||
|
||||
private:
|
||||
const absl::flat_hash_set<CompactObjectView, PrimeHasher>& bumped_items_;
|
||||
const absl::flat_hash_set<CompactObjectView>& bumped_items_;
|
||||
};
|
||||
|
||||
bool PrimeEvictionPolicy::CanGrow(const PrimeTable& tbl) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue