diff options
Diffstat (limited to 'src/mongo/s/client/shard.h')
-rw-r--r-- | src/mongo/s/client/shard.h | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/src/mongo/s/client/shard.h b/src/mongo/s/client/shard.h index 78e73a6ac36..72df5387852 100644 --- a/src/mongo/s/client/shard.h +++ b/src/mongo/s/client/shard.h @@ -30,7 +30,7 @@ #include <boost/shared_ptr.hpp> -#include "mongo/client/dbclientinterface.h" +#include "mongo/client/connection_string.h" namespace mongo { @@ -126,25 +126,11 @@ namespace mongo { bool ok() const { return _addr.size() > 0; } - // Set internal to true to run the command with internal authentication privileges. - BSONObj runCommand( const std::string& db , const std::string& simple ) const { - return runCommand( db , BSON( simple << 1 ) ); - } - BSONObj runCommand( const std::string& db , const BSONObj& cmd ) const ; - - /** - * Runs a command on this shard. This method signature matches that of - * the connection on which this method relies upon. - */ - bool runCommand(const std::string& db, - const BSONObj& cmd, - BSONObj& res) const; + BSONObj runCommand(const std::string& db, const std::string& simple) const; + BSONObj runCommand(const std::string& db, const BSONObj& cmd) const; - bool runCommand(const std::string& db, - const std::string& simple, - BSONObj& res) const { - return runCommand(db, BSON(simple << 1), res); - } + bool runCommand(const std::string& db, const std::string& simple, BSONObj& res) const; + bool runCommand(const std::string& db, const BSONObj& cmd, BSONObj& res) const; /** * Returns the version string from the shard based from the serverStatus command result. @@ -163,13 +149,12 @@ namespace mongo { /** * mostly for replica set - * retursn true if node is the shard + * retursn true if node is the shard * of if the replica set contains node */ bool containsNode( const std::string& node ) const; static void getAllShards( std::vector<Shard>& all ); - static void printShardInfo( std::ostream& out ); static Shard lookupRSName( const std::string& name); /** @@ -203,17 +188,11 @@ namespace mongo { class ShardStatus { public: - ShardStatus(const Shard& shard, long long dataSizeBytes, const std::string& version); - friend std::ostream& operator << (std::ostream& out, const ShardStatus& s) { - out << s.toString(); - return out; - } - std::string toString() const { std::stringstream ss; - ss << "shard: " << _shard + ss << "shard: " << _shard.toString() << " dataSizeBytes: " << _dataSizeBytes << " version: " << _mongoVersion; return ss.str(); |