diff options
| author | Zousar Shaker <[email protected]> | 2024-12-06 21:47:11 -0700 |
|---|---|---|
| committer | Zousar Shaker <[email protected]> | 2024-12-06 21:47:11 -0700 |
| commit | 5688fa8f46fe3cd32f283adcc590e447174c58a8 (patch) | |
| tree | dccaef1a87cf454639f45e330732221ce4eb1712 /src/zenstore/filecas.cpp | |
| parent | changelog (diff) | |
| parent | 5.5.16-pre0 (diff) | |
| download | zen-zs/xrepo.tar.xz zen-zs/xrepo.zip | |
Merge branch 'main' into zs/xrepozs/xrepo
Diffstat (limited to 'src/zenstore/filecas.cpp')
| -rw-r--r-- | src/zenstore/filecas.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp index 339e5de0a..82dbe3551 100644 --- a/src/zenstore/filecas.cpp +++ b/src/zenstore/filecas.cpp @@ -57,16 +57,14 @@ GetFileCasTag() return _; } -namespace { +namespace filecas::impl { template<typename T> void Reset(T& V) { T Tmp; V.swap(Tmp); } -} // namespace -namespace filecas::impl { const char* IndexExtension = ".uidx"; const char* LogExtension = ".ulog"; @@ -141,11 +139,11 @@ FileCasStrategy::ShardingHelper::ShardingHelper(const std::filesystem::path& Roo ////////////////////////////////////////////////////////////////////////// -static const float IndexMinLoadFactor = 0.2f; -static const float IndexMaxLoadFactor = 0.7f; - FileCasStrategy::FileCasStrategy(GcManager& Gc) : m_Log(logging::Get("filecas")), m_Gc(Gc) { + static const float IndexMinLoadFactor = 0.2f; + static const float IndexMaxLoadFactor = 0.7f; + m_Index.min_load_factor(IndexMinLoadFactor); m_Index.max_load_factor(IndexMaxLoadFactor); @@ -1237,7 +1235,7 @@ public: Stopwatch Timer; const auto _ = MakeGuard([&] { - Reset(m_ReferencesToClean); + filecas::impl::Reset(m_ReferencesToClean); if (!Ctx.Settings.Verbose) { return; @@ -1353,7 +1351,7 @@ public: } } - Reset(m_ReferencesToClean); + filecas::impl::Reset(m_ReferencesToClean); } virtual std::string GetGcName(GcCtx& Ctx) override { return m_FileCasStrategy.GetGcName(Ctx); } |