aboutsummaryrefslogtreecommitdiff
path: root/zenstore/gc.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-12-01 16:17:30 +0100
committerPer Larsson <[email protected]>2021-12-01 16:17:30 +0100
commit9045ebeb0f1bf4290013749482a8ee8f9c007088 (patch)
treeb9f7345ea400e8e8c3d1d493dd23299442593cb6 /zenstore/gc.cpp
parentAdded CacheStore and CAS store sizes to status endpoint. (diff)
downloadzen-9045ebeb0f1bf4290013749482a8ee8f9c007088.tar.xz
zen-9045ebeb0f1bf4290013749482a8ee8f9c007088.zip
Added naive container CAS GC support.
Diffstat (limited to 'zenstore/gc.cpp')
-rw-r--r--zenstore/gc.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp
index 5c2ee2daa..1b987ca08 100644
--- a/zenstore/gc.cpp
+++ b/zenstore/gc.cpp
@@ -16,7 +16,8 @@ struct GcContext::GcState
{
CasChunkSet m_CasChunks;
CasChunkSet m_CidChunks;
- bool m_DeletionMode = true;
+ bool m_DeletionMode = true;
+ bool m_ContainerGcEnabled = false;
};
GcContext::GcContext() : m_State(std::make_unique<GcState>())
@@ -62,12 +63,25 @@ GcContext::IsDeletionMode() const
{
return m_State->m_DeletionMode;
}
+
void
GcContext::SetDeletionMode(bool NewState)
{
m_State->m_DeletionMode = NewState;
}
+bool
+GcContext::IsContainerGcEnabled() const
+{
+ return m_State->m_ContainerGcEnabled;
+}
+
+void
+GcContext::SetContainerGcEnabled(bool NewState)
+{
+ m_State->m_ContainerGcEnabled = NewState;
+}
+
//////////////////////////////////////////////////////////////////////////
GcContributor::GcContributor(CasGc& Gc) : m_Gc(Gc)
@@ -139,6 +153,7 @@ CasGc::CollectGarbage()
GcContext GcCtx;
GcCtx.SetDeletionMode(true);
+ GcCtx.SetContainerGcEnabled(false);
for (GcContributor* Contributor : m_GcContribs)
{