summaryrefslogtreecommitdiff
path: root/s/shard.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-05-03 11:18:27 -0400
committerEliot Horowitz <eliot@10gen.com>2010-05-03 11:18:27 -0400
commitd1082cf676e372970ce62254fabb61b9c6fca96b (patch)
tree60bd2711d559a438e85164ec2a64aeec461dd953 /s/shard.h
parentf68e9e023513d01e3c088e015047b6daec62f228 (diff)
downloadmongo-d1082cf676e372970ce62254fabb61b9c6fca96b.tar.gz
some refactoring for SERVER-946
Diffstat (limited to 's/shard.h')
-rw-r--r--s/shard.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/s/shard.h b/s/shard.h
index 19df0cd2848..a4571f8e90c 100644
--- a/s/shard.h
+++ b/s/shard.h
@@ -24,7 +24,8 @@
namespace mongo {
class ShardConnection;
-
+ class ShardStatus;
+
class Shard {
public:
Shard()
@@ -108,8 +109,17 @@ namespace mongo {
return runCommand( db , BSON( simple << 1 ) );
}
BSONObj runCommand( const string& db , const BSONObj& cmd );
-
- static void getAllShards( list<Shard>& all );
+
+ ShardStatus getStatus() const;
+
+ static void getAllShards( vector<Shard>& all );
+
+ /**
+ * picks a Shard for more load
+ */
+ static Shard pick();
+
+ static void reloadShardInfo();
static Shard EMPTY;
@@ -118,6 +128,12 @@ namespace mongo {
string _addr;
};
+ class ShardStatus {
+ private:
+ long long _mapped;
+ double _writeLock;
+ };
+
class ShardConnection {
public:
ShardConnection( const Shard * s )