summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/lru_key_value.h
diff options
context:
space:
mode:
authorRuoxin Xu <ruoxin.xu@mongodb.com>2021-09-24 13:43:15 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-24 14:23:54 +0000
commit634867703b7eb40f073198d27633a7c5506e4604 (patch)
tree70a161bc3cb70f3f3fca99dc64f4e179320df8e2 /src/mongo/db/query/lru_key_value.h
parentc607f9b63f4764335749ae40a5762d6a305558c1 (diff)
downloadmongo-634867703b7eb40f073198d27633a7c5506e4604.tar.gz
SERVER-59854 Remove PlanCacheIndexabilityState from the PlanCache
This patch includes a number of changes to facilitate the use of PlanCacheIndexabilityState with SBE and classic plan cache keys. * Introduced a plan cache key factory. * Moved PlanCacheIndexabilityState from the PlanCache into CollectionQueryInfo. * Templetized QueryPlanner::planSubqueries() so it can be used with classic and SBE plan caches. * Removed dependency on the CanonicalQuery from the PlanCache class. Co-authored-by: Anton Korshunov <anton.korshunov@mongodb.com>
Diffstat (limited to 'src/mongo/db/query/lru_key_value.h')
-rw-r--r--src/mongo/db/query/lru_key_value.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/query/lru_key_value.h b/src/mongo/db/query/lru_key_value.h
index abb5cf475fd..3d2430c1c74 100644
--- a/src/mongo/db/query/lru_key_value.h
+++ b/src/mongo/db/query/lru_key_value.h
@@ -202,18 +202,19 @@ public:
/**
* Remove the kv-store entry keyed by 'key'.
+ * Returns false if there doesn't exist such 'key', otherwise returns true.
*/
- Status remove(const K& key) {
+ bool remove(const K& key) {
KVMapConstIt i = _kvMap.find(key);
if (i == _kvMap.end()) {
- return Status(ErrorCodes::NoSuchKey, "no such key in LRU key-value store");
+ return false;
}
KVListIt found = i->second;
_budgetTracker.onRemove(*i->second->second);
delete found->second;
_kvMap.erase(i);
_kvList.erase(found);
- return Status::OK();
+ return true;
}
/**