aboutsummaryrefslogtreecommitdiff
path: root/zenstore/include
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-09-16 16:21:16 +0200
committerGitHub <[email protected]>2021-09-16 16:21:16 +0200
commitb166d4081655c4c181ed915ec5475ed535c67a9d (patch)
tree2a7d6dd512dc3cfb106442f656bdc65a2650dcac /zenstore/include
parentclang-format fixes (diff)
downloadzen-b166d4081655c4c181ed915ec5475ed535c67a9d.tar.xz
zen-b166d4081655c4c181ed915ec5475ed535c67a9d.zip
Compact binary package caching support (#9)
Diffstat (limited to 'zenstore/include')
-rw-r--r--zenstore/include/zenstore/cidstore.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/zenstore/include/zenstore/cidstore.h b/zenstore/include/zenstore/cidstore.h
index 62d642ad1..76a33c915 100644
--- a/zenstore/include/zenstore/cidstore.h
+++ b/zenstore/include/zenstore/cidstore.h
@@ -31,11 +31,18 @@ public:
CidStore(CasStore& InCasStore, const std::filesystem::path& RootDir);
~CidStore();
- 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();
+ struct InsertResult
+ {
+ IoHash DecompressedId;
+ IoHash CompressedHash;
+ bool New = false;
+ };
+
+ 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