diff options
| author | Stefan Boberg <[email protected]> | 2021-10-21 18:03:41 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-21 18:03:41 +0200 |
| commit | 3e824897aed32282ec9ee297e1cfc3efc5a8d251 (patch) | |
| tree | 199d71e7314ecf7df577b4466f0d599b86c4dd08 /zenstore/filecas.cpp | |
| parent | Added IsReady flag to ZenServerEntry (diff) | |
| download | zen-3e824897aed32282ec9ee297e1cfc3efc5a8d251.tar.xz zen-3e824897aed32282ec9ee297e1cfc3efc5a8d251.zip | |
gc: Added GcStorage base class and hooked it up to CasGc
Diffstat (limited to 'zenstore/filecas.cpp')
| -rw-r--r-- | zenstore/filecas.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp index d8811de00..9cb6e5c79 100644 --- a/zenstore/filecas.cpp +++ b/zenstore/filecas.cpp @@ -14,10 +14,10 @@ #include <zencore/thread.h> #include <zencore/uid.h> #include <zenstore/basicfile.h> +#include <zenstore/gc.h> #if ZEN_WITH_TESTS # include <zencore/compactbinarybuilder.h> -# include <zenstore/gc.h> #endif #include <gsl/gsl-lite.hpp> @@ -70,7 +70,7 @@ FileCasStrategy::ShardingHelper::ShardingHelper(const std::filesystem::path& Roo ////////////////////////////////////////////////////////////////////////// -FileCasStrategy::FileCasStrategy(const CasStoreConfiguration& Config) : m_Config(Config), m_Log(logging::Get("filecas")) +FileCasStrategy::FileCasStrategy(const CasStoreConfiguration& Config, CasGc& Gc) : GcStorage(Gc), m_Config(Config), m_Log(logging::Get("filecas")) { } @@ -481,7 +481,7 @@ FileCasStrategy::Scrub(ScrubContext& Ctx) } void -FileCasStrategy::GarbageCollect(GcContext& GcCtx) +FileCasStrategy::CollectGarbage(GcContext& GcCtx) { ZEN_UNUSED(GcCtx); } @@ -497,10 +497,12 @@ TEST_CASE("cas.file.move") // specifying an absolute path here can be helpful when using procmon to dig into things ScopedTemporaryDirectory TempDir; // {"d:\\filecas_testdir"}; + CasGc Gc; + CasStoreConfiguration CasConfig; CasConfig.RootDirectory = TempDir.Path() / "cas"; - FileCasStrategy FileCas(CasConfig); + FileCasStrategy FileCas(CasConfig, Gc); { std::filesystem::path Payload1Path{TempDir.Path() / "payload_1"}; @@ -575,10 +577,12 @@ TEST_CASE("cas.file.gc") // specifying an absolute path here can be helpful when using procmon to dig into things ScopedTemporaryDirectory TempDir; // {"d:\\filecas_testdir"}; + CasGc Gc; + CasStoreConfiguration CasConfig; CasConfig.RootDirectory = TempDir.Path() / "cas"; - FileCasStrategy FileCas(CasConfig); + FileCasStrategy FileCas(CasConfig, Gc); for (int i = 0; i < 1000; ++i) { @@ -595,7 +599,7 @@ TEST_CASE("cas.file.gc") GcContext Ctx; - FileCas.GarbageCollect(Ctx); + FileCas.CollectGarbage(Ctx); } #endif |