diff options
| author | Stefan Boberg <[email protected]> | 2021-09-21 15:42:42 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-21 15:42:42 +0200 |
| commit | bd540d333e920f3c93ebaaf2bd175194b3877c1b (patch) | |
| tree | 9c97ad87207e636ce452b420b80ae6ca653420f0 /zenstore/cidstore.cpp | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-bd540d333e920f3c93ebaaf2bd175194b3877c1b.tar.xz zen-bd540d333e920f3c93ebaaf2bd175194b3877c1b.zip | |
Encapsulated containers in CasChunkSet to allow for more efficient udpates/queries
Diffstat (limited to 'zenstore/cidstore.cpp')
| -rw-r--r-- | zenstore/cidstore.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/zenstore/cidstore.cpp b/zenstore/cidstore.cpp index 9c8d4742c..08a3192ff 100644 --- a/zenstore/cidstore.cpp +++ b/zenstore/cidstore.cpp @@ -139,7 +139,7 @@ struct CidStore::Impl for (auto& Kv : m_CidMap) { - ChunkSet.AddChunk(Kv.second); + ChunkSet.AddChunkToSet(Kv.second); } } @@ -152,21 +152,21 @@ struct CidStore::Impl } ZEN_ERROR("Scrubbing found that {} cid mappings (out of {}) mapped to non-existent CAS chunks. These mappings will be removed", - ChunkSet.GetChunkSet().size(), + ChunkSet.GetSize(), m_CidMap.size()); // Erase all mappings to chunks which are not present in the underlying CAS store // we do this by removing mappings from the in-memory lookup structure and also // by emitting tombstone records to the commit log - const auto& MissingChunks = ChunkSet.GetChunkSet(); std::vector<IoHash> BadChunks; + { RwLock::SharedLockScope _(m_Lock); for (auto It = begin(m_CidMap), ItEnd = end(m_CidMap); It != ItEnd;) { - if (auto MissingIt = MissingChunks.find(It->second); MissingIt != MissingChunks.end()) + if (ChunkSet.ContainsChunk(It->second)) { const IoHash& BadHash = It->first; |