aboutsummaryrefslogtreecommitdiff
path: root/zenserver/upstream/upstreamcache.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-05-04 15:25:35 +0200
committerDan Engelbrecht <[email protected]>2022-05-04 15:25:35 +0200
commit5b95a4fba97aa66cec935ef3e0d969893223f9d6 (patch)
tree32316f82b9c9d0e846141ddb4244cefebe036697 /zenserver/upstream/upstreamcache.cpp
parentInitialize upstream apply in background thread (#88) (diff)
downloadzen-5b95a4fba97aa66cec935ef3e0d969893223f9d6.tar.xz
zen-5b95a4fba97aa66cec935ef3e0d969893223f9d6.zip
Add namespacecachestore layer to allow multiple structured cache namespaces
Diffstat (limited to 'zenserver/upstream/upstreamcache.cpp')
-rw-r--r--zenserver/upstream/upstreamcache.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/zenserver/upstream/upstreamcache.cpp b/zenserver/upstream/upstreamcache.cpp
index dba80faa9..49f384774 100644
--- a/zenserver/upstream/upstreamcache.cpp
+++ b/zenserver/upstream/upstreamcache.cpp
@@ -19,6 +19,7 @@
#include <zenstore/cidstore.h>
#include <auth/authmgr.h>
+#include "cache/namespacecachestore.h"
#include "cache/structuredcache.h"
#include "cache/structuredcachestore.h"
#include "diag/logging.h"
@@ -1173,7 +1174,7 @@ namespace detail {
class UpstreamCacheImpl final : public UpstreamCache
{
public:
- UpstreamCacheImpl(const UpstreamCacheOptions& Options, ZenCacheStore& CacheStore, CidStore& CidStore)
+ UpstreamCacheImpl(const UpstreamCacheOptions& Options, NamespaceCacheStore& CacheStore, CidStore& CidStore)
: m_Log(logging::Get("upstream"))
, m_Options(Options)
, m_CacheStore(CacheStore)
@@ -1517,7 +1518,7 @@ private:
ZenCacheValue CacheValue;
std::vector<IoBuffer> Payloads;
- if (!m_CacheStore.Get(CacheRecord.Key.Bucket, CacheRecord.Key.Hash, CacheValue))
+ if (!m_CacheStore.Get("", CacheRecord.Key.Bucket, CacheRecord.Key.Hash, CacheValue))
{
ZEN_WARN("process upstream FAILED, '{}/{}', cache record doesn't exist", CacheRecord.Key.Bucket, CacheRecord.Key.Hash);
return;
@@ -1687,7 +1688,7 @@ private:
spdlog::logger& m_Log;
UpstreamCacheOptions m_Options;
- ZenCacheStore& m_CacheStore;
+ NamespaceCacheStore& m_CacheStore;
CidStore& m_CidStore;
UpstreamQueue m_UpstreamQueue;
std::shared_mutex m_EndpointsMutex;
@@ -1712,7 +1713,7 @@ UpstreamEndpoint::CreateJupiterEndpoint(const CloudCacheClientOptions& Options,
}
std::unique_ptr<UpstreamCache>
-UpstreamCache::Create(const UpstreamCacheOptions& Options, ZenCacheStore& CacheStore, CidStore& CidStore)
+UpstreamCache::Create(const UpstreamCacheOptions& Options, NamespaceCacheStore& CacheStore, CidStore& CidStore)
{
return std::make_unique<UpstreamCacheImpl>(Options, CacheStore, CidStore);
}