diff options
| author | Stefan Boberg <[email protected]> | 2021-05-25 09:54:09 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-05-25 09:54:09 +0200 |
| commit | 882e93e4786f9e67e0edf6c276b16bb40848bae9 (patch) | |
| tree | c5d4c45679c676c6aeb804c7601f43340b78ea0b /zenserver/cache/structuredcache.h | |
| parent | Updated structured cache description (diff) | |
| parent | Compile out all rocksdb code for a smaller binary (diff) | |
| download | zen-882e93e4786f9e67e0edf6c276b16bb40848bae9.tar.xz zen-882e93e4786f9e67e0edf6c276b16bb40848bae9.zip | |
Merged from origin/main
Diffstat (limited to 'zenserver/cache/structuredcache.h')
| -rw-r--r-- | zenserver/cache/structuredcache.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/zenserver/cache/structuredcache.h b/zenserver/cache/structuredcache.h index e2ab60928..72aeecfd5 100644 --- a/zenserver/cache/structuredcache.h +++ b/zenserver/cache/structuredcache.h @@ -3,12 +3,16 @@ #pragma once #include <zencore/httpserver.h> +#include <zencore/refcount.h> -#include "cachestore.h" +#include "structuredcachestore.h" #include "upstream/jupiter.h" namespace zen { +class CloudCacheClient; +class CidStore; + /** * New-style cache service. Imposes constraints on keys, supports blobs and * structured values @@ -40,7 +44,7 @@ namespace zen { class HttpStructuredCacheService : public zen::HttpService { public: - HttpStructuredCacheService(std::filesystem::path RootPath, zen::CasStore& InStore); + HttpStructuredCacheService(std::filesystem::path RootPath, zen::CasStore& InStore, zen::CidStore& InCidStore); ~HttpStructuredCacheService(); virtual const char* BaseUri() const override; @@ -52,12 +56,17 @@ private: { std::string BucketSegment; IoHash HashKey; + IoHash PayloadId; }; [[nodiscard]] bool ValidateUri(zen::HttpServerRequest& Request, CacheRef& OutRef); + void HandleCacheRecordRequest(zen::HttpServerRequest& Request, CacheRef& Ref); + void HandleCachePayloadRequest(zen::HttpServerRequest& Request, CacheRef& Ref); - zen::CasStore& m_CasStore; - ZenCacheStore m_CacheStore; + zen::CasStore& m_CasStore; + zen::CidStore& m_CidStore; + ZenCacheStore m_CacheStore; + RefPtr<CloudCacheClient> m_Cloud; }; } // namespace zen |