From db4584c37380f1826986b3acfe35bbf92693dfc6 Mon Sep 17 00:00:00 2001 From: vnugent Date: Sat, 11 Mar 2023 02:04:31 -0500 Subject: Persistant cache abstraction and runtime loading --- lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheBucket.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheBucket.cs') diff --git a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheBucket.cs b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheBucket.cs index f79db3f..6af1a20 100644 --- a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheBucket.cs +++ b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheBucket.cs @@ -29,11 +29,18 @@ using VNLib.Utils.Memory; namespace VNLib.Data.Caching.ObjectCache { + + /// + /// A concrete implementation of an + /// public sealed class BlobCacheBucket : IBlobCacheBucket { private readonly IBlobCache _cacheTable; private readonly SemaphoreSlim _lock; + /// + public uint Id { get; } + /// /// Initialzies a new and its underlying /// @@ -42,11 +49,14 @@ namespace VNLib.Data.Caching.ObjectCache /// The maxium number of entries allowed in the LRU cache /// before LRU overflow happens. /// + /// The unique id of the new bucket /// The heap to allocate object cache buffers - public BlobCacheBucket(int bucketCapacity, IUnmangedHeap heap) + /// An optional for cache persistance + public BlobCacheBucket(uint bucketId, int bucketCapacity, IUnmangedHeap heap, IPersistantCacheStore? persistantCache) { + Id = bucketId; _lock = new(1, 1); - _cacheTable = new BlobCache(bucketCapacity, heap); + _cacheTable = new BlobCache(bucketId, bucketCapacity, heap, persistantCache); } /// -- cgit