summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/database_holder.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-12-15 15:38:44 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-12-17 11:27:15 -0500
commitc5ebc6be8e3a865655acbc5ecd1cb3b96fdf44ff (patch)
treea8f5a606481a6f1d29deaf445da1a844366b409f /src/mongo/db/catalog/database_holder.cpp
parentf312681a62f15196d0638da50350dd6a9c693e36 (diff)
downloadmongo-c5ebc6be8e3a865655acbc5ecd1cb3b96fdf44ff.tar.gz
SERVER-16431 Simplify DB profile code
Diffstat (limited to 'src/mongo/db/catalog/database_holder.cpp')
-rw-r--r--src/mongo/db/catalog/database_holder.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mongo/db/catalog/database_holder.cpp b/src/mongo/db/catalog/database_holder.cpp
index c924375ef0a..dc7bd5106c5 100644
--- a/src/mongo/db/catalog/database_holder.cpp
+++ b/src/mongo/db/catalog/database_holder.cpp
@@ -30,13 +30,15 @@
#include "mongo/platform/basic.h"
+#include "mongo/db/catalog/database_holder.h"
+
#include "mongo/db/audit.h"
#include "mongo/db/auth/auth_index_d.h"
#include "mongo/db/background.h"
#include "mongo/db/client.h"
#include "mongo/db/clientcursor.h"
+#include "mongo/db/catalog/database.h"
#include "mongo/db/catalog/database_catalog_entry.h"
-#include "mongo/db/catalog/database_holder.h"
#include "mongo/db/global_environment_experiment.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/storage/storage_engine.h"
@@ -44,11 +46,9 @@
#include "mongo/util/log.h"
namespace mongo {
-
- static DatabaseHolder _dbHolder;
-
namespace {
- static StringData _todb(const StringData& ns) {
+
+ StringData _todb(const StringData& ns) {
size_t i = ns.find('.');
if (i == std::string::npos) {
uassert(13074, "db name can't be empty", ns.size());
@@ -62,12 +62,18 @@ namespace {
return d;
}
-}
+
+
+ DatabaseHolder _dbHolder;
+
+} // namespace
+
DatabaseHolder& dbHolder() {
return _dbHolder;
}
+
Database* DatabaseHolder::get(OperationContext* txn,
const StringData& ns) const {