aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cidstore.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-08-20 12:33:03 +0200
committerGitHub Enterprise <[email protected]>2025-08-20 12:33:03 +0200
commit4c05d1041461b630cd5770dae5e8d03147d5674b (patch)
tree3f5d6b1b4b2b3f167f94e98f902a5f60c2e3d753 /src/zenstore/cidstore.cpp
parentzen print fixes/improvements (#469) (diff)
downloadzen-4c05d1041461b630cd5770dae5e8d03147d5674b.tar.xz
zen-4c05d1041461b630cd5770dae5e8d03147d5674b.zip
per namespace/project cas prep refactor (#470)
- Refactor so we can have more than one cas store for project store and cache. - Refactor `UpstreamCacheClient` so it is not tied to a specific CidStore - Refactor scrub to keep the GC interface ScrubStorage function separate from scrub accessor functions (renamed to Scrub). - Refactor storage size to keep GC interface StorageSize function separate from size accessor functions (renamed to TotalSize) - Refactor cache storage so `ZenCacheDiskLayer::CacheBucket` implements GcStorage interface rather than `ZenCacheNamespace`
Diffstat (limited to 'src/zenstore/cidstore.cpp')
-rw-r--r--src/zenstore/cidstore.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/zenstore/cidstore.cpp b/src/zenstore/cidstore.cpp
index 2ab769d04..ae1b59dc0 100644
--- a/src/zenstore/cidstore.cpp
+++ b/src/zenstore/cidstore.cpp
@@ -127,17 +127,9 @@ struct CidStore::Impl
void Flush() { m_CasStore.Flush(); }
- void ScrubStorage(ScrubContext& Ctx)
- {
- if (Ctx.ScrubTimestamp() == m_LastScrubTime)
- {
- return;
- }
-
- m_LastScrubTime = Ctx.ScrubTimestamp();
-
- m_CasStore.ScrubStorage(Ctx);
- }
+#if ZEN_WITH_TESTS
+ void Scrub(ScrubContext& Ctx) { m_CasStore.Scrub(Ctx); }
+#endif // ZEN_WITH_TESTS
CidStoreStats Stats()
{
@@ -236,11 +228,13 @@ CidStore::Flush()
m_Impl->Flush();
}
+#if ZEN_WITH_TESTS
void
-CidStore::ScrubStorage(ScrubContext& Ctx)
+CidStore::Scrub(ScrubContext& Ctx)
{
- m_Impl->ScrubStorage(Ctx);
+ m_Impl->Scrub(Ctx);
}
+#endif // ZEN_WITH_TESTS
CidStoreSize
CidStore::TotalSize() const