diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-20 13:13:09 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-05-20 13:13:09 +0200 |
| commit | 37edbbd4437bd756236d99684ac4d7b0b6725aa8 (patch) | |
| tree | 515770c1ce2f2cf480f35af34d60f028aafca9b4 /zenserver/cache/structuredcachestore.h | |
| parent | fix mac compilation error (diff) | |
| download | zen-37edbbd4437bd756236d99684ac4d7b0b6725aa8.tar.xz zen-37edbbd4437bd756236d99684ac4d7b0b6725aa8.zip | |
Automatically create namespaces on requests (if enabled via configuration)
Diffstat (limited to 'zenserver/cache/structuredcachestore.h')
| -rw-r--r-- | zenserver/cache/structuredcachestore.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/zenserver/cache/structuredcachestore.h b/zenserver/cache/structuredcachestore.h index 34b8d18f4..13ba95f1b 100644 --- a/zenserver/cache/structuredcachestore.h +++ b/zenserver/cache/structuredcachestore.h @@ -360,7 +360,13 @@ public: "!default!"; // This is intentionally not a valid namespace name and will only be used for mapping when no namespace is given static constexpr std::string_view NamespaceDiskPrefix = "ns_"; - ZenCacheStore(CasGc& Gc, std::filesystem::path BasePath); + struct Configuration + { + std::filesystem::path BasePath; + bool AllowAutomaticCreationOfNamespaces = true; + }; + + ZenCacheStore(CasGc& Gc, const Configuration& Configuration); ~ZenCacheStore(); bool Get(std::string_view Namespace, std::string_view Bucket, const IoHash& HashKey, ZenCacheValue& OutValue); @@ -381,6 +387,9 @@ private: mutable RwLock m_NamespacesLock; NameSpaceMap m_Namespaces; + + CasGc& m_Gc; + Configuration m_Configuration; }; void z$_forcelink(); |