aboutsummaryrefslogtreecommitdiff
path: root/zenstore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-05-24 19:26:40 +0200
committerStefan Boberg <[email protected]>2021-05-24 19:26:40 +0200
commite70e2b4453a27d9d1caf77224ffd6335c50981fb (patch)
tree05d469aa1c3ab6c1840fd4732696c708d1a2a07d /zenstore/include
parentValidate payloads using embedded CompressedBuffer hash (diff)
downloadzen-e70e2b4453a27d9d1caf77224ffd6335c50981fb.tar.xz
zen-e70e2b4453a27d9d1caf77224ffd6335c50981fb.zip
Added CidStore, currently used to track relationships between compressed and uncompressed chunk hashes
This first implementation is in-memory only, persistence is next
Diffstat (limited to 'zenstore/include')
-rw-r--r--zenstore/include/zenstore/cidstore.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/zenstore/include/zenstore/cidstore.h b/zenstore/include/zenstore/cidstore.h
new file mode 100644
index 000000000..0c8f51740
--- /dev/null
+++ b/zenstore/include/zenstore/cidstore.h
@@ -0,0 +1,34 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#pragma once
+
+#include <tsl/robin_map.h>
+#include <zencore/iohash.h>
+
+namespace zen {
+
+class CasStore;
+class IoBuffer;
+
+/** Content Store
+ *
+ * Data in the content store is referenced by content identifiers (CIDs), rather than their
+ * literal hash. This is required to map uncompressed hashes to compressed hashes and may
+ * be used to deal with other indirections in the future.
+ *
+ */
+class CidStore
+{
+public:
+ CidStore(CasStore& InCasStore);
+ ~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;
+};
+
+} // namespace zen