diff options
| author | Stefan Boberg <[email protected]> | 2021-10-01 18:55:02 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-01 18:55:02 +0200 |
| commit | 5532f58f2bc0158cf443968147ae953156a2f463 (patch) | |
| tree | 2baf7f2a97c4cc1637de6dd12fe4d91886b4ef5d /zenstore/include | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-5532f58f2bc0158cf443968147ae953156a2f463.tar.xz zen-5532f58f2bc0158cf443968147ae953156a2f463.zip | |
cas: added some GC stubs
Diffstat (limited to 'zenstore/include')
| -rw-r--r-- | zenstore/include/zenstore/CAS.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/zenstore/include/zenstore/CAS.h b/zenstore/include/zenstore/CAS.h index 93454ca6f..1425845a0 100644 --- a/zenstore/include/zenstore/CAS.h +++ b/zenstore/include/zenstore/CAS.h @@ -37,7 +37,16 @@ struct CasStoreConfiguration class GcContext { public: + GcContext(); + ~GcContext(); + + void ContributeCids(std::span<const IoHash> Cid); + void ContributeCas(std::span<const IoHash> Hash); + private: + struct GcState; + + std::unique_ptr<GcState> m_State; }; /** Context object for data scrubbing @@ -58,10 +67,14 @@ private: bool m_Recover = true; }; +/** Manage a set of IoHash values + */ + class CasChunkSet { public: void AddChunkToSet(const IoHash& HashToAdd); + void AddChunksToSet(std::span<const IoHash> HashesToAdd); void RemoveChunksIf(std::function<bool(const IoHash& CandidateHash)>&& Predicate); void IterateChunks(std::function<void(const IoHash& ChunkHash)>&& Callback); inline [[nodiscard]] bool ContainsChunk(const IoHash& Hash) const { return m_ChunkSet.find(Hash) != m_ChunkSet.end(); } @@ -69,6 +82,7 @@ public: inline [[nodiscard]] size_t GetSize() const { return m_ChunkSet.size(); } private: + // Q: should we protect this with a lock, or is that a higher level concern? std::unordered_set<IoHash> m_ChunkSet; }; |