diff options
| author | Stefan Boberg <[email protected]> | 2021-09-14 21:40:42 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-14 21:40:42 +0200 |
| commit | 434e8d0001169025cdbf0816d9f96187e37f24f7 (patch) | |
| tree | b717227f663d2b48ea7e0914d67ed36a2171f812 /zenstore/include | |
| parent | Changed path for crashpad exe since vcpkg decided to put it somewhere else no... (diff) | |
| download | zen-434e8d0001169025cdbf0816d9f96187e37f24f7.tar.xz zen-434e8d0001169025cdbf0816d9f96187e37f24f7.zip | |
Extended CidStore implementation with some helper functions
Diffstat (limited to 'zenstore/include')
| -rw-r--r-- | zenstore/include/zenstore/cidstore.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/zenstore/include/zenstore/cidstore.h b/zenstore/include/zenstore/cidstore.h index 2c2b395a5..62d642ad1 100644 --- a/zenstore/include/zenstore/cidstore.h +++ b/zenstore/include/zenstore/cidstore.h @@ -4,6 +4,7 @@ #include <tsl/robin_map.h> #include <zencore/iohash.h> +#include <zenstore/CAS.h> namespace std::filesystem { class path; @@ -12,6 +13,7 @@ class path; namespace zen { class CasStore; +class CompressedBuffer; class IoBuffer; /** Content Store @@ -29,10 +31,13 @@ public: CidStore(CasStore& InCasStore, const std::filesystem::path& RootDir); ~CidStore(); - void AddCompressedCid(const IoHash& DecompressedId, const IoHash& Compressed); - IoBuffer FindChunkByCid(const IoHash& DecompressedId); - bool ContainsChunk(const IoHash& DecompressedId); - void Flush(); + CasStore::InsertResult AddChunk(CompressedBuffer& ChunkData); + void AddCompressedCid(const IoHash& DecompressedId, const IoHash& Compressed); + IoBuffer FindChunkByCid(const IoHash& DecompressedId); + bool ContainsChunk(const IoHash& DecompressedId); + void Flush(); + + // TODO: add batch filter support private: struct CidState; |