aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-05-09 14:50:41 +0200
committerGitHub <[email protected]>2023-05-09 14:50:41 +0200
commit12058b79d7ba17902b90c3e777b10a8c4403fe5e (patch)
treef776799cb817d8723e799dc1189bc12e5cca5ab4 /src/zenstore/include
parentimplemented thread-local activity tracking (diff)
downloadzen-12058b79d7ba17902b90c3e777b10a8c4403fe5e.tar.xz
zen-12058b79d7ba17902b90c3e777b10a8c4403fe5e.zip
Validate that entries points inside valid blocks at startup (#280)
* Separate initialization of block store from pruning of unknown blocks * Validate that entries points inside valid blocks
Diffstat (limited to 'src/zenstore/include')
-rw-r--r--src/zenstore/include/zenstore/blockstore.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/zenstore/include/zenstore/blockstore.h b/src/zenstore/include/zenstore/blockstore.h
index 857ccae38..738510cac 100644
--- a/src/zenstore/include/zenstore/blockstore.h
+++ b/src/zenstore/include/zenstore/blockstore.h
@@ -124,10 +124,11 @@ public:
typedef std::function<void(size_t ChunkIndex, BlockStoreFile& File, uint64_t Offset, uint64_t Size)> IterateChunksLargeSizeCallback;
typedef std::function<void(const BlockStoreLocation& Location)> WriteChunkCallback;
- void Initialize(const std::filesystem::path& BlocksBasePath,
- uint64_t MaxBlockSize,
- uint64_t MaxBlockCount,
- const std::vector<BlockStoreLocation>& KnownLocations);
+ std::unordered_map<uint32_t, uint64_t> Initialize(const std::filesystem::path& BlocksBasePath,
+ uint64_t MaxBlockSize,
+ uint64_t MaxBlockCount);
+
+ void Prune(const std::vector<BlockStoreLocation>& KnownLocations);
void Close();
void WriteChunk(const void* Data, uint64_t Size, uint64_t Alignment, const WriteChunkCallback& Callback);