diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-01 23:38:59 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-05-01 23:40:23 +0200 |
| commit | b5f5b1e792a559d0358ab8a755b335cfb2185e9f (patch) | |
| tree | caaa207cd78cd0dc309d81d558fcb74b3433c1c0 /zenstore/include | |
| parent | respect Ctx.RunRecovery() (diff) | |
| download | zen-b5f5b1e792a559d0358ab8a755b335cfb2185e9f.tar.xz zen-b5f5b1e792a559d0358ab8a755b335cfb2185e9f.zip | |
cleanup
Diffstat (limited to 'zenstore/include')
| -rw-r--r-- | zenstore/include/zenstore/blockstore.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/zenstore/include/zenstore/blockstore.h b/zenstore/include/zenstore/blockstore.h index 5af416b59..21c02d389 100644 --- a/zenstore/include/zenstore/blockstore.h +++ b/zenstore/include/zenstore/blockstore.h @@ -6,6 +6,7 @@ #include <zencore/zencore.h> #include <zenstore/basicfile.h> +#include <unordered_map> #include <unordered_set> namespace zen { @@ -119,18 +120,20 @@ public: typedef std::function<void(uint32_t BlockIndex, const std::unordered_map<size_t, BlockStoreLocation>& MovedChunks, const std::vector<size_t>& RemovedChunks)> - ReclaimCallback; - typedef std::function<void(const BlockStoreLocation& Location)> WriteCompleteCallback; + ReclaimCallback; + typedef std::function<void(const BlockStoreLocation& Location)> WriteChunkCallback; + typedef std::function<void(size_t ChunkIndex, const void* Data, uint64_t Size)> IterateChunksSmallSizeCallback; + typedef std::function<void(size_t ChunkIndex, BasicFile& BlockFile, uint64_t Offset, uint64_t Size)> IterateChunksLargeSizeCallback; void Initialize(const std::filesystem::path& BlocksBasePath, uint64_t MaxBlockSize, uint64_t MaxBlockCount, const std::vector<BlockStoreLocation>& KnownLocations); void WriteChunk( - const void* Data, - uint64_t Size, - uint64_t Alignment, - WriteCompleteCallback Callback = [](const BlockStoreLocation&) {}); + const void* Data, + uint64_t Size, + uint64_t Alignment, + WriteChunkCallback Callback = [](const BlockStoreLocation&) {}); Ref<BlockStoreFile> GetChunkBlock(const BlockStoreLocation& Location); void Flush(); @@ -143,9 +146,9 @@ public: bool DryRun, const ReclaimCallback& Callback = [](uint32_t, const std::unordered_map<size_t, BlockStoreLocation>&, const std::vector<size_t>&) { }); - void IterateChunks(const std::vector<BlockStoreLocation>& ChunkLocations, - std::function<void(size_t ChunkIndex, const void* Data, uint64_t Size)> SmallChunkCallback, - std::function<void(size_t ChunkIndex, BasicFile& BlockFile, uint64_t Offset, uint64_t Size)> LargeChunkCallback); + void IterateChunks(const std::vector<BlockStoreLocation>& ChunkLocations, + IterateChunksSmallSizeCallback SmallSizeCallback, + IterateChunksLargeSizeCallback LargeSizeCallback); static const char* GetBlockFileExtension(); static std::filesystem::path GetBlockPath(const std::filesystem::path& BlocksBasePath, const uint32_t BlockIndex); |