aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cidstore.cpp
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/cidstore.cpp
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/cidstore.cpp')
-rw-r--r--src/zenstore/cidstore.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/zenstore/cidstore.cpp b/src/zenstore/cidstore.cpp
index 68bccd06b..71fd596f4 100644
--- a/src/zenstore/cidstore.cpp
+++ b/src/zenstore/cidstore.cpp
@@ -117,6 +117,13 @@ struct CidStore::Impl
InOutChunks.RemoveHashesIf([&](const IoHash& Hash) { return ContainsChunk(Hash); });
}
+ bool IterateChunks(std::span<IoHash> DecompressedIds,
+ const std::function<bool(size_t Index, const IoBuffer& Payload)>& AsyncCallback,
+ WorkerThreadPool* OptionalWorkerPool)
+ {
+ return m_CasStore.IterateChunks(DecompressedIds, AsyncCallback, OptionalWorkerPool);
+ }
+
void Flush() { m_CasStore.Flush(); }
void ScrubStorage(ScrubContext& Ctx)
@@ -207,6 +214,14 @@ CidStore::ContainsChunk(const IoHash& DecompressedId)
return m_Impl->ContainsChunk(DecompressedId);
}
+bool
+CidStore::IterateChunks(std::span<IoHash> DecompressedIds,
+ const std::function<bool(size_t Index, const IoBuffer& Payload)>& AsyncCallback,
+ WorkerThreadPool* OptionalWorkerPool)
+{
+ return m_Impl->IterateChunks(DecompressedIds, AsyncCallback, OptionalWorkerPool);
+}
+
void
CidStore::FilterChunks(HashKeySet& InOutChunks)
{