diff options
| author | Dan Engelbrecht <[email protected]> | 2024-04-30 10:11:25 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-04-30 10:11:25 +0200 |
| commit | c7a0ddf9f26fdd647574e4031a66362234298e7a (patch) | |
| tree | 5e3eba1856dc160ca0beb2bc5edaf1ea490a0a6f /src/zenstore/filecas.h | |
| parent | miscellaneous minor bugfixes (#66) (diff) | |
| download | zen-c7a0ddf9f26fdd647574e4031a66362234298e7a.tar.xz zen-c7a0ddf9f26fdd647574e4031a66362234298e7a.zip | |
fix get project files loop (#68)
- Bugfix: Remove extra loop causing GetProjectFiles for project store to find all chunks once for each chunk found
- Bugfix: Don't capture ChunkIndex variable in CasImpl::IterateChunks by reference as it causes crash
- Improvement: Make FileCasStrategy::IterateChunks (optionally) multithreaded (improves GetProjectFiles performance)
Diffstat (limited to 'src/zenstore/filecas.h')
| -rw-r--r-- | src/zenstore/filecas.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/zenstore/filecas.h b/src/zenstore/filecas.h index 06e35de23..07fc36954 100644 --- a/src/zenstore/filecas.h +++ b/src/zenstore/filecas.h @@ -39,11 +39,13 @@ struct FileCasStrategy final : public GcStorage, public GcReferenceStore IoBuffer FindChunk(const IoHash& ChunkHash); bool HaveChunk(const IoHash& ChunkHash); void FilterChunks(HashKeySet& InOutChunks); - bool IterateChunks(std::span<IoHash> ChunkHashes, const std::function<bool(size_t Index, const IoBuffer& Payload)>& Callback); - void Flush(); - virtual void ScrubStorage(ScrubContext& ScrubCtx) override; - virtual void CollectGarbage(GcContext& GcCtx) override; - virtual GcStorageSize StorageSize() const override; + bool IterateChunks(std::span<IoHash> ChunkHashes, + const std::function<bool(size_t Index, const IoBuffer& Payload)>& AsyncCallback, + WorkerThreadPool* OptionalWorkerPool); + void Flush(); + virtual void ScrubStorage(ScrubContext& ScrubCtx) override; + virtual void CollectGarbage(GcContext& GcCtx) override; + virtual GcStorageSize StorageSize() const override; virtual std::string GetGcName(GcCtx& Ctx) override; virtual GcReferencePruner* CreateReferencePruner(GcCtx& Ctx, GcReferenceStoreStats& Stats) override; |