From ab86012c66f61c1d1e3b6251d8c59504abe1c529 Mon Sep 17 00:00:00 2001 From: Yuchen Wu Date: Fri, 8 Mar 2024 02:02:23 -0800 Subject: TinyUFO: add the option to use sharded skip list for storage This option makes it more memory efficient but a bit slower. --- pingora-memory-cache/src/lib.rs | 2 +- pingora-memory-cache/src/read_through.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'pingora-memory-cache') diff --git a/pingora-memory-cache/src/lib.rs b/pingora-memory-cache/src/lib.rs index f5c037c..2b02d28 100644 --- a/pingora-memory-cache/src/lib.rs +++ b/pingora-memory-cache/src/lib.rs @@ -81,7 +81,7 @@ pub struct MemoryCache { pub(crate) hasher: RandomState, } -impl MemoryCache { +impl MemoryCache { /// Create a new [MemoryCache] with the given size. pub fn new(size: usize) -> Self { MemoryCache { diff --git a/pingora-memory-cache/src/read_through.rs b/pingora-memory-cache/src/read_through.rs index 05a8d89..a10a7c0 100644 --- a/pingora-memory-cache/src/read_through.rs +++ b/pingora-memory-cache/src/read_through.rs @@ -123,7 +123,7 @@ where impl RTCache where K: Hash + Send, - T: Clone + Send + Sync, + T: Clone + Send + Sync + 'static, { /// Create a new [RTCache] of given size. `lock_age` defines how long a lock is valid for. /// `lock_timeout` is used to stop a lookup from holding on to the key for too long. @@ -142,7 +142,7 @@ where impl RTCache where K: Hash + Send, - T: Clone + Send + Sync, + T: Clone + Send + Sync + 'static, CB: Lookup, { /// Query the cache for a given value. If it exists and no TTL is configured initially, it will @@ -288,7 +288,7 @@ where impl RTCache where K: Hash + Send, - T: Clone + Send + Sync, + T: Clone + Send + Sync + 'static, CB: MultiLookup, { /// Same behavior as [RTCache::get] but for an arbitrary amount of keys. -- cgit v1.2.3