diff options
| author | Stefan Boberg <[email protected]> | 2021-05-24 22:26:56 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-05-24 22:26:56 +0200 |
| commit | c54f3888d1b0e1bb0d5edf335c22a6d0f454afd2 (patch) | |
| tree | dc2866edfd93f91b31fefd70fcd8fa92ec81b453 /zenstore/include | |
| parent | Fixed index flags for standalone files (diff) | |
| download | zen-c54f3888d1b0e1bb0d5edf335c22a6d0f454afd2.tar.xz zen-c54f3888d1b0e1bb0d5edf335c22a6d0f454afd2.zip | |
Implemented simple persistence for CidStore, which stores CID->CAS mappings
Diffstat (limited to 'zenstore/include')
| -rw-r--r-- | zenstore/include/zenstore/cidstore.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/zenstore/include/zenstore/cidstore.h b/zenstore/include/zenstore/cidstore.h index 0c8f51740..e365b198e 100644 --- a/zenstore/include/zenstore/cidstore.h +++ b/zenstore/include/zenstore/cidstore.h @@ -5,6 +5,10 @@ #include <tsl/robin_map.h> #include <zencore/iohash.h> +namespace std::filesystem { +class path; +} + namespace zen { class CasStore; @@ -20,15 +24,15 @@ class IoBuffer; class CidStore { public: - CidStore(CasStore& InCasStore); + CidStore(CasStore& InCasStore, const std::filesystem::path& RootDir); ~CidStore(); void AddCompressedCid(const IoHash& DecompressedId, const IoHash& Compressed); IoBuffer FindChunkByCid(const IoHash& DecompressedId); private: - CasStore& m_CasStore; - tsl::robin_map<IoHash, IoHash, IoHash::Hasher> m_CidMap; + struct CidState; + std::unique_ptr<CidState> m_Impl; }; } // namespace zen |