diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-03-05 18:06:22 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-03-09 11:46:34 -0400 |
commit | df85a204a7d56cc3901f817e4bb7519103230abe (patch) | |
tree | efbdf6cd9826f012112642300f91bd8c19da4cd0 /src/mongo/s/grid.h | |
parent | 5c2ec43c0a8d20283968165d2e004644b0f23390 (diff) | |
download | mongo-df85a204a7d56cc3901f817e4bb7519103230abe.tar.gz |
SERVER-17496 Move ChunkManager to separate file
Diffstat (limited to 'src/mongo/s/grid.h')
-rw-r--r-- | src/mongo/s/grid.h | 17 |
1 files changed, 11 insertions, 6 deletions
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<std::string, DBConfigPtr > _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<std::string, DBConfigPtr> _databases; + + // can 'localhost' be used in shard addresses? + bool _allowLocalShard; }; extern Grid grid; |