diff options
| author | Per Larsson <[email protected]> | 2021-12-01 16:17:30 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-12-01 16:17:30 +0100 |
| commit | 9045ebeb0f1bf4290013749482a8ee8f9c007088 (patch) | |
| tree | b9f7345ea400e8e8c3d1d493dd23299442593cb6 /zenstore/gc.cpp | |
| parent | Added CacheStore and CAS store sizes to status endpoint. (diff) | |
| download | zen-9045ebeb0f1bf4290013749482a8ee8f9c007088.tar.xz zen-9045ebeb0f1bf4290013749482a8ee8f9c007088.zip | |
Added naive container CAS GC support.
Diffstat (limited to 'zenstore/gc.cpp')
| -rw-r--r-- | zenstore/gc.cpp | 17 |
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) { |