aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-10-20 11:02:26 +0200
committerGitHub <[email protected]>2023-10-20 11:02:26 +0200
commit57f054be2f4f68d0d52631838655a45855c33655 (patch)
tree4a768d8eee548c1c4c002388e48da3d62850dc02 /src/zenserver/cache
parentAdd --skip-delete option to gc command (#484) (diff)
downloadzen-57f054be2f4f68d0d52631838655a45855c33655.tar.xz
zen-57f054be2f4f68d0d52631838655a45855c33655.zip
clean up GcContributor and GcStorage to be pure interfaces (#485)
Diffstat (limited to 'src/zenserver/cache')
-rw-r--r--src/zenserver/cache/structuredcachestore.cpp8
-rw-r--r--src/zenserver/cache/structuredcachestore.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/src/zenserver/cache/structuredcachestore.cpp b/src/zenserver/cache/structuredcachestore.cpp
index 05b4c2e58..786053adc 100644
--- a/src/zenserver/cache/structuredcachestore.cpp
+++ b/src/zenserver/cache/structuredcachestore.cpp
@@ -63,8 +63,7 @@ ZenCacheNamespace::ZenCacheNamespace(GcManager& Gc,
const std::filesystem::path& RootDir,
bool EnableReferenceCaching,
const ZenCacheMemoryLayer::Configuration MemLayerConfig)
-: GcStorage(Gc)
-, GcContributor(Gc)
+: m_Gc(Gc)
, m_RootDir(RootDir)
, m_JobQueue(JobQueue)
, m_MemLayer(m_JobQueue, MemLayerConfig)
@@ -74,10 +73,15 @@ ZenCacheNamespace::ZenCacheNamespace(GcManager& Gc,
CreateDirectories(RootDir);
m_DiskLayer.DiscoverBuckets();
+
+ m_Gc.AddGcContributor(this);
+ m_Gc.AddGcStorage(this);
}
ZenCacheNamespace::~ZenCacheNamespace()
{
+ m_Gc.RemoveGcStorage(this);
+ m_Gc.RemoveGcContributor(this);
}
bool
diff --git a/src/zenserver/cache/structuredcachestore.h b/src/zenserver/cache/structuredcachestore.h
index c67b23e93..28b2189ae 100644
--- a/src/zenserver/cache/structuredcachestore.h
+++ b/src/zenserver/cache/structuredcachestore.h
@@ -112,6 +112,7 @@ public:
CacheValueDetails::NamespaceDetails GetValueDetails(const std::string_view BucketFilter, const std::string_view ValueFilter) const;
private:
+ GcManager& m_Gc;
std::filesystem::path m_RootDir;
JobQueue& m_JobQueue;
ZenCacheMemoryLayer m_MemLayer;