diff options
author | Randolph Tan <randolph@10gen.com> | 2014-06-17 17:45:53 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2014-07-15 13:33:25 -0400 |
commit | fa1233fbe4a48ef0675820f381987f1df4f42f75 (patch) | |
tree | 2f16f64be178a8aa417414dabb5e23f72c13e276 /src/mongo/s/grid.h | |
parent | a78c439ba94e08ab6079e5575f1959c39c9beb87 (diff) | |
download | mongo-fa1233fbe4a48ef0675820f381987f1df4f42f75.tar.gz |
SERVER-14041 enhance secondaryThrottle parameter
Diffstat (limited to 'src/mongo/s/grid.h')
-rw-r--r-- | src/mongo/s/grid.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/mongo/s/grid.h b/src/mongo/s/grid.h index e68918abce8..7d4e2a575d5 100644 --- a/src/mongo/s/grid.h +++ b/src/mongo/s/grid.h @@ -35,7 +35,8 @@ #include "mongo/util/time_support.h" #include "mongo/util/concurrency/mutex.h" -#include "config.h" // DBConfigPtr +#include "mongo/s/config.h" // DBConfigPtr +#include "mongo/s/type_settings.h" namespace mongo { @@ -107,9 +108,24 @@ namespace mongo { bool knowAboutShard( const std::string& name ) const; /** - * @return true if the chunk balancing functionality is enabled + * Returns true if the balancer should be running. */ - bool shouldBalance( const std::string& ns = "", BSONObj* balancerDocOut = 0 ) const; + bool shouldBalance(const SettingsType& balancerSettings) const; + + /** + * Retrieve the balancer settings from the config server. + */ + bool getBalancerSettings(SettingsType* settings, string* errMsg) const; + + /** + * Returns true if the config server settings indicate that the balancer should be active. + */ + bool getConfigShouldBalance() const; + + /** + * Returns true if the given collection can be balanced. + */ + bool getCollShouldBalance(const std::string& ns) const; /** * @@ -149,14 +165,6 @@ 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 ); - - /** - * @param balancerDoc bson that may contain a marker to stop the balancer - * format { ... , stopped: [ "true" | "false" ] , ... } - * @return true if the marker is present and is set to true - */ - static bool _balancerStopped( const BSONObj& balancerDoc ); - }; extern Grid grid; |