aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache/structuredcachestore.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver/cache/structuredcachestore.h')
-rw-r--r--src/zenserver/cache/structuredcachestore.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/zenserver/cache/structuredcachestore.h b/src/zenserver/cache/structuredcachestore.h
index 0dd160a98..0c87ecc22 100644
--- a/src/zenserver/cache/structuredcachestore.h
+++ b/src/zenserver/cache/structuredcachestore.h
@@ -39,6 +39,7 @@ namespace zen {
class WorkerThreadPool;
class DiskWriteBlocker;
+class JobQueue;
/* Z$ namespace
@@ -77,7 +78,10 @@ public:
ZenCacheDiskLayer::DiskStats DiskStats;
};
- ZenCacheNamespace(GcManager& Gc, const std::filesystem::path& RootDir);
+ ZenCacheNamespace(GcManager& Gc,
+ JobQueue& JobQueue,
+ const std::filesystem::path& RootDir,
+ const ZenCacheMemoryLayer::Configuration MemLayerConfig = {});
~ZenCacheNamespace();
bool Get(std::string_view Bucket, const IoHash& HashKey, ZenCacheValue& OutValue);
@@ -108,6 +112,7 @@ public:
private:
std::filesystem::path m_RootDir;
+ JobQueue& m_JobQueue;
ZenCacheMemoryLayer m_MemLayer;
ZenCacheDiskLayer m_DiskLayer;
std::atomic<uint64_t> m_HitCount{};
@@ -137,8 +142,9 @@ public:
struct Configuration
{
- std::filesystem::path BasePath;
- bool AllowAutomaticCreationOfNamespaces = false;
+ std::filesystem::path BasePath;
+ bool AllowAutomaticCreationOfNamespaces = false;
+ ZenCacheMemoryLayer::Configuration MemLayerConfig;
struct LogConfig
{
bool EnableWriteLog = true;
@@ -171,7 +177,7 @@ public:
std::vector<NamedNamespaceStats> NamespaceStats;
};
- ZenCacheStore(GcManager& Gc, const Configuration& Configuration, const DiskWriteBlocker* InDiskWriteBlocker);
+ ZenCacheStore(GcManager& Gc, JobQueue& JobQueue, const Configuration& Configuration, const DiskWriteBlocker* InDiskWriteBlocker);
~ZenCacheStore();
bool Get(const CacheRequestContext& Context,
@@ -222,6 +228,7 @@ private:
std::vector<std::unique_ptr<ZenCacheNamespace>> m_DroppedNamespaces;
GcManager& m_Gc;
+ JobQueue& m_JobQueue;
Configuration m_Configuration;
std::atomic<uint64_t> m_HitCount{};
std::atomic<uint64_t> m_MissCount{};