diff options
Diffstat (limited to 'src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp')
-rw-r--r-- | src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp | 88 |
1 files changed, 43 insertions, 45 deletions
diff --git a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp index 0164fe3cc15..bd8c0332bb1 100644 --- a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp +++ b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp @@ -36,53 +36,51 @@ namespace mongo { namespace { - class CmdReplSetGetStatus : public Command { - public: - CmdReplSetGetStatus() : Command("replSetGetStatus") { } - - virtual bool slaveOk() const { - return true; - } - - virtual bool adminOnly() const { - return true; - } - - virtual bool isWriteCommandForConfigServer() const { - return false; - } - - virtual void help(std::stringstream& help) const { - help << "Not supported through mongos"; +class CmdReplSetGetStatus : public Command { +public: + CmdReplSetGetStatus() : Command("replSetGetStatus") {} + + virtual bool slaveOk() const { + return true; + } + + virtual bool adminOnly() const { + return true; + } + + virtual bool isWriteCommandForConfigServer() const { + return false; + } + + virtual void help(std::stringstream& help) const { + help << "Not supported through mongos"; + } + + virtual Status checkAuthForCommand(ClientBasic* client, + const std::string& dbname, + const BSONObj& cmdObj) { + // Require no auth since this command isn't supported in mongos + return Status::OK(); + } + + virtual bool run(OperationContext* txn, + const std::string& dbname, + BSONObj& cmdObj, + int options, + std::string& errmsg, + BSONObjBuilder& result) { + if (cmdObj["forShell"].trueValue()) { + LastError::get(cc()).disable(); + ClusterLastErrorInfo::get(cc()).disableForCommand(); } - virtual Status checkAuthForCommand(ClientBasic* client, - const std::string& dbname, - const BSONObj& cmdObj) { + errmsg = "replSetGetStatus is not supported through mongos"; + result.append("info", "mongos"); - // Require no auth since this command isn't supported in mongos - return Status::OK(); - } - - virtual bool run(OperationContext* txn, - const std::string& dbname, - BSONObj& cmdObj, - int options, - std::string& errmsg, - BSONObjBuilder& result) { - - if (cmdObj["forShell"].trueValue()) { - LastError::get(cc()).disable(); - ClusterLastErrorInfo::get(cc()).disableForCommand(); - } - - errmsg = "replSetGetStatus is not supported through mongos"; - result.append("info", "mongos"); - - return false; - } + return false; + } - } cmdReplSetGetStatus; +} cmdReplSetGetStatus; -} // namespace -} // namespace mongo +} // namespace +} // namespace mongo |