aboutsummaryrefslogtreecommitdiff
path: root/zenstore/compactcas.h
diff options
context:
space:
mode:
Diffstat (limited to 'zenstore/compactcas.h')
-rw-r--r--zenstore/compactcas.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/zenstore/compactcas.h b/zenstore/compactcas.h
index 114a6a48c..2acac7ca3 100644
--- a/zenstore/compactcas.h
+++ b/zenstore/compactcas.h
@@ -4,10 +4,11 @@
#include <zencore/zencore.h>
#include <zenstore/blockstore.h>
-#include <zenstore/cas.h>
#include <zenstore/caslog.h>
#include <zenstore/gc.h>
+#include "cas.h"
+
#include <atomic>
#include <limits>
#include <unordered_map>
@@ -47,14 +48,18 @@ static_assert(sizeof(CasDiskIndexEntry) == 32);
struct CasContainerStrategy final : public GcStorage
{
- CasContainerStrategy(const CasStoreConfiguration& Config, CasGc& Gc);
+ CasContainerStrategy(GcManager& Gc);
~CasContainerStrategy();
CasStore::InsertResult InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash);
IoBuffer FindChunk(const IoHash& ChunkHash);
bool HaveChunk(const IoHash& ChunkHash);
- void FilterChunks(CasChunkSet& InOutChunks);
- void Initialize(const std::string_view ContainerBaseName, uint32_t MaxBlockSize, uint64_t Alignment, bool IsNewStore);
+ void FilterChunks(HashKeySet& InOutChunks);
+ void Initialize(const std::filesystem::path& RootDirectory,
+ const std::string_view ContainerBaseName,
+ uint32_t MaxBlockSize,
+ uint64_t Alignment,
+ bool IsNewStore);
void Flush();
void Scrub(ScrubContext& Ctx);
virtual void CollectGarbage(GcContext& GcCtx) override;
@@ -65,12 +70,11 @@ private:
void MakeIndexSnapshot();
uint64_t ReadIndexFile();
uint64_t ReadLog(uint64_t SkipEntryCount);
- uint64_t MigrateLegacyData(bool CleanSource);
void OpenContainer(bool IsNewStore);
spdlog::logger& Log() { return m_Log; }
- const CasStoreConfiguration& m_Config;
+ std::filesystem::path m_RootDirectory;
spdlog::logger& m_Log;
uint64_t m_PayloadAlignment = 1u << 4;
uint64_t m_MaxBlockSize = 1u << 28;