diff options
author | Alberto Lerner <alerner@10gen.com> | 2010-06-14 16:11:23 -0400 |
---|---|---|
committer | Alberto Lerner <alerner@10gen.com> | 2010-06-14 16:11:23 -0400 |
commit | 14f272d6722344ec34a76fb50ca47e6170854667 (patch) | |
tree | f5b0a551d9242e8631cc9aead607eca0131b9332 /s/balancer_policy.h | |
parent | 8a49ab1ce166a8e1a6d07efc1d064ea1e07c9993 (diff) | |
download | mongo-14f272d6722344ec34a76fb50ca47e6170854667.tar.gz |
SERVER-940 Balancer policy will pick a draining shard, if there is one
Diffstat (limited to 's/balancer_policy.h')
-rw-r--r-- | s/balancer_policy.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/s/balancer_policy.h b/s/balancer_policy.h index d5333d3e658..b78e7da54ac 100644 --- a/s/balancer_policy.h +++ b/s/balancer_policy.h @@ -39,7 +39,6 @@ namespace mongo { * is { }. * @param balancedLastTime is the number of chunks effectively moved in the last round. * @returns NULL or ChunkInfo of the best move to make towards balacing the collection. - * */ static ChunkInfo* balance( const string& ns, const map< string, BSONObj>& shardLimitsMap, const map< string,vector<BSONObj> >& shardToChunksMap, int balancedLastTime ); @@ -48,7 +47,17 @@ namespace mongo { static BSONObj pickChunk( const vector<BSONObj>& from, const vector<BSONObj>& to ); - static bool isReceiver( const string& shard, const map< string,BSONObj>& shardLimitsMap ); + /** + * Returns true if a shard can receive new chunks based on that shard's 'shardLimits' information. + * Expects the optional fields "maxSize", can in size in MB, and "usedSize", currently used size in MB, + * on 'shardLimits'. + */ + static bool isReceiver( BSONObj shardLimits ); + + /** + * Returns true if 'shardLimist' contains a field "draining". + */ + static bool isDraining( BSONObj shardLimits ); }; struct BalancerPolicy::ChunkInfo { |