From df85a204a7d56cc3901f817e4bb7519103230abe Mon Sep 17 00:00:00 2001 From: Kaloian Manassiev Date: Thu, 5 Mar 2015 18:06:22 -0500 Subject: SERVER-17496 Move ChunkManager to separate file --- src/mongo/s/grid.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/mongo/s/grid.h') diff --git a/src/mongo/s/grid.h b/src/mongo/s/grid.h index a63d0e970d9..1543e354567 100644 --- a/src/mongo/s/grid.h +++ b/src/mongo/s/grid.h @@ -35,7 +35,7 @@ #include "mongo/util/time_support.h" #include "mongo/util/concurrency/mutex.h" -#include "mongo/s/config.h" // DBConfigPtr +#include "mongo/s/config.h" namespace mongo { @@ -47,7 +47,8 @@ namespace mongo { */ class Grid { public: - Grid() : _lock( "Grid" ) , _allowLocalShard( true ) { } + Grid(); + ~Grid(); /** * gets the config the db. @@ -156,10 +157,6 @@ namespace mongo { static bool _inBalancingWindow( const BSONObj& balancerDoc , const boost::posix_time::ptime& now ); private: - mongo::mutex _lock; // protects _databases; TODO: change to r/w lock ?? - std::map _databases; // maps ns to DBConfig's - bool _allowLocalShard; // can 'localhost' be used in shard addresses? - /** * @param name is the chose name for the shard. Parameter is mandatory. * @return true if it managed to generate a shard name. May return false if (currently) @@ -171,6 +168,14 @@ namespace mongo { * @return whether a give dbname is used for shard "local" databases (e.g., admin or local) */ static bool _isSpecialLocalDB( const std::string& dbName ); + + + // Databases catalog map and mutex to protect it + mongo::mutex _lock; + std::map _databases; + + // can 'localhost' be used in shard addresses? + bool _allowLocalShard; }; extern Grid grid; -- cgit v1.2.1