diff options
author | Daniel Alabi <alabidan@gmail.com> | 2015-06-08 01:28:55 -0400 |
---|---|---|
committer | Daniel Alabi <alabidan@gmail.com> | 2015-06-09 16:06:41 -0400 |
commit | 2cb47c5cd49f8a7427c618000da2f19c426fb9f6 (patch) | |
tree | 51813771a567364c25d3ee5e6e6794dcf0326450 /src/mongo/s/config.h | |
parent | 037a5db982ca2f702cbef80b0a904124fa0d077d (diff) | |
download | mongo-2cb47c5cd49f8a7427c618000da2f19c426fb9f6.tar.gz |
SERVER-18815 Make Shard object non-copyable. Get rid of Shard::make(...) and Shard::reset(...)
Diffstat (limited to 'src/mongo/s/config.h')
-rw-r--r-- | src/mongo/s/config.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/s/config.h b/src/mongo/s/config.h index c45c9d9cc6d..33a901baa2b 100644 --- a/src/mongo/s/config.h +++ b/src/mongo/s/config.h @@ -105,10 +105,7 @@ namespace mongo { */ bool isShardingEnabled() const { return _shardingEnabled; } - /** - * Reference to the primary shard for this database. - */ - const Shard& getPrimary() const { return _primary; } + const ShardId& getPrimaryId() const { return _primaryId; } void enableSharding( bool save = true ); @@ -131,7 +128,10 @@ namespace mongo { boost::shared_ptr<ChunkManager> getChunkManager(const std::string& ns, bool reload = false, bool forceReload = false); boost::shared_ptr<ChunkManager> getChunkManagerIfExists(const std::string& ns, bool reload = false, bool forceReload = false); - const Shard& getShard( const std::string& ns ); + /** + * Returns shard id for primary shard for the database for which this DBConfig represents. + */ + const ShardId& getShardId(const std::string& ns); void setPrimary( const std::string& s ); @@ -140,7 +140,7 @@ namespace mongo { bool dropDatabase( std::string& errmsg ); - void getAllShards(std::set<Shard>& shards); + void getAllShardIds(std::set<ShardId>* shardIds); void getAllShardedCollections(std::set<std::string>& namespaces); protected: @@ -152,7 +152,7 @@ namespace mongo { */ bool _isSharded( const std::string& ns ); - bool _dropShardedCollections( int& num, std::set<Shard>& allServers , std::string& errmsg ); + bool _dropShardedCollections(int& num, std::set<ShardId>& shardIds, std::string& errmsg); bool _load(); bool _reload(); @@ -162,8 +162,8 @@ namespace mongo { // Name of the database which this entry caches const std::string _name; - // Primary shard name - Shard _primary; + // Primary shard id + ShardId _primaryId; // Whether sharding has been enabled for this database bool _shardingEnabled; |