summaryrefslogtreecommitdiff
path: root/s/config.h
diff options
context:
space:
mode:
authorAlberto Lerner <alerner@10gen.com>2010-07-28 14:24:55 -0400
committerAlberto Lerner <alerner@10gen.com>2010-07-28 14:24:55 -0400
commitbceacf2544acfb6c3509ca8db791e90fe41c8599 (patch)
tree5c210716aa3c6911c96f55d8a6370015a76b4d5a /s/config.h
parent0e82f323cc1be77401021486f459e14cef359faa (diff)
downloadmongo-bceacf2544acfb6c3509ca8db791e90fe41c8599.tar.gz
SERVER-1292 A bit more prep, separate grid.{h,cpp} from config
Diffstat (limited to 's/config.h')
-rw-r--r--s/config.h75
1 files changed, 0 insertions, 75 deletions
diff --git a/s/config.h b/s/config.h
index cbefe7283ea..c1767743acd 100644
--- a/s/config.h
+++ b/s/config.h
@@ -51,7 +51,6 @@ namespace mongo {
static BSONField<long long> currSize;
};
- class Grid;
class ConfigServer;
class DBConfig;
@@ -59,7 +58,6 @@ namespace mongo {
extern DBConfigPtr configServerPtr;
extern ConfigServer& configServer;
- extern Grid grid;
class ChunkManager;
typedef shared_ptr<ChunkManager> ChunkManagerPtr;
@@ -192,82 +190,9 @@ namespace mongo {
mongo::mutex _lock; // TODO: change to r/w lock ??
- friend class Grid;
friend class ChunkManager;
};
- /**
- * stores meta-information about the grid
- * TODO: used shard_ptr for DBConfig pointers
- */
- class Grid {
- public:
- Grid() : _lock( "Grid" ) , _allowLocalShard( true ) { }
-
- /**
- * gets the config the db.
- * will return an empty DBConfig if not in db already
- */
- DBConfigPtr getDBConfig( string ns , bool create=true );
-
- /**
- * removes db entry.
- * on next getDBConfig call will fetch from db
- */
- void removeDB( string db );
-
- /**
- * @return true if shards and config servers are allowed to use 'localhost' in address
- */
- bool allowLocalHost() const;
-
- /**
- * @param whether to allow shards and config servers to use 'localhost' in address
- */
- void setAllowLocalHost( bool allow );
-
- /**
- *
- * addShard will create a new shard in the grid. It expects a mongod process to be runing
- * on the provided address.
- * TODO - add the mongod's databases to the grid
- *
- * @param name is an optional string with the name of the shard. if ommited, grid will
- * generate one and update the parameter.
- * @param host is the complete address of the machine where the shard will be
- * @param maxSize is the optional space quota in bytes. Zeros means there's no limitation to
- * space usage
- * @param errMsg is the error description in case the operation failed.
- * @return true if shard was successfully added.
- */
- bool addShard( string* name , const string& host , long long maxSize , string* errMsg );
-
- /**
- * @return true if the config database knows about a host 'name'
- */
- bool knowAboutShard( const string& name ) const;
-
- /**
- * @return true if the chunk balancing functionality is enabled
- */
- bool shouldBalance() const;
-
- unsigned long long getNextOpTime() const;
-
- private:
- mongo::mutex _lock; // protects _databases; TODO: change to r/w lock ??
- map<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)
- * 10000 shard
- */
- bool _getNewShardName( string* name ) const;
-
- };
-
class ConfigServer : public DBConfig {
public: