diff options
| author | Dan Engelbrecht <[email protected]> | 2023-10-04 14:37:49 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-04 14:37:49 +0200 |
| commit | 387b6d99e6ef3958a6fd78b22c48bb8a85b53bda (patch) | |
| tree | fd6a5e07e9785a10606f35f92b2f205af87fff1f /src/zenstore/compactcas.h | |
| parent | added CHANGELOG.md note for websocket removal (diff) | |
| download | zen-387b6d99e6ef3958a6fd78b22c48bb8a85b53bda.tar.xz zen-387b6d99e6ef3958a6fd78b22c48bb8a85b53bda.zip | |
refactor comapactcas index (#443)
- Bugfix: Fix scrub messing up payload and access time in disk cache bucket when compacting index
- Improvement: Split up disk cache bucket index into hash lookup and payload array to improve performance
- Improvement: Reserve space up front for compact binary output when saving cache bucket manifest to improve performance
Diffstat (limited to 'src/zenstore/compactcas.h')
| -rw-r--r-- | src/zenstore/compactcas.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/zenstore/compactcas.h b/src/zenstore/compactcas.h index eff9cc135..c0cbbac32 100644 --- a/src/zenstore/compactcas.h +++ b/src/zenstore/compactcas.h @@ -77,6 +77,7 @@ private: uint64_t ReadIndexFile(const std::filesystem::path& IndexPath, uint32_t& OutVersion); uint64_t ReadLog(const std::filesystem::path& LogPath, uint64_t SkipEntryCount); void OpenContainer(bool IsNewStore); + void CompactIndex(RwLock::ExclusiveLockScope&); spdlog::logger& Log() { return m_Log; } @@ -91,9 +92,10 @@ private: std::filesystem::path m_BlocksBasePath; BlockStore m_BlockStore; - RwLock m_LocationMapLock; - typedef tsl::robin_map<IoHash, BlockStoreDiskLocation, IoHash::Hasher> LocationMap_t; - LocationMap_t m_LocationMap; + RwLock m_LocationMapLock; + typedef tsl::robin_map<IoHash, size_t, IoHash::Hasher> LocationMap_t; + LocationMap_t m_LocationMap; + std::vector<BlockStoreDiskLocation> m_Locations; }; void compactcas_forcelink(); |