aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
-rw-r--r--zenserver/cache/structuredcachestore.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index d4b8bff39..6af673ebc 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -342,6 +342,14 @@ ZenCacheNamespace::DropBucket(std::string_view Bucket)
return AnyDropped;
}
+bool
+ZenCacheNamespace::Drop()
+{
+ m_MemLayer.Drop();
+ const bool DiskDropped = m_DiskLayer.Drop();
+ return DiskDropped;
+}
+
void
ZenCacheNamespace::Flush()
{
@@ -2300,7 +2308,22 @@ ZenCacheStore::DropBucket(std::string_view Namespace, std::string_view Bucket)
{
return Store->DropBucket(Bucket);
}
- ZEN_WARN("request for unknown namespace '{}' in ZenCacheStore::Put, bucket '{}'", Namespace, Bucket);
+ ZEN_WARN("request for unknown namespace '{}' in ZenCacheStore::DropBucket, bucket '{}'", Namespace, Bucket);
+ return false;
+}
+
+bool
+ZenCacheStore::DropNamespace(std::string_view InNamespace)
+{
+ RwLock::SharedLockScope _(m_NamespacesLock);
+ if (auto It = m_Namespaces.find(std::string(InNamespace)); It != m_Namespaces.end())
+ {
+ ZenCacheNamespace& Namespace = *It->second;
+ m_DroppedNamespaces.push_back(std::move(It->second));
+ m_Namespaces.erase(It);
+ return Namespace.Drop();
+ }
+ ZEN_WARN("request for unknown namespace '{}' in ZenCacheStore::DropNamespace", InNamespace);
return false;
}