aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cidstore.h
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-06-17 07:06:21 -0700
committerGitHub <[email protected]>2022-06-17 07:06:21 -0700
commitc7e22a4ef1cce7103b9afbeec487461cb32f8dbe (patch)
tree8b99d51bf496c96f82161c18fbdcfd5c6f8f31fd /zenserver/cidstore.h
parentfixed merge mistake which caused a build error (diff)
downloadzen-c7e22a4ef1cce7103b9afbeec487461cb32f8dbe.tar.xz
zen-c7e22a4ef1cce7103b9afbeec487461cb32f8dbe.zip
Make cas storage an hidden implementation detail of CidStore (#130)v0.1.4-pre6v0.1.4-pre5
- Bumped ZEN_SCHEMA_VERSION - CasStore no longer a public API, it is hidden behind CidStore - Moved cas.h from public header folder - CidStore no longer maps from Cid -> Cas, we store entries in Cas under RawHash - CasStore now decompresses data to validate content (matching against RawHash) - CasChunkSet renames to HashKeySet and put in separate header/cpp file - Disabled "Chunk" command for now as it relied on CAS being exposed as a service - Changed CAS http service to Cid http server - Moved "Run" command completely inside ZEN_WITH_EXEC_SERVICES define - Removed "cas.basic" test - Uncommented ".exec.basic" test and added return-skip at start of test - Moved ScrubContext to separate header file - Renamed CasGC to GcManager - Cleaned up configuration passing in cas store classes - Removed CAS stuff from GcContext and clarified naming in class - Remove migration code
Diffstat (limited to 'zenserver/cidstore.h')
-rw-r--r--zenserver/cidstore.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/zenserver/cidstore.h b/zenserver/cidstore.h
new file mode 100644
index 000000000..8e7832b35
--- /dev/null
+++ b/zenserver/cidstore.h
@@ -0,0 +1,35 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#pragma once
+
+#include <zenhttp/httpserver.h>
+
+namespace zen {
+
+/**
+ * Simple CID store HTTP endpoint
+ *
+ * Note that since this does not end up pinning any of the chunks it's only really useful for a small subset of use cases where you know a
+ * chunk exists in the underlying CID store. Thus it's mainly useful for internal use when communicating between Zen store instances
+ *
+ * Using this interface for adding CID chunks makes little sense except for testing purposes as garbage collection may reap anything you add
+ * before anything ever gets to access it
+ */
+
+class CidStore;
+
+class HttpCidService : public HttpService
+{
+public:
+ explicit HttpCidService(CidStore& Store);
+ ~HttpCidService() = default;
+
+ virtual const char* BaseUri() const override;
+ virtual void HandleRequest(zen::HttpServerRequest& Request) override;
+
+private:
+ CidStore& m_CidStore;
+ HttpRequestRouter m_Router;
+};
+
+} // namespace zen