diff options
| author | Dan Engelbrecht <[email protected]> | 2023-05-09 14:50:41 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-09 14:50:41 +0200 |
| commit | 12058b79d7ba17902b90c3e777b10a8c4403fe5e (patch) | |
| tree | f776799cb817d8723e799dc1189bc12e5cca5ab4 /src/zenstore/include | |
| parent | implemented thread-local activity tracking (diff) | |
| download | zen-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.h | 9 |
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); |