aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-04-24 13:53:54 +0200
committerGitHub Enterprise <[email protected]>2024-04-24 13:53:54 +0200
commit1c0ddc112a6c18d411f1f3ae6d236ecc2bedcfaa (patch)
treecfafeecb830a44a6d0870a217edabcc62d37669c /src/zenstore/include
parentremove obsolete code (diff)
downloadzen-1c0ddc112a6c18d411f1f3ae6d236ecc2bedcfaa.tar.xz
zen-1c0ddc112a6c18d411f1f3ae6d236ecc2bedcfaa.zip
iterate cas chunks (#59)
- Improvement: Reworked GetChunkInfos in oplog store to reduce disk thrashing and improve performance
Diffstat (limited to 'src/zenstore/include')
-rw-r--r--src/zenstore/include/zenstore/blockstore.h6
-rw-r--r--src/zenstore/include/zenstore/cidstore.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/zenstore/include/zenstore/blockstore.h b/src/zenstore/include/zenstore/blockstore.h
index c28aa8102..7ef2f7baa 100644
--- a/src/zenstore/include/zenstore/blockstore.h
+++ b/src/zenstore/include/zenstore/blockstore.h
@@ -110,6 +110,7 @@ private:
};
class BlockStoreCompactState;
+class WorkerThreadPool;
class BlockStore
{
@@ -178,8 +179,9 @@ public:
const ClaimDiskReserveCallback& DiskReserveCallback = []() { return 0; });
void IterateChunks(const std::vector<BlockStoreLocation>& ChunkLocations,
- const IterateChunksSmallSizeCallback& SmallSizeCallback,
- const IterateChunksLargeSizeCallback& LargeSizeCallback);
+ const IterateChunksSmallSizeCallback& AsyncSmallSizeCallback,
+ const IterateChunksLargeSizeCallback& AsyncLargeSizeCallback,
+ WorkerThreadPool* OptionalWorkerPool);
void CompactBlocks(
const BlockStoreCompactState& CompactState,
diff --git a/src/zenstore/include/zenstore/cidstore.h b/src/zenstore/include/zenstore/cidstore.h
index 54f562767..d95fa7cd4 100644
--- a/src/zenstore/include/zenstore/cidstore.h
+++ b/src/zenstore/include/zenstore/cidstore.h
@@ -18,6 +18,7 @@ class CasStore;
class CompressedBuffer;
class IoBuffer;
class ScrubContext;
+class WorkerThreadPool;
struct CidStoreSize
{
@@ -79,6 +80,9 @@ public:
std::span<IoHash> RawHashes,
InsertMode Mode = InsertMode::kMayBeMovedInPlace);
virtual IoBuffer FindChunkByCid(const IoHash& DecompressedId) override;
+ bool IterateChunks(std::span<IoHash> DecompressedIds,
+ const std::function<bool(size_t Index, const IoBuffer& Payload)>& AsyncCallback,
+ WorkerThreadPool* OptionalWorkerPool);
bool ContainsChunk(const IoHash& DecompressedId);
void FilterChunks(HashKeySet& InOutChunks);
void Flush();