summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authz_manager_external_state_s.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-04-09 17:05:00 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-04-10 16:29:38 -0400
commit8e6804d268895c01678a1a3d2feb57a82cafec62 (patch)
treeae85091e56240546aae3c92160fef1f8d64fcc6b /src/mongo/db/auth/authz_manager_external_state_s.cpp
parentcb236301e4016469c9b5c2802050e7bda08c33b9 (diff)
downloadmongo-8e6804d268895c01678a1a3d2feb57a82cafec62.tar.gz
SERVER-17723 Sharding catalog cache
This change builds a sharding catalog cache on top of the CatalogManager abstraction and use this in place of the direct network calls to the config server.
Diffstat (limited to 'src/mongo/db/auth/authz_manager_external_state_s.cpp')
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_s.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/db/auth/authz_manager_external_state_s.cpp b/src/mongo/db/auth/authz_manager_external_state_s.cpp
index 4e9a204cbf8..489b4ce51c8 100644
--- a/src/mongo/db/auth/authz_manager_external_state_s.cpp
+++ b/src/mongo/db/auth/authz_manager_external_state_s.cpp
@@ -32,8 +32,9 @@
#include "mongo/db/auth/authz_manager_external_state_s.h"
-#include <boost/thread/mutex.hpp>
#include <boost/scoped_ptr.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/thread/mutex.hpp>
#include <string>
#include "mongo/client/dbclientinterface.h"
@@ -42,6 +43,7 @@
#include "mongo/db/auth/authz_session_external_state_s.h"
#include "mongo/db/auth/user_name.h"
#include "mongo/db/jsobj.h"
+#include "mongo/s/catalog/catalog_cache.h"
#include "mongo/s/catalog/catalog_manager.h"
#include "mongo/s/config.h"
#include "mongo/s/distlock.h"
@@ -55,20 +57,18 @@
namespace mongo {
using boost::scoped_ptr;
+ using boost::shared_ptr;
using std::endl;
using std::vector;
namespace {
- ScopedDbConnection* getConnectionForAuthzCollection(const NamespaceString& ns) {
- //
+ ScopedDbConnection* getConnectionForAuthzCollection(const NamespaceString& nss) {
// Note: The connection mechanism here is *not* ideal, and should not be used elsewhere.
// If the primary for the collection moves, this approach may throw rather than handle
// version exceptions.
- //
-
- DBConfigPtr config = grid.getDBConfig(ns.ns());
- Shard s = config->getShard(ns.ns());
+ auto config = uassertStatusOK(grid.catalogCache()->getDatabase(nss.db().toString()));
+ Shard s = config->getShard(nss.ns());
return new ScopedDbConnection(s.getConnString(), 30.0);
}