aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.h
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-12-07 16:22:56 +0100
committerPer Larsson <[email protected]>2021-12-07 16:22:56 +0100
commit431c3f739b44f84470b54c57a00f89485caed901 (patch)
tree997d9a154790786ffa5d24d4aec46972c8fb099f /zenserver/cache/structuredcachestore.h
parentAdded support for time based eviction policy in structured cache. (diff)
downloadzen-431c3f739b44f84470b54c57a00f89485caed901.tar.xz
zen-431c3f739b44f84470b54c57a00f89485caed901.zip
First pass of z$ garbage collection.
Diffstat (limited to 'zenserver/cache/structuredcachestore.h')
-rw-r--r--zenserver/cache/structuredcachestore.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/zenserver/cache/structuredcachestore.h b/zenserver/cache/structuredcachestore.h
index afec8542f..1da789f53 100644
--- a/zenserver/cache/structuredcachestore.h
+++ b/zenserver/cache/structuredcachestore.h
@@ -68,6 +68,7 @@ public:
bool DropBucket(std::string_view Bucket);
void Scrub(ScrubContext& Ctx);
void GatherReferences(GcContext& GcCtx);
+ void CollectGarbage(GcContext& GcCtx);
uint64_t TotalSize() const;
struct Configuration
@@ -121,6 +122,7 @@ public:
void Flush();
void Scrub(ScrubContext& Ctx);
void GatherReferences(GcContext& GcCtx);
+ void CollectGarbage(GcContext& GcCtx);
void DiscoverBuckets();
uint64_t TotalSize() const;
@@ -145,7 +147,7 @@ struct ZenCacheSize
uint64_t DiskSize{};
};
-class ZenCacheStore : public GcContributor
+class ZenCacheStore : public GcStorage, public GcContributor
{
public:
ZenCacheStore(CasGc& Gc, const std::filesystem::path& RootDir);
@@ -157,6 +159,7 @@ public:
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; }