From 14d7568f9c7d970b7bbf7b6463a0a8530f98bb6f Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 20 Sep 2023 15:22:03 +0200 Subject: VFS implementation for local storage service (#396) currently, only Windows (using Projected File System) is supported --- src/zenserver/cache/structuredcachestore.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/zenserver/cache/structuredcachestore.h') diff --git a/src/zenserver/cache/structuredcachestore.h b/src/zenserver/cache/structuredcachestore.h index 8c1f995a4..239efe68f 100644 --- a/src/zenserver/cache/structuredcachestore.h +++ b/src/zenserver/cache/structuredcachestore.h @@ -69,10 +69,14 @@ public: ZenCacheNamespace(GcManager& Gc, const std::filesystem::path& RootDir); ~ZenCacheNamespace(); - bool Get(std::string_view Bucket, const IoHash& HashKey, ZenCacheValue& OutValue); - void Put(std::string_view Bucket, const IoHash& HashKey, const ZenCacheValue& Value); + bool Get(std::string_view Bucket, const IoHash& HashKey, ZenCacheValue& OutValue); + void Put(std::string_view Bucket, const IoHash& HashKey, const ZenCacheValue& Value); + + bool DropBucket(std::string_view Bucket); + void EnumerateBucketContents(std::string_view Bucket, + std::function& Fn) const; + bool Drop(); - bool DropBucket(std::string_view Bucket); void Flush(); uint64_t DiskLayerThreshold() const { return m_DiskLayerSizeThreshold; } @@ -160,6 +164,10 @@ public: std::optional GetBucketInfo(std::string_view Namespace, std::string_view Bucket); std::vector GetNamespaces(); + void EnumerateBucketContents(std::string_view Namespace, + std::string_view Bucket, + std::function&& Fn); + private: const ZenCacheNamespace* FindNamespace(std::string_view Namespace) const; ZenCacheNamespace* GetNamespace(std::string_view Namespace); -- cgit v1.2.3