diff options
| author | Per Larsson <[email protected]> | 2021-12-10 15:29:18 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-12-10 15:29:18 +0100 |
| commit | 370d0134a7f755b1e39fbba5c9482ecc9ff3a0fe (patch) | |
| tree | 7329dc070434ccc265be6a7651274366d8c9fc06 /zenserver/cache/structuredcachestore.h | |
| parent | Set GC default enabled and interval set to zero (off). (diff) | |
| download | zen-370d0134a7f755b1e39fbba5c9482ecc9ff3a0fe.tar.xz zen-370d0134a7f755b1e39fbba5c9482ecc9ff3a0fe.zip | |
Added size to GcStorage.
Diffstat (limited to 'zenserver/cache/structuredcachestore.h')
| -rw-r--r-- | zenserver/cache/structuredcachestore.h | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/zenserver/cache/structuredcachestore.h b/zenserver/cache/structuredcachestore.h index 437d06267..14670f88d 100644 --- a/zenserver/cache/structuredcachestore.h +++ b/zenserver/cache/structuredcachestore.h @@ -143,27 +143,21 @@ private: ZenCacheDiskLayer& operator=(const ZenCacheDiskLayer&) = delete; }; -struct ZenCacheSize -{ - uint64_t MemorySize{}; - uint64_t DiskSize{}; -}; - -class ZenCacheStore : public GcStorage, public GcContributor +class ZenCacheStore final : public GcStorage, public GcContributor { public: ZenCacheStore(CasGc& Gc, const std::filesystem::path& RootDir); ~ZenCacheStore(); - 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 Flush(); - void Scrub(ScrubContext& Ctx); - virtual void GatherReferences(GcContext& GcCtx) override; - virtual void CollectGarbage(GcContext& GcCtx) override; - ZenCacheSize TotalSize() const; - uint64_t DiskLayerThreshold() const { return m_DiskLayerSizeThreshold; } + 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 Flush(); + void Scrub(ScrubContext& Ctx); + uint64_t DiskLayerThreshold() const { return m_DiskLayerSizeThreshold; } + virtual void GatherReferences(GcContext& GcCtx) override; + virtual void CollectGarbage(GcContext& GcCtx) override; + virtual GcStorageSize StorageSize() const override; private: std::filesystem::path m_RootDir; |