diff options
147 files changed, 445 insertions, 442 deletions
diff --git a/src/mongo/db/auth/sasl_commands.cpp b/src/mongo/db/auth/sasl_commands.cpp index 41b63abc5c0..df74cea7436 100644 --- a/src/mongo/db/auth/sasl_commands.cpp +++ b/src/mongo/db/auth/sasl_commands.cpp @@ -62,7 +62,7 @@ using std::stringstream; const bool autoAuthorizeDefault = true; -class CmdSaslStart : public Command { +class CmdSaslStart : public BasicCommand { public: CmdSaslStart(); virtual ~CmdSaslStart(); @@ -91,7 +91,7 @@ public: } }; -class CmdSaslContinue : public Command { +class CmdSaslContinue : public BasicCommand { public: CmdSaslContinue(); virtual ~CmdSaslContinue(); @@ -254,7 +254,7 @@ Status doSaslContinue(const Client* client, return doSaslStep(client, session, cmdObj, result); } -CmdSaslStart::CmdSaslStart() : Command(saslStartCommandName) {} +CmdSaslStart::CmdSaslStart() : BasicCommand(saslStartCommandName) {} CmdSaslStart::~CmdSaslStart() {} void CmdSaslStart::help(std::stringstream& os) const { @@ -302,7 +302,7 @@ bool CmdSaslStart::run(OperationContext* opCtx, return status.isOK(); } -CmdSaslContinue::CmdSaslContinue() : Command(saslContinueCommandName) {} +CmdSaslContinue::CmdSaslContinue() : BasicCommand(saslContinueCommandName) {} CmdSaslContinue::~CmdSaslContinue() {} void CmdSaslContinue::help(std::stringstream& os) const { diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index 96cf930d4c0..c512c2bcd98 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -577,4 +577,6 @@ private: ServerStatusMetricField<Counter64> _commandsFailedMetric; }; +using BasicCommand = Command; + } // namespace mongo diff --git a/src/mongo/db/commands/apply_ops_cmd.cpp b/src/mongo/db/commands/apply_ops_cmd.cpp index 9b142037601..ca0266908dd 100644 --- a/src/mongo/db/commands/apply_ops_cmd.cpp +++ b/src/mongo/db/commands/apply_ops_cmd.cpp @@ -61,9 +61,9 @@ using std::stringstream; namespace { -class ApplyOpsCmd : public Command { +class ApplyOpsCmd : public BasicCommand { public: - ApplyOpsCmd() : Command("applyOps") {} + ApplyOpsCmd() : BasicCommand("applyOps") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp index dfb5ca174c2..c7e6d1160aa 100644 --- a/src/mongo/db/commands/authentication_commands.cpp +++ b/src/mongo/db/commands/authentication_commands.cpp @@ -97,9 +97,9 @@ void CmdAuthenticate::disableAuthMechanism(std::string authMechanism) { where <key> is md5(<nonce_str><username><pwd_digest_str>) as a string */ -class CmdGetNonce : public Command { +class CmdGetNonce : public BasicCommand { public: - CmdGetNonce() : Command("getnonce"), _random(SecureRandom::create()) {} + CmdGetNonce() : BasicCommand("getnonce"), _random(SecureRandom::create()) {} virtual bool slaveOk() const { return true; @@ -360,7 +360,7 @@ Status CmdAuthenticate::_authenticateX509(OperationContext* opCtx, #endif CmdAuthenticate cmdAuthenticate; -class CmdLogout : public Command { +class CmdLogout : public BasicCommand { public: virtual bool slaveOk() const { return true; @@ -374,7 +374,7 @@ public: virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; } - CmdLogout() : Command("logout") {} + CmdLogout() : BasicCommand("logout") {} bool run(OperationContext* opCtx, const string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/db/commands/authentication_commands.h b/src/mongo/db/commands/authentication_commands.h index f6b0c66e147..5bb01ad9fae 100644 --- a/src/mongo/db/commands/authentication_commands.h +++ b/src/mongo/db/commands/authentication_commands.h @@ -36,7 +36,7 @@ namespace mongo { -class CmdAuthenticate : public Command { +class CmdAuthenticate : public BasicCommand { public: static void disableAuthMechanism(std::string authMechanism); @@ -54,7 +54,7 @@ public: std::vector<Privilege>* out) {} // No auth required virtual void redactForLogging(mutablebson::Document* cmdObj); - CmdAuthenticate() : Command("authenticate") {} + CmdAuthenticate() : BasicCommand("authenticate") {} bool run(OperationContext* opCtx, const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/db/commands/clone.cpp b/src/mongo/db/commands/clone.cpp index 14585aedcd4..97744cedf86 100644 --- a/src/mongo/db/commands/clone.cpp +++ b/src/mongo/db/commands/clone.cpp @@ -52,9 +52,9 @@ using std::stringstream; Note: doesn't work with authentication enabled, except as internal operation or for old-style users for backwards compatibility. */ -class CmdClone : public Command { +class CmdClone : public BasicCommand { public: - CmdClone() : Command("clone") {} + CmdClone() : BasicCommand("clone") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/db/commands/clone_collection.cpp b/src/mongo/db/commands/clone_collection.cpp index c1ca464ea4c..3eea32aa1fc 100644 --- a/src/mongo/db/commands/clone_collection.cpp +++ b/src/mongo/db/commands/clone_collection.cpp @@ -59,9 +59,9 @@ using std::string; using std::stringstream; using std::endl; -class CmdCloneCollection : public Command { +class CmdCloneCollection : public BasicCommand { public: - CmdCloneCollection() : Command("cloneCollection") {} + CmdCloneCollection() : BasicCommand("cloneCollection") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp index b749b2b1b23..6a56cbaf144 100644 --- a/src/mongo/db/commands/collection_to_capped.cpp +++ b/src/mongo/db/commands/collection_to_capped.cpp @@ -49,9 +49,9 @@ using std::unique_ptr; using std::string; using std::stringstream; -class CmdCloneCollectionAsCapped : public Command { +class CmdCloneCollectionAsCapped : public BasicCommand { public: - CmdCloneCollectionAsCapped() : Command("cloneCollectionAsCapped") {} + CmdCloneCollectionAsCapped() : BasicCommand("cloneCollectionAsCapped") {} virtual bool slaveOk() const { return false; } @@ -148,9 +148,9 @@ public: This command is not highly used, and is not currently supported with sharded environments. */ -class CmdConvertToCapped : public Command { +class CmdConvertToCapped : public BasicCommand { public: - CmdConvertToCapped() : Command("convertToCapped") {} + CmdConvertToCapped() : BasicCommand("convertToCapped") {} virtual bool slaveOk() const { return false; } diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp index e7c914ef0c4..492b9c46184 100644 --- a/src/mongo/db/commands/compact.cpp +++ b/src/mongo/db/commands/compact.cpp @@ -53,7 +53,7 @@ namespace mongo { using std::string; using std::stringstream; -class CompactCmd : public Command { +class CompactCmd : public BasicCommand { public: virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; @@ -84,7 +84,7 @@ public: " validate - check records are noncorrupt before adding to newly compacting " "extents. slower but safer (defaults to true in this version)\n"; } - CompactCmd() : Command("compact") {} + CompactCmd() : BasicCommand("compact") {} virtual bool run(OperationContext* opCtx, const string& db, diff --git a/src/mongo/db/commands/conn_pool_stats.cpp b/src/mongo/db/commands/conn_pool_stats.cpp index 0799ae12c48..55047a55109 100644 --- a/src/mongo/db/commands/conn_pool_stats.cpp +++ b/src/mongo/db/commands/conn_pool_stats.cpp @@ -49,9 +49,9 @@ namespace mongo { namespace { -class PoolStats final : public Command { +class PoolStats final : public BasicCommand { public: - PoolStats() : Command("connPoolStats") {} + PoolStats() : BasicCommand("connPoolStats") {} void help(std::stringstream& help) const override { help << "stats about connections between servers in a replica set or sharded cluster."; diff --git a/src/mongo/db/commands/conn_pool_sync.cpp b/src/mongo/db/commands/conn_pool_sync.cpp index 32bdda9bffa..b1ce5b26dcf 100644 --- a/src/mongo/db/commands/conn_pool_sync.cpp +++ b/src/mongo/db/commands/conn_pool_sync.cpp @@ -37,9 +37,9 @@ namespace mongo { -class PoolFlushCmd : public Command { +class PoolFlushCmd : public BasicCommand { public: - PoolFlushCmd() : Command("connPoolSync", "connpoolsync") {} + PoolFlushCmd() : BasicCommand("connPoolSync", "connpoolsync") {} virtual void help(std::stringstream& help) const { help << "internal"; } diff --git a/src/mongo/db/commands/connection_status.cpp b/src/mongo/db/commands/connection_status.cpp index 10cd52c4815..9454b8769b4 100644 --- a/src/mongo/db/commands/connection_status.cpp +++ b/src/mongo/db/commands/connection_status.cpp @@ -38,9 +38,9 @@ namespace mongo { using std::string; using std::stringstream; -class CmdConnectionStatus : public Command { +class CmdConnectionStatus : public BasicCommand { public: - CmdConnectionStatus() : Command("connectionStatus") {} + CmdConnectionStatus() : BasicCommand("connectionStatus") {} virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/copydb.cpp b/src/mongo/db/commands/copydb.cpp index c06c855e270..4755d032916 100644 --- a/src/mongo/db/commands/copydb.cpp +++ b/src/mongo/db/commands/copydb.cpp @@ -87,9 +87,9 @@ using std::stringstream; * NOTE: Since internal cluster auth works differently, "copydb" currently doesn't work between * shards in a cluster when auth is enabled. See SERVER-13080. */ -class CmdCopyDb : public Command { +class CmdCopyDb : public BasicCommand { public: - CmdCopyDb() : Command("copydb") {} + CmdCopyDb() : BasicCommand("copydb") {} virtual bool adminOnly() const { return true; diff --git a/src/mongo/db/commands/copydb_start_commands.cpp b/src/mongo/db/commands/copydb_start_commands.cpp index e319ad03f7e..fbb3d485180 100644 --- a/src/mongo/db/commands/copydb_start_commands.cpp +++ b/src/mongo/db/commands/copydb_start_commands.cpp @@ -68,9 +68,9 @@ std::unique_ptr<DBClientBase>& CopyDbAuthConnection::forClient(Client* client) { * nonce from the source of a "copydb" operation for authentication purposes. See the * description of the "copydb" command below. */ -class CmdCopyDbGetNonce : public Command { +class CmdCopyDbGetNonce : public BasicCommand { public: - CmdCopyDbGetNonce() : Command("copydbgetnonce") {} + CmdCopyDbGetNonce() : BasicCommand("copydbgetnonce") {} virtual bool adminOnly() const { return true; @@ -140,9 +140,9 @@ public: * Run against the mongod that is the intended target for the "copydb" command. Used to * initialize a SASL auth session for a "copydb" operation for authentication purposes. */ -class CmdCopyDbSaslStart : public Command { +class CmdCopyDbSaslStart : public BasicCommand { public: - CmdCopyDbSaslStart() : Command("copydbsaslstart") {} + CmdCopyDbSaslStart() : BasicCommand("copydbsaslstart") {} virtual bool adminOnly() const { return true; diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp index 2a3db9a0341..dcd60503a80 100644 --- a/src/mongo/db/commands/count_cmd.cpp +++ b/src/mongo/db/commands/count_cmd.cpp @@ -54,9 +54,9 @@ using std::stringstream; /** * Implements the MongoD side of the count command. */ -class CmdCount : public Command { +class CmdCount : public BasicCommand { public: - CmdCount() : Command("count") {} + CmdCount() : BasicCommand("count") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/commands/cpuload.cpp b/src/mongo/db/commands/cpuload.cpp index f8ac54313e6..996b6e11b46 100644 --- a/src/mongo/db/commands/cpuload.cpp +++ b/src/mongo/db/commands/cpuload.cpp @@ -39,9 +39,9 @@ using std::string; using std::stringstream; // Testing-only, enabled via command line. -class CPULoadCommand : public Command { +class CPULoadCommand : public BasicCommand { public: - CPULoadCommand() : Command("cpuload") {} + CPULoadCommand() : BasicCommand("cpuload") {} virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/cpuprofile.cpp b/src/mongo/db/commands/cpuprofile.cpp index c5ec73204a9..0586c646156 100644 --- a/src/mongo/db/commands/cpuprofile.cpp +++ b/src/mongo/db/commands/cpuprofile.cpp @@ -68,9 +68,9 @@ namespace { /** * Common code for the implementation of cpu profiler commands. */ -class CpuProfilerCommand : public Command { +class CpuProfilerCommand : public BasicCommand { public: - CpuProfilerCommand(char const* name) : Command(name) {} + CpuProfilerCommand(char const* name) : BasicCommand(name) {} virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp index 7d0968ccd72..563a173d7b9 100644 --- a/src/mongo/db/commands/create_indexes.cpp +++ b/src/mongo/db/commands/create_indexes.cpp @@ -208,9 +208,9 @@ StatusWith<std::vector<BSONObj>> resolveCollectionDefaultProperties( /** * { createIndexes : "bar", indexes : [ { ns : "test.bar", key : { x : 1 }, name: "x_1" } ] } */ -class CmdCreateIndex : public Command { +class CmdCreateIndex : public BasicCommand { public: - CmdCreateIndex() : Command(kCommandName) {} + CmdCreateIndex() : BasicCommand(kCommandName) {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return true; diff --git a/src/mongo/db/commands/current_op_common.h b/src/mongo/db/commands/current_op_common.h index b6bc596df71..9fb143bd271 100644 --- a/src/mongo/db/commands/current_op_common.h +++ b/src/mongo/db/commands/current_op_common.h @@ -37,9 +37,9 @@ namespace mongo { -class CurrentOpCommandBase : public Command { +class CurrentOpCommandBase : public BasicCommand { public: - CurrentOpCommandBase() : Command("currentOp") {} + CurrentOpCommandBase() : BasicCommand("currentOp") {} virtual ~CurrentOpCommandBase() {} diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp index 54064c34fee..ac68b36e727 100644 --- a/src/mongo/db/commands/dbcommands.cpp +++ b/src/mongo/db/commands/dbcommands.cpp @@ -146,7 +146,7 @@ public: } cmdShutdownMongoD; -class CmdDropDatabase : public Command { +class CmdDropDatabase : public BasicCommand { public: virtual void help(stringstream& help) const { help << "drop (delete) this database"; @@ -168,7 +168,7 @@ public: return true; } - CmdDropDatabase() : Command("dropDatabase") {} + CmdDropDatabase() : BasicCommand("dropDatabase") {} bool run(OperationContext* opCtx, const string& dbname, @@ -211,7 +211,7 @@ public: } cmdDropDatabase; -class CmdRepairDatabase : public Command { +class CmdRepairDatabase : public BasicCommand { public: virtual bool slaveOk() const { return true; @@ -236,7 +236,7 @@ public: out->push_back(Privilege(ResourcePattern::forDatabaseName(dbname), actions)); } - CmdRepairDatabase() : Command("repairDatabase") {} + CmdRepairDatabase() : BasicCommand("repairDatabase") {} bool run(OperationContext* opCtx, const string& dbname, @@ -296,7 +296,7 @@ public: todo: how do we handle profiling information put in the db with replication? sensibly or not? */ -class CmdProfile : public Command { +class CmdProfile : public BasicCommand { public: virtual bool slaveOk() const { return true; @@ -339,7 +339,7 @@ public: return Status(ErrorCodes::Unauthorized, "unauthorized"); } - CmdProfile() : Command("profile") {} + CmdProfile() : BasicCommand("profile") {} bool run(OperationContext* opCtx, const string& dbname, @@ -395,12 +395,12 @@ public: } cmdProfile; -class CmdDiagLogging : public Command { +class CmdDiagLogging : public BasicCommand { public: virtual bool slaveOk() const { return true; } - CmdDiagLogging() : Command("diagLogging") {} + CmdDiagLogging() : BasicCommand("diagLogging") {} bool adminOnly() const { return true; } @@ -455,9 +455,9 @@ public: } cmddiaglogging; /* drop collection */ -class CmdDrop : public Command { +class CmdDrop : public BasicCommand { public: - CmdDrop() : Command("drop") {} + CmdDrop() : BasicCommand("drop") {} virtual bool slaveOk() const { return false; } @@ -511,9 +511,9 @@ public: } cmdDrop; /* create collection */ -class CmdCreate : public Command { +class CmdCreate : public BasicCommand { public: - CmdCreate() : Command("create") {} + CmdCreate() : BasicCommand("create") {} virtual bool slaveOk() const { return false; } @@ -628,9 +628,9 @@ public: } cmdCreate; -class CmdFileMD5 : public Command { +class CmdFileMD5 : public BasicCommand { public: - CmdFileMD5() : Command("filemd5") {} + CmdFileMD5() : BasicCommand("filemd5") {} virtual bool slaveOk() const { return true; @@ -803,13 +803,13 @@ public: } cmdFileMD5; -class CmdDatasize : public Command { +class CmdDatasize : public BasicCommand { virtual string parseNs(const string& dbname, const BSONObj& cmdObj) const { return parseNsFullyQualified(dbname, cmdObj); } public: - CmdDatasize() : Command("dataSize", "datasize") {} + CmdDatasize() : BasicCommand("dataSize", "datasize") {} virtual bool slaveOk() const { return true; @@ -957,9 +957,9 @@ public: } cmdDatasize; -class CollectionStats : public Command { +class CollectionStats : public BasicCommand { public: - CollectionStats() : Command("collStats", "collstats") {} + CollectionStats() : BasicCommand("collStats", "collstats") {} virtual bool slaveOk() const { return true; @@ -1005,9 +1005,9 @@ public: } cmdCollectionStats; -class CollectionModCommand : public Command { +class CollectionModCommand : public BasicCommand { public: - CollectionModCommand() : Command("collMod") {} + CollectionModCommand() : BasicCommand("collMod") {} virtual bool slaveOk() const { return false; @@ -1040,9 +1040,9 @@ public: } collectionModCommand; -class DBStats : public Command { +class DBStats : public BasicCommand { public: - DBStats() : Command("dbStats", "dbstats") {} + DBStats() : BasicCommand("dbStats", "dbstats") {} virtual bool slaveOk() const { return true; @@ -1133,9 +1133,9 @@ public: } cmdDBStats; /* Returns client's uri */ -class CmdWhatsMyUri : public Command { +class CmdWhatsMyUri : public BasicCommand { public: - CmdWhatsMyUri() : Command("whatsmyuri") {} + CmdWhatsMyUri() : BasicCommand("whatsmyuri") {} virtual bool slaveOk() const { return true; } @@ -1158,9 +1158,9 @@ public: } } cmdWhatsMyUri; -class AvailableQueryOptions : public Command { +class AvailableQueryOptions : public BasicCommand { public: - AvailableQueryOptions() : Command("availableQueryOptions", "availablequeryoptions") {} + AvailableQueryOptions() : BasicCommand("availableQueryOptions", "availablequeryoptions") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp index b043066598a..b288be37c4d 100644 --- a/src/mongo/db/commands/dbhash.cpp +++ b/src/mongo/db/commands/dbhash.cpp @@ -52,9 +52,9 @@ namespace mongo { namespace { -class DBHashCmd : public Command { +class DBHashCmd : public BasicCommand { public: - DBHashCmd() : Command("dbHash", "dbhash") {} + DBHashCmd() : BasicCommand("dbHash", "dbhash") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp index ba72b5cd7a6..62d21c239e9 100644 --- a/src/mongo/db/commands/distinct.cpp +++ b/src/mongo/db/commands/distinct.cpp @@ -71,9 +71,9 @@ using std::stringstream; namespace dps = ::mongo::dotted_path_support; -class DistinctCommand : public Command { +class DistinctCommand : public BasicCommand { public: - DistinctCommand() : Command("distinct") {} + DistinctCommand() : BasicCommand("distinct") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/db/commands/driverHelpers.cpp b/src/mongo/db/commands/driverHelpers.cpp index ae169abd8b6..589c2303bdb 100644 --- a/src/mongo/db/commands/driverHelpers.cpp +++ b/src/mongo/db/commands/driverHelpers.cpp @@ -52,9 +52,9 @@ namespace mongo { using std::string; -class BasicDriverHelper : public Command { +class BasicDriverHelper : public BasicCommand { public: - BasicDriverHelper(const char* name) : Command(name) {} + BasicDriverHelper(const char* name) : BasicCommand(name) {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp index e970705d9f1..42a16dad2ab 100644 --- a/src/mongo/db/commands/drop_indexes.cpp +++ b/src/mongo/db/commands/drop_indexes.cpp @@ -64,7 +64,7 @@ using std::stringstream; using std::vector; /* "dropIndexes" is now the preferred form - "deleteIndexes" deprecated */ -class CmdDropIndexes : public Command { +class CmdDropIndexes : public BasicCommand { public: virtual bool slaveOk() const { return false; @@ -83,7 +83,7 @@ public: out->push_back(Privilege(parseResourcePattern(dbname, cmdObj), actions)); } - CmdDropIndexes() : Command("dropIndexes", "deleteIndexes") {} + CmdDropIndexes() : BasicCommand("dropIndexes", "deleteIndexes") {} bool run(OperationContext* opCtx, const string& dbname, const BSONObj& jsobj, @@ -95,7 +95,7 @@ public: } cmdDropIndexes; -class CmdReIndex : public Command { +class CmdReIndex : public BasicCommand { public: virtual bool slaveOk() const { return true; @@ -113,7 +113,7 @@ public: actions.addAction(ActionType::reIndex); out->push_back(Privilege(parseResourcePattern(dbname, cmdObj), actions)); } - CmdReIndex() : Command("reIndex") {} + CmdReIndex() : BasicCommand("reIndex") {} bool run(OperationContext* opCtx, const string& dbname, diff --git a/src/mongo/db/commands/eval.cpp b/src/mongo/db/commands/eval.cpp index dbebb016e16..bb7e13f1cfb 100644 --- a/src/mongo/db/commands/eval.cpp +++ b/src/mongo/db/commands/eval.cpp @@ -152,7 +152,7 @@ bool dbEval(OperationContext* opCtx, } -class CmdEval : public Command { +class CmdEval : public BasicCommand { public: virtual bool slaveOk() const { return false; @@ -172,7 +172,7 @@ public: RoleGraph::generateUniversalPrivileges(out); } - CmdEval() : Command("eval", "$eval") {} + CmdEval() : BasicCommand("eval", "$eval") {} bool run(OperationContext* opCtx, const string& dbname, diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp index 92f56e864f5..ec07e0f5106 100644 --- a/src/mongo/db/commands/explain_cmd.cpp +++ b/src/mongo/db/commands/explain_cmd.cpp @@ -51,9 +51,9 @@ namespace { * This command like a dispatcher: it just retrieves a pointer to the nested command and invokes * its explain() implementation. */ -class CmdExplain : public Command { +class CmdExplain : public BasicCommand { public: - CmdExplain() : Command("explain") {} + CmdExplain() : BasicCommand("explain") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/commands/fail_point_cmd.cpp b/src/mongo/db/commands/fail_point_cmd.cpp index 17d447550e5..74da22e059c 100644 --- a/src/mongo/db/commands/fail_point_cmd.cpp +++ b/src/mongo/db/commands/fail_point_cmd.cpp @@ -64,9 +64,9 @@ using std::stringstream; * data: <Object> // optional arbitrary object to store. * } */ -class FaultInjectCmd : public Command { +class FaultInjectCmd : public BasicCommand { public: - FaultInjectCmd() : Command("configureFailPoint") {} + FaultInjectCmd() : BasicCommand("configureFailPoint") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp index 07d8dd7eaea..d83a44beec4 100644 --- a/src/mongo/db/commands/find_and_modify.cpp +++ b/src/mongo/db/commands/find_and_modify.cpp @@ -217,7 +217,7 @@ void recordStatsForTopCommand(OperationContext* opCtx) { } // namespace /* Find and Modify an object returning either the old (default) or new value*/ -class CmdFindAndModify : public Command { +class CmdFindAndModify : public BasicCommand { public: void help(std::stringstream& help) const override { help << "{ findAndModify: \"collection\", query: {processed:false}, update: {$set: " @@ -228,7 +228,7 @@ public: "Output is in the \"value\" field\n"; } - CmdFindAndModify() : Command("findAndModify", "findandmodify") {} + CmdFindAndModify() : BasicCommand("findAndModify", "findandmodify") {} bool slaveOk() const override { return false; diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index c597fbcc0e9..392ccfcb066 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -67,11 +67,11 @@ const char kTermField[] = "term"; /** * A command for running .find() queries. */ -class FindCmd : public Command { +class FindCmd : public BasicCommand { MONGO_DISALLOW_COPYING(FindCmd); public: - FindCmd() : Command("find") {} + FindCmd() : BasicCommand("find") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp index e776b10a451..b266281f19b 100644 --- a/src/mongo/db/commands/fsync.cpp +++ b/src/mongo/db/commands/fsync.cpp @@ -78,13 +78,13 @@ public: virtual void run(); }; -class FSyncCommand : public Command { +class FSyncCommand : public BasicCommand { public: static const char* url() { return "http://dochub.mongodb.org/core/fsynccommand"; } - FSyncCommand() : Command("fsync") {} + FSyncCommand() : BasicCommand("fsync") {} virtual ~FSyncCommand() { // The FSyncLockThread is owned by the FSyncCommand and accesses FsyncCommand state. It must @@ -264,9 +264,9 @@ private: bool _fsyncLocked = false; } fsyncCmd; -class FSyncUnlockCommand : public Command { +class FSyncUnlockCommand : public BasicCommand { public: - FSyncUnlockCommand() : Command("fsyncUnlock") {} + FSyncUnlockCommand() : BasicCommand("fsyncUnlock") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/db/commands/generic.cpp b/src/mongo/db/commands/generic.cpp index d520f59e2c6..a9b3e982c23 100644 --- a/src/mongo/db/commands/generic.cpp +++ b/src/mongo/db/commands/generic.cpp @@ -69,9 +69,9 @@ using std::string; using std::stringstream; using std::vector; -class CmdBuildInfo : public Command { +class CmdBuildInfo : public BasicCommand { public: - CmdBuildInfo() : Command("buildInfo", "buildinfo") {} + CmdBuildInfo() : BasicCommand("buildInfo", "buildinfo") {} virtual bool slaveOk() const { return true; } @@ -102,9 +102,9 @@ public: } cmdBuildInfo; -class PingCommand : public Command { +class PingCommand : public BasicCommand { public: - PingCommand() : Command("ping") {} + PingCommand() : BasicCommand("ping") {} virtual bool slaveOk() const { return true; } @@ -128,9 +128,9 @@ public: } } pingCmd; -class FeaturesCmd : public Command { +class FeaturesCmd : public BasicCommand { public: - FeaturesCmd() : Command("features") {} + FeaturesCmd() : BasicCommand("features") {} void help(stringstream& h) const { h << "return build level feature settings"; } @@ -163,9 +163,9 @@ public: } featuresCmd; -class HostInfoCmd : public Command { +class HostInfoCmd : public BasicCommand { public: - HostInfoCmd() : Command("hostInfo") {} + HostInfoCmd() : BasicCommand("hostInfo") {} virtual bool slaveOk() const { return true; } @@ -213,9 +213,9 @@ public: } hostInfoCmd; -class LogRotateCmd : public Command { +class LogRotateCmd : public BasicCommand { public: - LogRotateCmd() : Command("logRotate") {} + LogRotateCmd() : BasicCommand("logRotate") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; } @@ -245,12 +245,12 @@ public: } logRotateCmd; -class ListCommandsCmd : public Command { +class ListCommandsCmd : public BasicCommand { public: virtual void help(stringstream& help) const { help << "get a list of all db commands"; } - ListCommandsCmd() : Command("listCommands") {} + ListCommandsCmd() : BasicCommand("listCommands") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; } @@ -346,7 +346,7 @@ void CmdShutdown::shutdownHelper() { } /* for testing purposes only */ -class CmdForceError : public Command { +class CmdForceError : public BasicCommand { public: virtual void help(stringstream& help) const { help << "for testing purposes only. forces a user assertion exception"; @@ -360,7 +360,7 @@ public: virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required - CmdForceError() : Command("forceerror") {} + CmdForceError() : BasicCommand("forceerror") {} bool run(OperationContext* opCtx, const string& dbnamne, const BSONObj& cmdObj, @@ -371,9 +371,9 @@ public: } } cmdForceError; -class GetLogCmd : public Command { +class GetLogCmd : public BasicCommand { public: - GetLogCmd() : Command("getLog") {} + GetLogCmd() : BasicCommand("getLog") {} virtual bool slaveOk() const { return true; @@ -442,9 +442,9 @@ public: } getLogCmd; -class ClearLogCmd : public Command { +class ClearLogCmd : public BasicCommand { public: - ClearLogCmd() : Command("clearLog") {} + ClearLogCmd() : BasicCommand("clearLog") {} virtual bool slaveOk() const { return true; @@ -496,9 +496,9 @@ MONGO_INITIALIZER(RegisterClearLogCmd)(InitializerContext* context) { return Status::OK(); } -class CmdGetCmdLineOpts : Command { +class CmdGetCmdLineOpts : public BasicCommand { public: - CmdGetCmdLineOpts() : Command("getCmdLineOpts") {} + CmdGetCmdLineOpts() : BasicCommand("getCmdLineOpts") {} void help(stringstream& h) const { h << "get argv"; } diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp index 97d379e106a..c40625ed1c7 100644 --- a/src/mongo/db/commands/geo_near_cmd.cpp +++ b/src/mongo/db/commands/geo_near_cmd.cpp @@ -60,9 +60,9 @@ namespace mongo { using std::unique_ptr; using std::stringstream; -class Geo2dFindNearCmd : public Command { +class Geo2dFindNearCmd : public BasicCommand { public: - Geo2dFindNearCmd() : Command("geoNear") {} + Geo2dFindNearCmd() : BasicCommand("geoNear") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp index 64ca1ed8b72..80ebfb78e8e 100644 --- a/src/mongo/db/commands/get_last_error.cpp +++ b/src/mongo/db/commands/get_last_error.cpp @@ -55,7 +55,7 @@ using std::stringstream; see if any of the operations triggered an error, but don't want to check after each op as that woudl be a client/server turnaround. */ -class CmdResetError : public Command { +class CmdResetError : public BasicCommand { public: virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; @@ -69,7 +69,7 @@ public: virtual void help(stringstream& help) const { help << "reset error state (used with getpreverror)"; } - CmdResetError() : Command("resetError", "reseterror") {} + CmdResetError() : BasicCommand("resetError", "reseterror") {} bool run(OperationContext* opCtx, const string& db, const BSONObj& cmdObj, @@ -80,9 +80,9 @@ public: } } cmdResetError; -class CmdGetLastError : public Command { +class CmdGetLastError : public BasicCommand { public: - CmdGetLastError() : Command("getLastError", "getlasterror") {} + CmdGetLastError() : BasicCommand("getLastError", "getlasterror") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; } @@ -296,7 +296,7 @@ public: } cmdGetLastError; -class CmdGetPrevError : public Command { +class CmdGetPrevError : public BasicCommand { public: virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; @@ -310,7 +310,7 @@ public: virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required - CmdGetPrevError() : Command("getPrevError", "getpreverror") {} + CmdGetPrevError() : BasicCommand("getPrevError", "getpreverror") {} bool run(OperationContext* opCtx, const string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index 8438544407d..456799b070f 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -75,11 +75,11 @@ MONGO_FP_DECLARE(rsStopGetMoreCmd); * Can be used in combination with any cursor-generating command (e.g. find, aggregate, * listIndexes). */ -class GetMoreCmd : public Command { +class GetMoreCmd : public BasicCommand { MONGO_DISALLOW_COPYING(GetMoreCmd); public: - GetMoreCmd() : Command("getMore") {} + GetMoreCmd() : BasicCommand("getMore") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/db/commands/group_cmd.cpp b/src/mongo/db/commands/group_cmd.cpp index e66dc123214..5aab82e6fd3 100644 --- a/src/mongo/db/commands/group_cmd.cpp +++ b/src/mongo/db/commands/group_cmd.cpp @@ -58,9 +58,9 @@ namespace { * The group command is deprecated. Users should prefer the aggregation framework or mapReduce. See * http://dochub.mongodb.org/core/group-command-deprecation for more detail. */ -class GroupCommand : public Command { +class GroupCommand : public BasicCommand { public: - GroupCommand() : Command("group") {} + GroupCommand() : BasicCommand("group") {} private: virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/db/commands/hashcmd.cpp b/src/mongo/db/commands/hashcmd.cpp index a540cd771f0..78f76370b15 100644 --- a/src/mongo/db/commands/hashcmd.cpp +++ b/src/mongo/db/commands/hashcmd.cpp @@ -50,9 +50,9 @@ using std::string; using std::stringstream; // Testing only, enabled via command-line. -class CmdHashElt : public Command { +class CmdHashElt : public BasicCommand { public: - CmdHashElt() : Command("_hashBSONElement"){}; + CmdHashElt() : BasicCommand("_hashBSONElement"){}; virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; } diff --git a/src/mongo/db/commands/haystack.cpp b/src/mongo/db/commands/haystack.cpp index 84e9bda79e8..d8f418b4ccb 100644 --- a/src/mongo/db/commands/haystack.cpp +++ b/src/mongo/db/commands/haystack.cpp @@ -59,9 +59,9 @@ namespace mongo { using std::string; using std::vector; -class GeoHaystackSearchCommand : public Command { +class GeoHaystackSearchCommand : public BasicCommand { public: - GeoHaystackSearchCommand() : Command("geoSearch") {} + GeoHaystackSearchCommand() : BasicCommand("geoSearch") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/commands/index_filter_commands.cpp b/src/mongo/db/commands/index_filter_commands.cpp index 2fabe66c892..e1fdc732d2e 100644 --- a/src/mongo/db/commands/index_filter_commands.cpp +++ b/src/mongo/db/commands/index_filter_commands.cpp @@ -113,7 +113,7 @@ using std::vector; using std::unique_ptr; IndexFilterCommand::IndexFilterCommand(const string& name, const string& helpText) - : Command(name), helpText(helpText) {} + : BasicCommand(name), helpText(helpText) {} bool IndexFilterCommand::run(OperationContext* opCtx, const string& dbname, diff --git a/src/mongo/db/commands/index_filter_commands.h b/src/mongo/db/commands/index_filter_commands.h index 27c81dbc6ba..7cdf97c8205 100644 --- a/src/mongo/db/commands/index_filter_commands.h +++ b/src/mongo/db/commands/index_filter_commands.h @@ -49,7 +49,7 @@ namespace mongo { * Defines common attributes for all index filter related commands * such as slaveOk. */ -class IndexFilterCommand : public Command { +class IndexFilterCommand : public BasicCommand { public: IndexFilterCommand(const std::string& name, const std::string& helpText); diff --git a/src/mongo/db/commands/isself.cpp b/src/mongo/db/commands/isself.cpp index 014fb89ee2d..6186dab0d8b 100644 --- a/src/mongo/db/commands/isself.cpp +++ b/src/mongo/db/commands/isself.cpp @@ -39,9 +39,9 @@ namespace mongo { using std::string; using std::stringstream; -class IsSelfCommand : public Command { +class IsSelfCommand : public BasicCommand { public: - IsSelfCommand() : Command("_isSelf") {} + IsSelfCommand() : BasicCommand("_isSelf") {} virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/kill_op.cpp b/src/mongo/db/commands/kill_op.cpp index 6edd8b8b4a8..5cd6b40d4ac 100644 --- a/src/mongo/db/commands/kill_op.cpp +++ b/src/mongo/db/commands/kill_op.cpp @@ -46,9 +46,9 @@ namespace mongo { -class KillOpCommand : public Command { +class KillOpCommand : public BasicCommand { public: - KillOpCommand() : Command("killOp") {} + KillOpCommand() : BasicCommand("killOp") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/db/commands/killcursors_common.h b/src/mongo/db/commands/killcursors_common.h index 4c0ef668a55..281a5be828e 100644 --- a/src/mongo/db/commands/killcursors_common.h +++ b/src/mongo/db/commands/killcursors_common.h @@ -37,9 +37,9 @@ namespace mongo { * Base class for the killCursors command, which attempts to kill all given cursors. Contains code * common to mongos and mongod implementations. */ -class KillCursorsCmdBase : public Command { +class KillCursorsCmdBase : public BasicCommand { public: - KillCursorsCmdBase() : Command("killCursors") {} + KillCursorsCmdBase() : BasicCommand("killCursors") {} virtual ~KillCursorsCmdBase() {} diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp index cf38981e14f..ee972bc64e8 100644 --- a/src/mongo/db/commands/list_collections.cpp +++ b/src/mongo/db/commands/list_collections.cpp @@ -195,7 +195,7 @@ BSONObj buildCollectionBson(OperationContext* opCtx, return b.obj(); } -class CmdListCollections : public Command { +class CmdListCollections : public BasicCommand { public: virtual bool slaveOk() const { return false; @@ -227,7 +227,7 @@ public: str::stream() << "Not authorized to list collections on db: " << dbname); } - CmdListCollections() : Command("listCollections") {} + CmdListCollections() : BasicCommand("listCollections") {} bool run(OperationContext* opCtx, const string& dbname, diff --git a/src/mongo/db/commands/list_databases.cpp b/src/mongo/db/commands/list_databases.cpp index 37c0f0c0590..fe24e9b8967 100644 --- a/src/mongo/db/commands/list_databases.cpp +++ b/src/mongo/db/commands/list_databases.cpp @@ -55,7 +55,7 @@ using std::vector; // XXX: remove and put into storage api intmax_t dbSize(const string& database); -class CmdListDatabases : public Command { +class CmdListDatabases : public BasicCommand { public: virtual bool slaveOk() const { return false; @@ -81,7 +81,7 @@ public: out->push_back(Privilege(ResourcePattern::forClusterResource(), actions)); } - CmdListDatabases() : Command("listDatabases") {} + CmdListDatabases() : BasicCommand("listDatabases") {} bool run(OperationContext* opCtx, const string& dbname, diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp index 557390465f1..5502b9add2f 100644 --- a/src/mongo/db/commands/list_indexes.cpp +++ b/src/mongo/db/commands/list_indexes.cpp @@ -74,7 +74,7 @@ namespace { * ] * } */ -class CmdListIndexes : public Command { +class CmdListIndexes : public BasicCommand { public: virtual bool slaveOk() const { return false; @@ -114,7 +114,7 @@ public: << ns.coll()); } - CmdListIndexes() : Command("listIndexes") {} + CmdListIndexes() : BasicCommand("listIndexes") {} bool run(OperationContext* opCtx, const string& dbname, diff --git a/src/mongo/db/commands/lock_info.cpp b/src/mongo/db/commands/lock_info.cpp index 5a3c2dd5dab..4becb45fcc0 100644 --- a/src/mongo/db/commands/lock_info.cpp +++ b/src/mongo/db/commands/lock_info.cpp @@ -47,7 +47,7 @@ using std::stringstream; /** * Admin command to display global lock information */ -class CmdLockInfo : public Command { +class CmdLockInfo : public BasicCommand { public: virtual bool slaveOk() const { return true; @@ -77,7 +77,7 @@ public: return isAuthorized ? Status::OK() : Status(ErrorCodes::Unauthorized, "Unauthorized"); } - CmdLockInfo() : Command("lockInfo") {} + CmdLockInfo() : BasicCommand("lockInfo") {} bool run(OperationContext* opCtx, const string& dbname, diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index 2c8a1b72b23..dcb694116a1 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -1325,9 +1325,9 @@ BSONObj _bailFromJS(const BSONObj& args, void* data) { /** * This class represents a map/reduce command executed on a single server */ -class MapReduceCommand : public Command { +class MapReduceCommand : public BasicCommand { public: - MapReduceCommand() : Command("mapReduce", "mapreduce") {} + MapReduceCommand() : BasicCommand("mapReduce", "mapreduce") {} virtual bool slaveOk() const { return repl::getGlobalReplicationCoordinator()->getReplicationMode() != @@ -1654,12 +1654,12 @@ public: /** * This class represents a map/reduce command executed on the output server of a sharded env */ -class MapReduceFinishCommand : public Command { +class MapReduceFinishCommand : public BasicCommand { public: void help(stringstream& h) const { h << "internal"; } - MapReduceFinishCommand() : Command("mapreduce.shardedfinish") {} + MapReduceFinishCommand() : BasicCommand("mapreduce.shardedfinish") {} virtual bool slaveOk() const { return repl::getGlobalReplicationCoordinator()->getReplicationMode() != repl::ReplicationCoordinator::modeReplSet; diff --git a/src/mongo/db/commands/oplog_note.cpp b/src/mongo/db/commands/oplog_note.cpp index d1edfcbdfb9..d95301fb484 100644 --- a/src/mongo/db/commands/oplog_note.cpp +++ b/src/mongo/db/commands/oplog_note.cpp @@ -82,9 +82,9 @@ Status _performNoopWrite(OperationContext* opCtx, BSONObj msgObj, StringData not using std::string; using std::stringstream; -class AppendOplogNoteCmd : public Command { +class AppendOplogNoteCmd : public BasicCommand { public: - AppendOplogNoteCmd() : Command("appendOplogNote") {} + AppendOplogNoteCmd() : BasicCommand("appendOplogNote") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp index a39e9a2cc3c..debd6973295 100644 --- a/src/mongo/db/commands/parallel_collection_scan.cpp +++ b/src/mongo/db/commands/parallel_collection_scan.cpp @@ -49,7 +49,7 @@ using stdx::make_unique; namespace { -class ParallelCollectionScanCmd : public Command { +class ParallelCollectionScanCmd : public BasicCommand { public: struct ExtentInfo { ExtentInfo(RecordId dl, size_t s) : diskLoc(dl), size(s) {} @@ -57,7 +57,7 @@ public: size_t size; }; - ParallelCollectionScanCmd() : Command("parallelCollectionScan") {} + ParallelCollectionScanCmd() : BasicCommand("parallelCollectionScan") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp index 4ebb1bc7904..79d2421553e 100644 --- a/src/mongo/db/commands/parameters.cpp +++ b/src/mongo/db/commands/parameters.cpp @@ -63,9 +63,9 @@ void appendParameterNames(stringstream& help) { } } -class CmdGet : public Command { +class CmdGet : public BasicCommand { public: - CmdGet() : Command("getParameter") {} + CmdGet() : BasicCommand("getParameter") {} virtual bool slaveOk() const { return true; } @@ -112,9 +112,9 @@ public: } } cmdGet; -class CmdSet : public Command { +class CmdSet : public BasicCommand { public: - CmdSet() : Command("setParameter") {} + CmdSet() : BasicCommand("setParameter") {} virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index 031f2560284..651cb2c9c9d 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -44,9 +44,9 @@ bool isMergePipeline(const std::vector<BSONObj>& pipeline) { return pipeline[0].hasField("$mergeCursors"); } -class PipelineCommand : public Command { +class PipelineCommand : public BasicCommand { public: - PipelineCommand() : Command("aggregate") {} + PipelineCommand() : BasicCommand("aggregate") {} void help(std::stringstream& help) const override { help << "Runs the aggregation command. See http://dochub.mongodb.org/core/aggregation for " diff --git a/src/mongo/db/commands/plan_cache_commands.cpp b/src/mongo/db/commands/plan_cache_commands.cpp index c7ebdb034a1..7f5e0209695 100644 --- a/src/mongo/db/commands/plan_cache_commands.cpp +++ b/src/mongo/db/commands/plan_cache_commands.cpp @@ -108,7 +108,7 @@ using std::unique_ptr; PlanCacheCommand::PlanCacheCommand(const string& name, const string& helpText, ActionType actionType) - : Command(name), helpText(helpText), actionType(actionType) {} + : BasicCommand(name), helpText(helpText), actionType(actionType) {} bool PlanCacheCommand::run(OperationContext* opCtx, const string& dbname, diff --git a/src/mongo/db/commands/plan_cache_commands.h b/src/mongo/db/commands/plan_cache_commands.h index 8057aaaf95d..8312e12aa8c 100644 --- a/src/mongo/db/commands/plan_cache_commands.h +++ b/src/mongo/db/commands/plan_cache_commands.h @@ -43,7 +43,7 @@ namespace mongo { * Defines common attributes for all plan cache related commands * such as slaveOk. */ -class PlanCacheCommand : public Command { +class PlanCacheCommand : public BasicCommand { public: PlanCacheCommand(const std::string& name, const std::string& helpText, ActionType actionType); diff --git a/src/mongo/db/commands/rename_collection_cmd.cpp b/src/mongo/db/commands/rename_collection_cmd.cpp index 9c4c027328c..a5a54249d5a 100644 --- a/src/mongo/db/commands/rename_collection_cmd.cpp +++ b/src/mongo/db/commands/rename_collection_cmd.cpp @@ -56,9 +56,9 @@ using std::stringstream; namespace { -class CmdRenameCollection : public Command { +class CmdRenameCollection : public BasicCommand { public: - CmdRenameCollection() : Command("renameCollection") {} + CmdRenameCollection() : BasicCommand("renameCollection") {} virtual bool adminOnly() const { return true; } diff --git a/src/mongo/db/commands/repair_cursor.cpp b/src/mongo/db/commands/repair_cursor.cpp index 5d644f78341..b1b2b7bd963 100644 --- a/src/mongo/db/commands/repair_cursor.cpp +++ b/src/mongo/db/commands/repair_cursor.cpp @@ -45,9 +45,9 @@ namespace mongo { using std::string; -class RepairCursorCmd : public Command { +class RepairCursorCmd : public BasicCommand { public: - RepairCursorCmd() : Command("repairCursor") {} + RepairCursorCmd() : BasicCommand("repairCursor") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/commands/resize_oplog.cpp b/src/mongo/db/commands/resize_oplog.cpp index b7e9d512923..7166d76c96f 100644 --- a/src/mongo/db/commands/resize_oplog.cpp +++ b/src/mongo/db/commands/resize_oplog.cpp @@ -50,9 +50,9 @@ namespace mongo { using std::string; using std::stringstream; -class CmdReplSetResizeOplog : public Command { +class CmdReplSetResizeOplog : public BasicCommand { public: - CmdReplSetResizeOplog() : Command("replSetResizeOplog") {} + CmdReplSetResizeOplog() : BasicCommand("replSetResizeOplog") {} virtual bool slaveOk() const final { return true; diff --git a/src/mongo/db/commands/server_status.cpp b/src/mongo/db/commands/server_status.cpp index 3771f40df3b..8475560432c 100644 --- a/src/mongo/db/commands/server_status.cpp +++ b/src/mongo/db/commands/server_status.cpp @@ -64,9 +64,9 @@ using std::map; using std::string; using std::stringstream; -class CmdServerStatus : public Command { +class CmdServerStatus : public BasicCommand { public: - CmdServerStatus() : Command("serverStatus"), _started(Date_t::now()), _runCalled(false) {} + CmdServerStatus() : BasicCommand("serverStatus"), _started(Date_t::now()), _runCalled(false) {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp index 19579ebe7cb..b8b4cca670e 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -46,9 +46,10 @@ namespace { * setFeatureCompatibilityVersion: <string version> * } */ -class SetFeatureCompatibilityVersionCommand : public Command { +class SetFeatureCompatibilityVersionCommand : public BasicCommand { public: - SetFeatureCompatibilityVersionCommand() : Command(FeatureCompatibilityVersion::kCommandName) {} + SetFeatureCompatibilityVersionCommand() + : BasicCommand(FeatureCompatibilityVersion::kCommandName) {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/db/commands/shutdown.h b/src/mongo/db/commands/shutdown.h index f1f55d0668c..6b08d1597dd 100644 --- a/src/mongo/db/commands/shutdown.h +++ b/src/mongo/db/commands/shutdown.h @@ -35,9 +35,9 @@ namespace mongo { -class CmdShutdown : public Command { +class CmdShutdown : public BasicCommand { public: - CmdShutdown() : Command("shutdown") {} + CmdShutdown() : BasicCommand("shutdown") {} virtual bool requiresAuth() { return true; diff --git a/src/mongo/db/commands/snapshot_management.cpp b/src/mongo/db/commands/snapshot_management.cpp index 20b406b34fc..e9004704842 100644 --- a/src/mongo/db/commands/snapshot_management.cpp +++ b/src/mongo/db/commands/snapshot_management.cpp @@ -39,9 +39,9 @@ #include "mongo/db/storage/snapshot_manager.h" namespace mongo { -class CmdMakeSnapshot final : public Command { +class CmdMakeSnapshot final : public BasicCommand { public: - CmdMakeSnapshot() : Command("makeSnapshot") {} + CmdMakeSnapshot() : BasicCommand("makeSnapshot") {} virtual bool slaveOk() const { return true; @@ -88,9 +88,9 @@ public: } }; -class CmdSetCommittedSnapshot final : public Command { +class CmdSetCommittedSnapshot final : public BasicCommand { public: - CmdSetCommittedSnapshot() : Command("setCommittedSnapshot") {} + CmdSetCommittedSnapshot() : BasicCommand("setCommittedSnapshot") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp index 618e655fdce..ffc7bf48466 100644 --- a/src/mongo/db/commands/test_commands.cpp +++ b/src/mongo/db/commands/test_commands.cpp @@ -56,9 +56,9 @@ using std::string; using std::stringstream; /* For testing only, not for general use. Enabled via command-line */ -class GodInsert : public Command { +class GodInsert : public BasicCommand { public: - GodInsert() : Command("godinsert") {} + GodInsert() : BasicCommand("godinsert") {} virtual bool adminOnly() const { return false; } @@ -108,7 +108,7 @@ public: }; /* for diagnostic / testing purposes. Enabled via command line. */ -class CmdSleep : public Command { +class CmdSleep : public BasicCommand { public: virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; @@ -148,7 +148,7 @@ public: opCtx->sleepFor(Milliseconds(millis)); } - CmdSleep() : Command("sleep") {} + CmdSleep() : BasicCommand("sleep") {} bool run(OperationContext* opCtx, const string& ns, const BSONObj& cmdObj, @@ -199,9 +199,9 @@ public: }; // Testing only, enabled via command-line. -class CapTrunc : public Command { +class CapTrunc : public BasicCommand { public: - CapTrunc() : Command("captrunc") {} + CapTrunc() : BasicCommand("captrunc") {} virtual bool slaveOk() const { return false; } @@ -275,9 +275,9 @@ public: }; // Testing-only, enabled via command line. -class EmptyCapped : public Command { +class EmptyCapped : public BasicCommand { public: - EmptyCapped() : Command("emptycapped") {} + EmptyCapped() : BasicCommand("emptycapped") {} virtual bool slaveOk() const { return false; } diff --git a/src/mongo/db/commands/top_command.cpp b/src/mongo/db/commands/top_command.cpp index 2b9c2e54671..afb1d3401f3 100644 --- a/src/mongo/db/commands/top_command.cpp +++ b/src/mongo/db/commands/top_command.cpp @@ -42,9 +42,9 @@ namespace { using namespace mongo; -class TopCommand : public Command { +class TopCommand : public BasicCommand { public: - TopCommand() : Command("top") {} + TopCommand() : BasicCommand("top") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/db/commands/touch.cpp b/src/mongo/db/commands/touch.cpp index dbb6a2221af..00bd08dbe50 100644 --- a/src/mongo/db/commands/touch.cpp +++ b/src/mongo/db/commands/touch.cpp @@ -53,7 +53,7 @@ namespace mongo { using std::string; using std::stringstream; -class TouchCmd : public Command { +class TouchCmd : public BasicCommand { public: virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; @@ -80,7 +80,7 @@ public: actions.addAction(ActionType::touch); out->push_back(Privilege(ResourcePattern::forClusterResource(), actions)); } - TouchCmd() : Command("touch") {} + TouchCmd() : BasicCommand("touch") {} virtual bool run(OperationContext* opCtx, const string& dbname, diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp index 4c0a7aee499..ecb54541df1 100644 --- a/src/mongo/db/commands/user_management_commands.cpp +++ b/src/mongo/db/commands/user_management_commands.cpp @@ -594,9 +594,9 @@ Status requireAuthSchemaVersion26UpgradeOrFinal(OperationContext* opCtx, } // namespace -class CmdCreateUser : public Command { +class CmdCreateUser : public BasicCommand { public: - CmdCreateUser() : Command("createUser") {} + CmdCreateUser() : BasicCommand("createUser") {} virtual bool slaveOk() const { return false; @@ -740,9 +740,9 @@ public: } cmdCreateUser; -class CmdUpdateUser : public Command { +class CmdUpdateUser : public BasicCommand { public: - CmdUpdateUser() : Command("updateUser") {} + CmdUpdateUser() : BasicCommand("updateUser") {} virtual bool slaveOk() const { return false; @@ -857,9 +857,9 @@ public: } cmdUpdateUser; -class CmdDropUser : public Command { +class CmdDropUser : public BasicCommand { public: - CmdDropUser() : Command("dropUser") {} + CmdDropUser() : BasicCommand("dropUser") {} virtual bool slaveOk() const { return false; @@ -925,9 +925,9 @@ public: } cmdDropUser; -class CmdDropAllUsersFromDatabase : public Command { +class CmdDropAllUsersFromDatabase : public BasicCommand { public: - CmdDropAllUsersFromDatabase() : Command("dropAllUsersFromDatabase") {} + CmdDropAllUsersFromDatabase() : BasicCommand("dropAllUsersFromDatabase") {} virtual bool slaveOk() const { return false; @@ -982,9 +982,9 @@ public: } cmdDropAllUsersFromDatabase; -class CmdGrantRolesToUser : public Command { +class CmdGrantRolesToUser : public BasicCommand { public: - CmdGrantRolesToUser() : Command("grantRolesToUser") {} + CmdGrantRolesToUser() : BasicCommand("grantRolesToUser") {} virtual bool slaveOk() const { return false; @@ -1056,9 +1056,9 @@ public: } cmdGrantRolesToUser; -class CmdRevokeRolesFromUser : public Command { +class CmdRevokeRolesFromUser : public BasicCommand { public: - CmdRevokeRolesFromUser() : Command("revokeRolesFromUser") {} + CmdRevokeRolesFromUser() : BasicCommand("revokeRolesFromUser") {} virtual bool slaveOk() const { return false; @@ -1130,7 +1130,7 @@ public: } cmdRevokeRolesFromUser; -class CmdUsersInfo : public Command { +class CmdUsersInfo : public BasicCommand { public: virtual bool slaveOk() const { return false; @@ -1144,7 +1144,7 @@ public: return false; } - CmdUsersInfo() : Command("usersInfo") {} + CmdUsersInfo() : BasicCommand("usersInfo") {} virtual void help(stringstream& ss) const { ss << "Returns information about users." << endl; @@ -1247,9 +1247,9 @@ public: } cmdUsersInfo; -class CmdCreateRole : public Command { +class CmdCreateRole : public BasicCommand { public: - CmdCreateRole() : Command("createRole") {} + CmdCreateRole() : BasicCommand("createRole") {} virtual bool slaveOk() const { return false; @@ -1360,9 +1360,9 @@ public: } cmdCreateRole; -class CmdUpdateRole : public Command { +class CmdUpdateRole : public BasicCommand { public: - CmdUpdateRole() : Command("updateRole") {} + CmdUpdateRole() : BasicCommand("updateRole") {} virtual bool slaveOk() const { return false; @@ -1458,9 +1458,9 @@ public: } } cmdUpdateRole; -class CmdGrantPrivilegesToRole : public Command { +class CmdGrantPrivilegesToRole : public BasicCommand { public: - CmdGrantPrivilegesToRole() : Command("grantPrivilegesToRole") {} + CmdGrantPrivilegesToRole() : BasicCommand("grantPrivilegesToRole") {} virtual bool slaveOk() const { return false; @@ -1566,9 +1566,9 @@ public: } cmdGrantPrivilegesToRole; -class CmdRevokePrivilegesFromRole : public Command { +class CmdRevokePrivilegesFromRole : public BasicCommand { public: - CmdRevokePrivilegesFromRole() : Command("revokePrivilegesFromRole") {} + CmdRevokePrivilegesFromRole() : BasicCommand("revokePrivilegesFromRole") {} virtual bool slaveOk() const { return false; @@ -1676,9 +1676,9 @@ public: } cmdRevokePrivilegesFromRole; -class CmdGrantRolesToRole : public Command { +class CmdGrantRolesToRole : public BasicCommand { public: - CmdGrantRolesToRole() : Command("grantRolesToRole") {} + CmdGrantRolesToRole() : BasicCommand("grantRolesToRole") {} virtual bool slaveOk() const { return false; @@ -1767,9 +1767,9 @@ public: } cmdGrantRolesToRole; -class CmdRevokeRolesFromRole : public Command { +class CmdRevokeRolesFromRole : public BasicCommand { public: - CmdRevokeRolesFromRole() : Command("revokeRolesFromRole") {} + CmdRevokeRolesFromRole() : BasicCommand("revokeRolesFromRole") {} virtual bool slaveOk() const { return false; @@ -1853,9 +1853,9 @@ public: } cmdRevokeRolesFromRole; -class CmdDropRole : public Command { +class CmdDropRole : public BasicCommand { public: - CmdDropRole() : Command("dropRole") {} + CmdDropRole() : BasicCommand("dropRole") {} virtual bool slaveOk() const { return false; @@ -2006,9 +2006,9 @@ public: } cmdDropRole; -class CmdDropAllRolesFromDatabase : public Command { +class CmdDropAllRolesFromDatabase : public BasicCommand { public: - CmdDropAllRolesFromDatabase() : Command("dropAllRolesFromDatabase") {} + CmdDropAllRolesFromDatabase() : BasicCommand("dropAllRolesFromDatabase") {} virtual bool slaveOk() const { return false; @@ -2150,7 +2150,7 @@ public: * schema. */ -class CmdRolesInfo : public Command { +class CmdRolesInfo : public BasicCommand { public: virtual bool slaveOk() const { return false; @@ -2164,7 +2164,7 @@ public: return false; } - CmdRolesInfo() : Command("rolesInfo") {} + CmdRolesInfo() : BasicCommand("rolesInfo") {} virtual void help(stringstream& ss) const { ss << "Returns information about roles." << endl; @@ -2231,7 +2231,7 @@ public: } cmdRolesInfo; -class CmdInvalidateUserCache : public Command { +class CmdInvalidateUserCache : public BasicCommand { public: virtual bool slaveOk() const { return true; @@ -2245,7 +2245,7 @@ public: return false; } - CmdInvalidateUserCache() : Command("invalidateUserCache") {} + CmdInvalidateUserCache() : BasicCommand("invalidateUserCache") {} virtual void help(stringstream& ss) const { ss << "Invalidates the in-memory cache of user information" << endl; @@ -2269,7 +2269,7 @@ public: } cmdInvalidateUserCache; -class CmdGetCacheGeneration : public Command { +class CmdGetCacheGeneration : public BasicCommand { public: virtual bool slaveOk() const { return true; @@ -2283,7 +2283,7 @@ public: return false; } - CmdGetCacheGeneration() : Command("_getUserCacheGeneration") {} + CmdGetCacheGeneration() : BasicCommand("_getUserCacheGeneration") {} virtual void help(stringstream& ss) const { ss << "internal" << endl; @@ -2317,9 +2317,9 @@ public: * It either adds the users/roles to the existing ones or replaces the existing ones, depending * on whether the "drop" argument is true or false. */ -class CmdMergeAuthzCollections : public Command { +class CmdMergeAuthzCollections : public BasicCommand { public: - CmdMergeAuthzCollections() : Command("_mergeAuthzCollections") {} + CmdMergeAuthzCollections() : BasicCommand("_mergeAuthzCollections") {} virtual bool slaveOk() const { return false; @@ -2887,9 +2887,9 @@ Status upgradeAuthSchema(OperationContext* opCtx, << " successful steps."); } -class CmdAuthSchemaUpgrade : public Command { +class CmdAuthSchemaUpgrade : public BasicCommand { public: - CmdAuthSchemaUpgrade() : Command("authSchemaUpgrade") {} + CmdAuthSchemaUpgrade() : BasicCommand("authSchemaUpgrade") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp index 6b3e76286a7..a4a5e98b888 100644 --- a/src/mongo/db/commands/validate.cpp +++ b/src/mongo/db/commands/validate.cpp @@ -49,9 +49,9 @@ using std::stringstream; MONGO_FP_DECLARE(validateCmdCollectionNotValid); -class ValidateCmd : public Command { +class ValidateCmd : public BasicCommand { public: - ValidateCmd() : Command("validate") {} + ValidateCmd() : BasicCommand("validate") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/db/commands/write_commands/write_commands.cpp b/src/mongo/db/commands/write_commands/write_commands.cpp index dcab92230d2..61cd6d4cf27 100644 --- a/src/mongo/db/commands/write_commands/write_commands.cpp +++ b/src/mongo/db/commands/write_commands/write_commands.cpp @@ -183,9 +183,9 @@ void serializeReply(OperationContext* opCtx, } } -class WriteCommand : public Command { +class WriteCommand : public BasicCommand { public: - explicit WriteCommand(StringData name) : Command(name) {} + explicit WriteCommand(StringData name) : BasicCommand(name) {} bool slaveOk() const final { return false; diff --git a/src/mongo/db/exec/stagedebug_cmd.cpp b/src/mongo/db/exec/stagedebug_cmd.cpp index 8beaaad2076..256dcba59fb 100644 --- a/src/mongo/db/exec/stagedebug_cmd.cpp +++ b/src/mongo/db/exec/stagedebug_cmd.cpp @@ -115,9 +115,9 @@ BSONObj stripFieldNames(const BSONObj& obj) { * node -> {dedup: {filter: {filter}, args: {node: node, field: field}}} * node -> {unwind: {filter: filter}, args: {node: node, field: field}} */ -class StageDebugCmd : public Command { +class StageDebugCmd : public BasicCommand { public: - StageDebugCmd() : Command("stageDebug") {} + StageDebugCmd() : BasicCommand("stageDebug") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/ftdc/ftdc_commands.cpp b/src/mongo/db/ftdc/ftdc_commands.cpp index 5a20914982a..312c4204dd8 100644 --- a/src/mongo/db/ftdc/ftdc_commands.cpp +++ b/src/mongo/db/ftdc/ftdc_commands.cpp @@ -45,9 +45,9 @@ namespace { * * Document will be empty if FTDC has never run. */ -class GetDiagnosticDataCommand final : public Command { +class GetDiagnosticDataCommand final : public BasicCommand { public: - GetDiagnosticDataCommand() : Command("getDiagnosticData") {} + GetDiagnosticDataCommand() : BasicCommand("getDiagnosticData") {} bool adminOnly() const override { return true; diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp index b1e0978da6f..b6cea5fc57e 100644 --- a/src/mongo/db/repl/master_slave.cpp +++ b/src/mongo/db/repl/master_slave.cpp @@ -357,12 +357,12 @@ void ReplSource::forceResyncDead(OperationContext* opCtx, const char* requester) replAllDead = 0; } -class HandshakeCmd : public Command { +class HandshakeCmd : public BasicCommand { public: void help(stringstream& h) const { h << "internal"; } - HandshakeCmd() : Command("handshake") {} + HandshakeCmd() : BasicCommand("handshake") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; } diff --git a/src/mongo/db/repl/repl_set_command.h b/src/mongo/db/repl/repl_set_command.h index 1997b2b29a3..fd43ad1c8b2 100644 --- a/src/mongo/db/repl/repl_set_command.h +++ b/src/mongo/db/repl/repl_set_command.h @@ -43,9 +43,9 @@ namespace repl { /** * Base class for repl set commands. */ -class ReplSetCommand : public Command { +class ReplSetCommand : public BasicCommand { protected: - ReplSetCommand(const char* s) : Command(s) {} + ReplSetCommand(const char* s) : BasicCommand(s) {} bool slaveOk() const override { return true; diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index 44ad19fda7b..723c75c1b04 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -211,7 +211,7 @@ public: } } oplogInfoServerStatus; -class CmdIsMaster : public Command { +class CmdIsMaster : public BasicCommand { public: virtual bool requiresAuth() { return false; @@ -230,7 +230,7 @@ public: virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required - CmdIsMaster() : Command("isMaster", "ismaster") {} + CmdIsMaster() : BasicCommand("isMaster", "ismaster") {} virtual bool run(OperationContext* opCtx, const string&, const BSONObj& cmdObj, diff --git a/src/mongo/db/repl/resync.cpp b/src/mongo/db/repl/resync.cpp index 8022dc3fee6..68f85a7af0e 100644 --- a/src/mongo/db/repl/resync.cpp +++ b/src/mongo/db/repl/resync.cpp @@ -48,7 +48,7 @@ constexpr StringData kWaitFieldName = "wait"_sd; } // namespace // operator requested resynchronization of replication (on a slave or secondary). {resync: 1} -class CmdResync : public Command { +class CmdResync : public BasicCommand { public: virtual bool slaveOk() const { return true; @@ -71,7 +71,7 @@ public: h << "resync (from scratch) a stale slave or replica set secondary node.\n"; } - CmdResync() : Command(kResyncFieldName) {} + CmdResync() : BasicCommand(kResyncFieldName) {} virtual bool run(OperationContext* opCtx, const string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/db/s/check_sharding_index_command.cpp b/src/mongo/db/s/check_sharding_index_command.cpp index 4917050f219..576bb7bbc72 100644 --- a/src/mongo/db/s/check_sharding_index_command.cpp +++ b/src/mongo/db/s/check_sharding_index_command.cpp @@ -54,9 +54,9 @@ namespace dps = ::mongo::dotted_path_support; namespace { -class CheckShardingIndex : public Command { +class CheckShardingIndex : public BasicCommand { public: - CheckShardingIndex() : Command("checkShardingIndex") {} + CheckShardingIndex() : BasicCommand("checkShardingIndex") {} virtual void help(std::stringstream& help) const { help << "Internal command.\n"; diff --git a/src/mongo/db/s/cleanup_orphaned_cmd.cpp b/src/mongo/db/s/cleanup_orphaned_cmd.cpp index c2df12b73b7..a7af78a64f8 100644 --- a/src/mongo/db/s/cleanup_orphaned_cmd.cpp +++ b/src/mongo/db/s/cleanup_orphaned_cmd.cpp @@ -168,9 +168,9 @@ CleanupResult cleanupOrphanedData(OperationContext* opCtx, * writeConcern: { <writeConcern options> } * } */ -class CleanupOrphanedCommand : public Command { +class CleanupOrphanedCommand : public BasicCommand { public: - CleanupOrphanedCommand() : Command("cleanupOrphaned") {} + CleanupOrphanedCommand() : BasicCommand("cleanupOrphaned") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/db/s/config/configsvr_add_shard_command.cpp b/src/mongo/db/s/config/configsvr_add_shard_command.cpp index 72dea07a677..6459347f185 100644 --- a/src/mongo/db/s/config/configsvr_add_shard_command.cpp +++ b/src/mongo/db/s/config/configsvr_add_shard_command.cpp @@ -55,9 +55,9 @@ const long long kMaxSizeMBDefault = 0; /** * Internal sharding command run on config servers to add a shard to the cluster. */ -class ConfigSvrAddShardCommand : public Command { +class ConfigSvrAddShardCommand : public BasicCommand { public: - ConfigSvrAddShardCommand() : Command("_configsvrAddShard") {} + ConfigSvrAddShardCommand() : BasicCommand("_configsvrAddShard") {} void help(std::stringstream& help) const override { help << "Internal command, which is exported by the sharding config server. Do not call " diff --git a/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp b/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp index d8cd89547ec..d5bbc204458 100644 --- a/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp +++ b/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp @@ -56,9 +56,9 @@ using std::string; * writeConcern: <BSONObj> * } */ -class ConfigSvrAddShardToZoneCommand : public Command { +class ConfigSvrAddShardToZoneCommand : public BasicCommand { public: - ConfigSvrAddShardToZoneCommand() : Command("_configsvrAddShardToZone") {} + ConfigSvrAddShardToZoneCommand() : BasicCommand("_configsvrAddShardToZone") {} void help(std::stringstream& help) const override { help << "Internal command, which is exported by the sharding config server. Do not call " diff --git a/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp b/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp index 9a42c25f634..7cdb5a8522b 100644 --- a/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp +++ b/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp @@ -83,9 +83,9 @@ namespace { * } * */ -class ConfigSvrCommitChunkMigrationCommand : public Command { +class ConfigSvrCommitChunkMigrationCommand : public BasicCommand { public: - ConfigSvrCommitChunkMigrationCommand() : Command("_configsvrCommitChunkMigration") {} + ConfigSvrCommitChunkMigrationCommand() : BasicCommand("_configsvrCommitChunkMigration") {} void help(std::stringstream& help) const override { help << "should not be calling this directly"; diff --git a/src/mongo/db/s/config/configsvr_control_balancer_command.cpp b/src/mongo/db/s/config/configsvr_control_balancer_command.cpp index 7a896693887..01b348367a9 100644 --- a/src/mongo/db/s/config/configsvr_control_balancer_command.cpp +++ b/src/mongo/db/s/config/configsvr_control_balancer_command.cpp @@ -41,9 +41,9 @@ namespace mongo { namespace { -class ConfigSvrBalancerControlCommand : public Command { +class ConfigSvrBalancerControlCommand : public BasicCommand { public: - ConfigSvrBalancerControlCommand(StringData name) : Command(name) {} + ConfigSvrBalancerControlCommand(StringData name) : BasicCommand(name) {} void help(std::stringstream& help) const override { help << "Internal command, which is exported by the sharding config server. Do not call " diff --git a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp index 9b57c172e86..c9b92fc8160 100644 --- a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp @@ -63,9 +63,9 @@ using std::string; * writeConcern: <BSONObj> * } */ -class ConfigSvrMergeChunkCommand : public Command { +class ConfigSvrMergeChunkCommand : public BasicCommand { public: - ConfigSvrMergeChunkCommand() : Command("_configsvrCommitChunkMerge") {} + ConfigSvrMergeChunkCommand() : BasicCommand("_configsvrCommitChunkMerge") {} void help(std::stringstream& help) const override { help << "Internal command, which is sent by a shard to the sharding config server. Do " diff --git a/src/mongo/db/s/config/configsvr_move_chunk_command.cpp b/src/mongo/db/s/config/configsvr_move_chunk_command.cpp index efd4c4c8710..9ebc98537a0 100644 --- a/src/mongo/db/s/config/configsvr_move_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_move_chunk_command.cpp @@ -47,9 +47,9 @@ namespace { using std::string; using str::stream; -class ConfigSvrMoveChunkCommand : public Command { +class ConfigSvrMoveChunkCommand : public BasicCommand { public: - ConfigSvrMoveChunkCommand() : Command("_configsvrMoveChunk") {} + ConfigSvrMoveChunkCommand() : BasicCommand("_configsvrMoveChunk") {} void help(std::stringstream& help) const override { help << "Internal command, which is exported by the sharding config server. Do not call " diff --git a/src/mongo/db/s/config/configsvr_move_primary_command.cpp b/src/mongo/db/s/config/configsvr_move_primary_command.cpp index ca592283df6..d663c4d56e0 100644 --- a/src/mongo/db/s/config/configsvr_move_primary_command.cpp +++ b/src/mongo/db/s/config/configsvr_move_primary_command.cpp @@ -58,9 +58,9 @@ namespace { /** * Internal sharding command run on config servers to change a database's primary shard. */ -class ConfigSvrMovePrimaryCommand : public Command { +class ConfigSvrMovePrimaryCommand : public BasicCommand { public: - ConfigSvrMovePrimaryCommand() : Command("_configsvrMovePrimary") {} + ConfigSvrMovePrimaryCommand() : BasicCommand("_configsvrMovePrimary") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp b/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp index 5228635a599..e053985255a 100644 --- a/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp +++ b/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp @@ -56,9 +56,9 @@ using std::string; * writeConcern: <BSONObj> * } */ -class ConfigSvrRemoveShardFromZoneCommand : public Command { +class ConfigSvrRemoveShardFromZoneCommand : public BasicCommand { public: - ConfigSvrRemoveShardFromZoneCommand() : Command("_configsvrRemoveShardFromZone") {} + ConfigSvrRemoveShardFromZoneCommand() : BasicCommand("_configsvrRemoveShardFromZone") {} void help(std::stringstream& help) const override { help << "Internal command, which is exported by the sharding config server. Do not call " diff --git a/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp b/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp index bdb9f9767b8..021f19d62e5 100644 --- a/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp @@ -58,10 +58,10 @@ namespace { * _configsvrSetFeatureCompatibilityVersion: <string version> * } */ -class ConfigSvrSetFeatureCompatibilityVersionCommand : public Command { +class ConfigSvrSetFeatureCompatibilityVersionCommand : public BasicCommand { public: ConfigSvrSetFeatureCompatibilityVersionCommand() - : Command("_configsvrSetFeatureCompatibilityVersion") {} + : BasicCommand("_configsvrSetFeatureCompatibilityVersion") {} void help(std::stringstream& help) const override { help << "Internal command, which is exported by the sharding config server. Do not call " diff --git a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp index b582f4f5899..4bf43a0635b 100644 --- a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp +++ b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp @@ -124,9 +124,9 @@ BSONObj makeCreateIndexesCmd(const NamespaceString& nss, /** * Internal sharding command run on config servers to add a shard to the cluster. */ -class ConfigSvrShardCollectionCommand : public Command { +class ConfigSvrShardCollectionCommand : public BasicCommand { public: - ConfigSvrShardCollectionCommand() : Command("_configsvrShardCollection") {} + ConfigSvrShardCollectionCommand() : BasicCommand("_configsvrShardCollection") {} Status checkAuthForCommand(Client* client, const std::string& dbname, diff --git a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp index 841e03a2a1e..acfd59c1cf2 100644 --- a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp @@ -61,9 +61,9 @@ using std::string; * writeConcern: <BSONObj> * } */ -class ConfigSvrSplitChunkCommand : public Command { +class ConfigSvrSplitChunkCommand : public BasicCommand { public: - ConfigSvrSplitChunkCommand() : Command("_configsvrCommitChunkSplit") {} + ConfigSvrSplitChunkCommand() : BasicCommand("_configsvrCommitChunkSplit") {} void help(std::stringstream& help) const override { help << "Internal command, which is sent by a shard to the sharding config server. Do " diff --git a/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp b/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp index f0b5328aedd..488e432f2eb 100644 --- a/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp +++ b/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp @@ -58,9 +58,9 @@ using std::string; * writeConcern: <BSONObj> * } */ -class ConfigsvrUpdateZoneKeyRangeCommand : public Command { +class ConfigsvrUpdateZoneKeyRangeCommand : public BasicCommand { public: - ConfigsvrUpdateZoneKeyRangeCommand() : Command("_configsvrUpdateZoneKeyRange") {} + ConfigsvrUpdateZoneKeyRangeCommand() : BasicCommand("_configsvrUpdateZoneKeyRange") {} void help(std::stringstream& help) const override { help << "Internal command, which is exported by the sharding config server. Do not call " diff --git a/src/mongo/db/s/force_routing_table_refresh_command.cpp b/src/mongo/db/s/force_routing_table_refresh_command.cpp index 1fd33eebf99..b863fa677b8 100644 --- a/src/mongo/db/s/force_routing_table_refresh_command.cpp +++ b/src/mongo/db/s/force_routing_table_refresh_command.cpp @@ -61,9 +61,9 @@ namespace { * Takes a single argument, a namespace string, and forces this node to refresh its routing table * cache entry for that namespace. */ -class ForceRoutingTableRefresh : public Command { +class ForceRoutingTableRefresh : public BasicCommand { public: - ForceRoutingTableRefresh() : Command("forceRoutingTableRefresh") {} + ForceRoutingTableRefresh() : BasicCommand("forceRoutingTableRefresh") {} void help(std::stringstream& help) const override { help << "internal command to force a node to refresh its routing table entry for a " diff --git a/src/mongo/db/s/get_shard_version_command.cpp b/src/mongo/db/s/get_shard_version_command.cpp index f1632fa7224..7808b08005a 100644 --- a/src/mongo/db/s/get_shard_version_command.cpp +++ b/src/mongo/db/s/get_shard_version_command.cpp @@ -47,9 +47,9 @@ namespace mongo { namespace { -class GetShardVersion : public Command { +class GetShardVersion : public BasicCommand { public: - GetShardVersion() : Command("getShardVersion") {} + GetShardVersion() : BasicCommand("getShardVersion") {} void help(std::stringstream& help) const override { help << " example: { getShardVersion : 'alleyinsider.foo' } "; diff --git a/src/mongo/db/s/merge_chunks_command.cpp b/src/mongo/db/s/merge_chunks_command.cpp index 37fe8fcd58d..13286839627 100644 --- a/src/mongo/db/s/merge_chunks_command.cpp +++ b/src/mongo/db/s/merge_chunks_command.cpp @@ -319,9 +319,9 @@ Status mergeChunks(OperationContext* opCtx, return Status::OK(); } -class MergeChunksCommand : public Command { +class MergeChunksCommand : public BasicCommand { public: - MergeChunksCommand() : Command("mergeChunks") {} + MergeChunksCommand() : BasicCommand("mergeChunks") {} void help(stringstream& h) const override { h << "Merge Chunks command\n" diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp index eeb12474948..5ccadd3f724 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp @@ -111,9 +111,9 @@ private: MigrationChunkClonerSourceLegacy* _chunkCloner; }; -class InitialCloneCommand : public Command { +class InitialCloneCommand : public BasicCommand { public: - InitialCloneCommand() : Command("_migrateClone") {} + InitialCloneCommand() : BasicCommand("_migrateClone") {} void help(std::stringstream& h) const { h << "internal"; @@ -174,9 +174,9 @@ public: } initialCloneCommand; -class TransferModsCommand : public Command { +class TransferModsCommand : public BasicCommand { public: - TransferModsCommand() : Command("_transferMods") {} + TransferModsCommand() : BasicCommand("_transferMods") {} void help(std::stringstream& h) const { h << "internal"; diff --git a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp index a188affcf43..5bbd09cdddb 100644 --- a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp +++ b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp @@ -55,9 +55,9 @@ using std::string; namespace { -class RecvChunkStartCommand : public Command { +class RecvChunkStartCommand : public BasicCommand { public: - RecvChunkStartCommand() : Command("_recvChunkStart") {} + RecvChunkStartCommand() : BasicCommand("_recvChunkStart") {} void help(std::stringstream& h) const { h << "internal"; @@ -156,9 +156,9 @@ public: } recvChunkStartCmd; -class RecvChunkStatusCommand : public Command { +class RecvChunkStatusCommand : public BasicCommand { public: - RecvChunkStatusCommand() : Command("_recvChunkStatus") {} + RecvChunkStatusCommand() : BasicCommand("_recvChunkStatus") {} void help(std::stringstream& h) const { h << "internal"; @@ -195,9 +195,9 @@ public: } recvChunkStatusCommand; -class RecvChunkCommitCommand : public Command { +class RecvChunkCommitCommand : public BasicCommand { public: - RecvChunkCommitCommand() : Command("_recvChunkCommit") {} + RecvChunkCommitCommand() : BasicCommand("_recvChunkCommit") {} void help(std::stringstream& h) const { h << "internal"; @@ -242,9 +242,9 @@ public: } recvChunkCommitCommand; -class RecvChunkAbortCommand : public Command { +class RecvChunkAbortCommand : public BasicCommand { public: - RecvChunkAbortCommand() : Command("_recvChunkAbort") {} + RecvChunkAbortCommand() : BasicCommand("_recvChunkAbort") {} void help(std::stringstream& h) const { h << "internal"; diff --git a/src/mongo/db/s/move_chunk_command.cpp b/src/mongo/db/s/move_chunk_command.cpp index df72a27e89e..b7d52f5058e 100644 --- a/src/mongo/db/s/move_chunk_command.cpp +++ b/src/mongo/db/s/move_chunk_command.cpp @@ -79,9 +79,9 @@ MONGO_FP_DECLARE(moveChunkHangAtStep5); MONGO_FP_DECLARE(moveChunkHangAtStep6); MONGO_FP_DECLARE(moveChunkHangAtStep7); -class MoveChunkCommand : public Command { +class MoveChunkCommand : public BasicCommand { public: - MoveChunkCommand() : Command("moveChunk") {} + MoveChunkCommand() : BasicCommand("moveChunk") {} void help(std::stringstream& help) const override { help << "should not be calling this directly"; diff --git a/src/mongo/db/s/set_shard_version_command.cpp b/src/mongo/db/s/set_shard_version_command.cpp index 2df54bc37c5..56675280e5f 100644 --- a/src/mongo/db/s/set_shard_version_command.cpp +++ b/src/mongo/db/s/set_shard_version_command.cpp @@ -60,9 +60,9 @@ using str::stream; namespace { -class SetShardVersion : public Command { +class SetShardVersion : public BasicCommand { public: - SetShardVersion() : Command("setShardVersion") {} + SetShardVersion() : BasicCommand("setShardVersion") {} void help(std::stringstream& help) const override { help << "internal"; diff --git a/src/mongo/db/s/sharding_state_command.cpp b/src/mongo/db/s/sharding_state_command.cpp index 21b12746c9f..8bb4e5fc8b3 100644 --- a/src/mongo/db/s/sharding_state_command.cpp +++ b/src/mongo/db/s/sharding_state_command.cpp @@ -43,9 +43,9 @@ namespace mongo { namespace { -class ShardingStateCmd : public Command { +class ShardingStateCmd : public BasicCommand { public: - ShardingStateCmd() : Command("shardingState") {} + ShardingStateCmd() : BasicCommand("shardingState") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/s/split_chunk_command.cpp b/src/mongo/db/s/split_chunk_command.cpp index cc43284a7ef..2830a77915d 100644 --- a/src/mongo/db/s/split_chunk_command.cpp +++ b/src/mongo/db/s/split_chunk_command.cpp @@ -130,9 +130,9 @@ bool _checkMetadataForSuccess(OperationContext* opCtx, return true; } -class SplitChunkCommand : public Command { +class SplitChunkCommand : public BasicCommand { public: - SplitChunkCommand() : Command("splitChunk") {} + SplitChunkCommand() : BasicCommand("splitChunk") {} void help(std::stringstream& help) const override { help << "internal command usage only\n" diff --git a/src/mongo/db/s/split_vector_command.cpp b/src/mongo/db/s/split_vector_command.cpp index 309dddf1cfc..a01287bf773 100644 --- a/src/mongo/db/s/split_vector_command.cpp +++ b/src/mongo/db/s/split_vector_command.cpp @@ -69,9 +69,9 @@ BSONObj prettyKey(const BSONObj& keyPattern, const BSONObj& key) { return key.replaceFieldNames(keyPattern).clientReadable(); } -class SplitVector : public Command { +class SplitVector : public BasicCommand { public: - SplitVector() : Command("splitVector") {} + SplitVector() : BasicCommand("splitVector") {} bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/db/s/unset_sharding_command.cpp b/src/mongo/db/s/unset_sharding_command.cpp index cb8e08a67b0..18bf30403a5 100644 --- a/src/mongo/db/s/unset_sharding_command.cpp +++ b/src/mongo/db/s/unset_sharding_command.cpp @@ -44,9 +44,9 @@ namespace mongo { namespace { -class UnsetShardingCommand : public Command { +class UnsetShardingCommand : public BasicCommand { public: - UnsetShardingCommand() : Command("unsetSharding") {} + UnsetShardingCommand() : BasicCommand("unsetSharding") {} void help(std::stringstream& help) const override { help << "internal"; diff --git a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp index 950276ac9ae..828b5d44abd 100644 --- a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp +++ b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp @@ -64,9 +64,9 @@ boost::filesystem::path getJournalDir(); } // Testing-only, enabled via command line -class JournalLatencyTestCmd : public Command { +class JournalLatencyTestCmd : public BasicCommand { public: - JournalLatencyTestCmd() : Command("journalLatencyTest") {} + JournalLatencyTestCmd() : BasicCommand("journalLatencyTest") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/client/shard_connection.cpp b/src/mongo/s/client/shard_connection.cpp index 5e68edaebab..274857ec995 100644 --- a/src/mongo/s/client/shard_connection.cpp +++ b/src/mongo/s/client/shard_connection.cpp @@ -89,9 +89,9 @@ private: /** * Command to allow access to the sharded conn pool information in mongos. */ -class ShardedPoolStats : public Command { +class ShardedPoolStats : public BasicCommand { public: - ShardedPoolStats() : Command("shardConnPoolStats") {} + ShardedPoolStats() : BasicCommand("shardConnPoolStats") {} virtual void help(stringstream& help) const { help << "stats about the shard connection pool"; } diff --git a/src/mongo/s/commands/cluster_add_shard_cmd.cpp b/src/mongo/s/commands/cluster_add_shard_cmd.cpp index d85a4574f5c..6b6ed92ae98 100644 --- a/src/mongo/s/commands/cluster_add_shard_cmd.cpp +++ b/src/mongo/s/commands/cluster_add_shard_cmd.cpp @@ -51,9 +51,9 @@ namespace { const ReadPreferenceSetting kPrimaryOnlyReadPreference{ReadPreference::PrimaryOnly}; const char kShardAdded[] = "shardAdded"; -class AddShardCmd : public Command { +class AddShardCmd : public BasicCommand { public: - AddShardCmd() : Command("addShard", "addshard") {} + AddShardCmd() : BasicCommand("addShard", "addshard") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp b/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp index 87e5db92d95..e16b79b3c67 100644 --- a/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp +++ b/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp @@ -65,9 +65,9 @@ const WriteConcernOptions kMajorityWriteConcern(WriteConcernOptions::kMajority, * zone: <string zoneName> * } */ -class AddShardToZoneCmd : public Command { +class AddShardToZoneCmd : public BasicCommand { public: - AddShardToZoneCmd() : Command("addShardToZone", "addshardtozone") {} + AddShardToZoneCmd() : BasicCommand("addShardToZone", "addshardtozone") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_apply_ops_cmd.cpp b/src/mongo/s/commands/cluster_apply_ops_cmd.cpp index 25465129a2d..62c88d41e8c 100644 --- a/src/mongo/s/commands/cluster_apply_ops_cmd.cpp +++ b/src/mongo/s/commands/cluster_apply_ops_cmd.cpp @@ -34,9 +34,9 @@ namespace mongo { namespace { -class ApplyOpsCmd : public Command { +class ApplyOpsCmd : public BasicCommand { public: - ApplyOpsCmd() : Command("applyOps") {} + ApplyOpsCmd() : BasicCommand("applyOps") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_available_query_options_cmd.cpp b/src/mongo/s/commands/cluster_available_query_options_cmd.cpp index 4acb791fee1..c0851ba1d22 100644 --- a/src/mongo/s/commands/cluster_available_query_options_cmd.cpp +++ b/src/mongo/s/commands/cluster_available_query_options_cmd.cpp @@ -35,9 +35,9 @@ namespace mongo { namespace { -class AvailableQueryOptions : public Command { +class AvailableQueryOptions : public BasicCommand { public: - AvailableQueryOptions() : Command("availableQueryOptions", "availablequeryoptions") {} + AvailableQueryOptions() : BasicCommand("availableQueryOptions", "availablequeryoptions") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_compact_cmd.cpp b/src/mongo/s/commands/cluster_compact_cmd.cpp index deaa852c25a..c668bc3152d 100644 --- a/src/mongo/s/commands/cluster_compact_cmd.cpp +++ b/src/mongo/s/commands/cluster_compact_cmd.cpp @@ -33,9 +33,9 @@ namespace mongo { namespace { -class CompactCmd : public Command { +class CompactCmd : public BasicCommand { public: - CompactCmd() : Command("compact") {} + CompactCmd() : BasicCommand("compact") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp index 2d1bc078d7d..6df5d8c5ebe 100644 --- a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp +++ b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp @@ -41,12 +41,12 @@ namespace { const ReadPreferenceSetting kPrimaryOnlyReadPreference{ReadPreference::PrimaryOnly}; -class BalancerControlCommand : public Command { +class BalancerControlCommand : public BasicCommand { public: BalancerControlCommand(StringData name, StringData configsvrCommandName, ActionType authorizationAction) - : Command(name), + : BasicCommand(name), _configsvrCommandName(configsvrCommandName), _authorizationAction(authorizationAction) {} diff --git a/src/mongo/s/commands/cluster_count_cmd.cpp b/src/mongo/s/commands/cluster_count_cmd.cpp index 6736d6c4174..d90f3156e36 100644 --- a/src/mongo/s/commands/cluster_count_cmd.cpp +++ b/src/mongo/s/commands/cluster_count_cmd.cpp @@ -47,9 +47,9 @@ namespace mongo { namespace { -class ClusterCountCmd : public Command { +class ClusterCountCmd : public BasicCommand { public: - ClusterCountCmd() : Command("count") {} + ClusterCountCmd() : BasicCommand("count") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_db_stats_cmd.cpp b/src/mongo/s/commands/cluster_db_stats_cmd.cpp index bdf52f52a84..1da192120c5 100644 --- a/src/mongo/s/commands/cluster_db_stats_cmd.cpp +++ b/src/mongo/s/commands/cluster_db_stats_cmd.cpp @@ -40,9 +40,9 @@ namespace { using std::vector; -class DBStatsCmd : public Command { +class DBStatsCmd : public BasicCommand { public: - DBStatsCmd() : Command("dbStats", "dbstats") {} + DBStatsCmd() : BasicCommand("dbStats", "dbstats") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_drop_cmd.cpp b/src/mongo/s/commands/cluster_drop_cmd.cpp index fd05eae78dd..61579466220 100644 --- a/src/mongo/s/commands/cluster_drop_cmd.cpp +++ b/src/mongo/s/commands/cluster_drop_cmd.cpp @@ -46,9 +46,9 @@ namespace mongo { namespace { -class DropCmd : public Command { +class DropCmd : public BasicCommand { public: - DropCmd() : Command("drop") {} + DropCmd() : BasicCommand("drop") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_drop_database_cmd.cpp b/src/mongo/s/commands/cluster_drop_database_cmd.cpp index dfc71cc62c3..26ed92309f0 100644 --- a/src/mongo/s/commands/cluster_drop_database_cmd.cpp +++ b/src/mongo/s/commands/cluster_drop_database_cmd.cpp @@ -45,9 +45,9 @@ namespace mongo { namespace { -class DropDatabaseCmd : public Command { +class DropDatabaseCmd : public BasicCommand { public: - DropDatabaseCmd() : Command("dropDatabase") {} + DropDatabaseCmd() : BasicCommand("dropDatabase") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp index 231f03d3f91..d6fbfb44381 100644 --- a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp +++ b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp @@ -47,9 +47,9 @@ namespace mongo { namespace { -class EnableShardingCmd : public Command { +class EnableShardingCmd : public BasicCommand { public: - EnableShardingCmd() : Command("enableSharding", "enablesharding") {} + EnableShardingCmd() : BasicCommand("enableSharding", "enablesharding") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_explain_cmd.cpp b/src/mongo/s/commands/cluster_explain_cmd.cpp index c21a9db40b0..547a8b33e74 100644 --- a/src/mongo/s/commands/cluster_explain_cmd.cpp +++ b/src/mongo/s/commands/cluster_explain_cmd.cpp @@ -48,11 +48,11 @@ namespace { * support a new-style explain, then the entire explain will fail (i.e. new-style * explains cannot be used in multiversion clusters). */ -class ClusterExplainCmd : public Command { +class ClusterExplainCmd : public BasicCommand { MONGO_DISALLOW_COPYING(ClusterExplainCmd); public: - ClusterExplainCmd() : Command("explain") {} + ClusterExplainCmd() : BasicCommand("explain") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp index ece264eaaa8..3ce88868f6b 100644 --- a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp @@ -57,9 +57,9 @@ using std::shared_ptr; using std::string; using std::vector; -class FindAndModifyCmd : public Command { +class FindAndModifyCmd : public BasicCommand { public: - FindAndModifyCmd() : Command("findAndModify", "findandmodify") {} + FindAndModifyCmd() : BasicCommand("findAndModify", "findandmodify") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_find_cmd.cpp b/src/mongo/s/commands/cluster_find_cmd.cpp index 4bf8b053008..9e5cb80138d 100644 --- a/src/mongo/s/commands/cluster_find_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_cmd.cpp @@ -54,11 +54,11 @@ const char kTermField[] = "term"; /** * Implements the find command on mongos. */ -class ClusterFindCmd : public Command { +class ClusterFindCmd : public BasicCommand { MONGO_DISALLOW_COPYING(ClusterFindCmd); public: - ClusterFindCmd() : Command("find") {} + ClusterFindCmd() : BasicCommand("find") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp b/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp index 30e7d6eb423..40522351d6b 100644 --- a/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp +++ b/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp @@ -35,9 +35,9 @@ namespace mongo { namespace { -class FlushRouterConfigCmd : public Command { +class FlushRouterConfigCmd : public BasicCommand { public: - FlushRouterConfigCmd() : Command("flushRouterConfig", "flushrouterconfig") {} + FlushRouterConfigCmd() : BasicCommand("flushRouterConfig", "flushrouterconfig") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_fsync_cmd.cpp b/src/mongo/s/commands/cluster_fsync_cmd.cpp index 69177cfb1a1..9928576cc89 100644 --- a/src/mongo/s/commands/cluster_fsync_cmd.cpp +++ b/src/mongo/s/commands/cluster_fsync_cmd.cpp @@ -38,9 +38,9 @@ namespace mongo { namespace { -class FsyncCommand : public Command { +class FsyncCommand : public BasicCommand { public: - FsyncCommand() : Command("fsync", "fsync") {} + FsyncCommand() : BasicCommand("fsync", "fsync") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_ftdc_commands.cpp b/src/mongo/s/commands/cluster_ftdc_commands.cpp index 61b35db405e..d87f5529fdc 100644 --- a/src/mongo/s/commands/cluster_ftdc_commands.cpp +++ b/src/mongo/s/commands/cluster_ftdc_commands.cpp @@ -44,9 +44,9 @@ namespace { * getDiagnosticData is a MongoD only command. We implement in MongoS to give users a better error * message. */ -class GetDiagnosticDataCommand final : public Command { +class GetDiagnosticDataCommand final : public BasicCommand { public: - GetDiagnosticDataCommand() : Command("getDiagnosticData") {} + GetDiagnosticDataCommand() : BasicCommand("getDiagnosticData") {} bool adminOnly() const override { return true; diff --git a/src/mongo/s/commands/cluster_get_last_error_cmd.cpp b/src/mongo/s/commands/cluster_get_last_error_cmd.cpp index 57e036562eb..8633618dd4c 100644 --- a/src/mongo/s/commands/cluster_get_last_error_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_last_error_cmd.cpp @@ -184,9 +184,9 @@ Status enforceLegacyWriteConcern(OperationContext* opCtx, } -class GetLastErrorCmd : public Command { +class GetLastErrorCmd : public BasicCommand { public: - GetLastErrorCmd() : Command("getLastError", "getlasterror") {} + GetLastErrorCmd() : BasicCommand("getLastError", "getlasterror") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; diff --git a/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp b/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp index 7fdcfdb80f1..0dd37af4ae4 100644 --- a/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp @@ -38,9 +38,9 @@ namespace mongo { namespace { -class GetPrevErrorCmd : public Command { +class GetPrevErrorCmd : public BasicCommand { public: - GetPrevErrorCmd() : Command("getPrevError", "getpreverror") {} + GetPrevErrorCmd() : BasicCommand("getPrevError", "getpreverror") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp b/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp index 0917bdb90b2..37f63803f1a 100644 --- a/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp @@ -38,9 +38,9 @@ namespace mongo { namespace { -class CmdGetShardMap : public Command { +class CmdGetShardMap : public BasicCommand { public: - CmdGetShardMap() : Command("getShardMap") {} + CmdGetShardMap() : BasicCommand("getShardMap") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp index e127e2ca29d..f7ea6c50c70 100644 --- a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp @@ -43,9 +43,9 @@ namespace mongo { namespace { -class GetShardVersion : public Command { +class GetShardVersion : public BasicCommand { public: - GetShardVersion() : Command("getShardVersion", "getshardversion") {} + GetShardVersion() : BasicCommand("getShardVersion", "getshardversion") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_getmore_cmd.cpp b/src/mongo/s/commands/cluster_getmore_cmd.cpp index 344841075e5..664d4ade18a 100644 --- a/src/mongo/s/commands/cluster_getmore_cmd.cpp +++ b/src/mongo/s/commands/cluster_getmore_cmd.cpp @@ -44,11 +44,11 @@ namespace { * corresponding to the cursor id passed from the application. In order to generate these results, * may issue getMore commands to remote nodes in one or more shards. */ -class ClusterGetMoreCmd final : public Command { +class ClusterGetMoreCmd final : public BasicCommand { MONGO_DISALLOW_COPYING(ClusterGetMoreCmd); public: - ClusterGetMoreCmd() : Command("getMore") {} + ClusterGetMoreCmd() : BasicCommand("getMore") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/s/commands/cluster_index_filter_cmd.cpp b/src/mongo/s/commands/cluster_index_filter_cmd.cpp index 7b7ef05ef22..9d114bccdba 100644 --- a/src/mongo/s/commands/cluster_index_filter_cmd.cpp +++ b/src/mongo/s/commands/cluster_index_filter_cmd.cpp @@ -48,7 +48,7 @@ namespace { * Cluster index filter commands don't do much more than * forwarding the commands to all shards and combining the results. */ -class ClusterIndexFilterCmd : public Command { +class ClusterIndexFilterCmd : public BasicCommand { MONGO_DISALLOW_COPYING(ClusterIndexFilterCmd); public: @@ -57,7 +57,7 @@ public: * "helpText", and will require privilege "actionType" to run. */ ClusterIndexFilterCmd(const std::string& name, const std::string& helpText) - : Command(name), _helpText(helpText) {} + : BasicCommand(name), _helpText(helpText) {} virtual ~ClusterIndexFilterCmd() {} diff --git a/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp b/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp index 07527f725c3..9926799772c 100644 --- a/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp +++ b/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp @@ -33,9 +33,9 @@ namespace mongo { namespace { -class IsDbGridCmd : public Command { +class IsDbGridCmd : public BasicCommand { public: - IsDbGridCmd() : Command("isdbgrid") {} + IsDbGridCmd() : BasicCommand("isdbgrid") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/s/commands/cluster_is_master_cmd.cpp b/src/mongo/s/commands/cluster_is_master_cmd.cpp index 1c1be0b9a53..b2a294f81b3 100644 --- a/src/mongo/s/commands/cluster_is_master_cmd.cpp +++ b/src/mongo/s/commands/cluster_is_master_cmd.cpp @@ -44,9 +44,9 @@ namespace mongo { namespace { -class CmdIsMaster : public Command { +class CmdIsMaster : public BasicCommand { public: - CmdIsMaster() : Command("isMaster", "ismaster") {} + CmdIsMaster() : BasicCommand("isMaster", "ismaster") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/s/commands/cluster_kill_op.cpp b/src/mongo/s/commands/cluster_kill_op.cpp index 3b8f9e0a128..871dd20bfe0 100644 --- a/src/mongo/s/commands/cluster_kill_op.cpp +++ b/src/mongo/s/commands/cluster_kill_op.cpp @@ -51,9 +51,9 @@ namespace mongo { namespace { -class ClusterKillOpCommand : public Command { +class ClusterKillOpCommand : public BasicCommand { public: - ClusterKillOpCommand() : Command("killOp") {} + ClusterKillOpCommand() : BasicCommand("killOp") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/s/commands/cluster_list_databases_cmd.cpp b/src/mongo/s/commands/cluster_list_databases_cmd.cpp index 27fc6d35840..329cfb012b7 100644 --- a/src/mongo/s/commands/cluster_list_databases_cmd.cpp +++ b/src/mongo/s/commands/cluster_list_databases_cmd.cpp @@ -51,9 +51,9 @@ using std::vector; namespace { -class ListDatabasesCmd : public Command { +class ListDatabasesCmd : public BasicCommand { public: - ListDatabasesCmd() : Command("listDatabases", "listdatabases") {} + ListDatabasesCmd() : BasicCommand("listDatabases", "listdatabases") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_list_shards_cmd.cpp b/src/mongo/s/commands/cluster_list_shards_cmd.cpp index ba1cecee308..69498c2b121 100644 --- a/src/mongo/s/commands/cluster_list_shards_cmd.cpp +++ b/src/mongo/s/commands/cluster_list_shards_cmd.cpp @@ -39,9 +39,9 @@ namespace mongo { namespace { -class ListShardsCmd : public Command { +class ListShardsCmd : public BasicCommand { public: - ListShardsCmd() : Command("listShards", "listshards") {} + ListShardsCmd() : BasicCommand("listShards", "listshards") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp index 10ad111e0ec..b77a45fc95d 100644 --- a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp +++ b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp @@ -147,9 +147,9 @@ BSONObj fixForShards(const BSONObj& orig, * * 11. Inspects the BSONObject size from step #8 and determines if it needs to split. */ -class MRCmd : public Command { +class MRCmd : public BasicCommand { public: - MRCmd() : Command("mapReduce", "mapreduce") {} + MRCmd() : BasicCommand("mapReduce", "mapreduce") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp index b6213873706..d9f980c52ae 100644 --- a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp +++ b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp @@ -54,9 +54,9 @@ namespace { /** * Mongos-side command for merging chunks, passes command to appropriate shard. */ -class ClusterMergeChunksCommand : public Command { +class ClusterMergeChunksCommand : public BasicCommand { public: - ClusterMergeChunksCommand() : Command("mergeChunks") {} + ClusterMergeChunksCommand() : BasicCommand("mergeChunks") {} void help(stringstream& h) const override { h << "Merge Chunks command\n" diff --git a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp index 24666f54c76..4e1e0b9b57e 100644 --- a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp @@ -55,9 +55,9 @@ using std::string; namespace { -class MoveChunkCmd : public Command { +class MoveChunkCmd : public BasicCommand { public: - MoveChunkCmd() : Command("moveChunk", "movechunk") {} + MoveChunkCmd() : BasicCommand("moveChunk", "movechunk") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_move_primary_cmd.cpp b/src/mongo/s/commands/cluster_move_primary_cmd.cpp index 4c47ad42982..a7a0c496af1 100644 --- a/src/mongo/s/commands/cluster_move_primary_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_primary_cmd.cpp @@ -53,9 +53,9 @@ using std::string; namespace { -class MoveDatabasePrimaryCommand : public Command { +class MoveDatabasePrimaryCommand : public BasicCommand { public: - MoveDatabasePrimaryCommand() : Command("movePrimary", "moveprimary") {} + MoveDatabasePrimaryCommand() : BasicCommand("movePrimary", "moveprimary") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_netstat_cmd.cpp b/src/mongo/s/commands/cluster_netstat_cmd.cpp index 61d19c1f408..33076de0db4 100644 --- a/src/mongo/s/commands/cluster_netstat_cmd.cpp +++ b/src/mongo/s/commands/cluster_netstat_cmd.cpp @@ -36,9 +36,9 @@ namespace mongo { namespace { -class NetStatCmd : public Command { +class NetStatCmd : public BasicCommand { public: - NetStatCmd() : Command("netstat") {} + NetStatCmd() : BasicCommand("netstat") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_pipeline_cmd.cpp b/src/mongo/s/commands/cluster_pipeline_cmd.cpp index 05fa2a8d493..a48de3400cc 100644 --- a/src/mongo/s/commands/cluster_pipeline_cmd.cpp +++ b/src/mongo/s/commands/cluster_pipeline_cmd.cpp @@ -38,9 +38,9 @@ namespace mongo { namespace { -class ClusterPipelineCommand : public Command { +class ClusterPipelineCommand : public BasicCommand { public: - ClusterPipelineCommand() : Command("aggregate") {} + ClusterPipelineCommand() : BasicCommand("aggregate") {} void help(std::stringstream& help) const { help << "Runs the sharded aggregation command. See " diff --git a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp index 775dd7b3aec..7f339b20c2d 100644 --- a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp +++ b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp @@ -48,7 +48,7 @@ using std::vector; * Cluster plan cache commands don't do much more than * forwarding the commands to all shards and combining the results. */ -class ClusterPlanCacheCmd : public Command { +class ClusterPlanCacheCmd : public BasicCommand { MONGO_DISALLOW_COPYING(ClusterPlanCacheCmd); public: @@ -98,7 +98,7 @@ public: * "helpText", and will require privilege "actionType" to run. */ ClusterPlanCacheCmd(const std::string& name, const std::string& helpText, ActionType actionType) - : Command(name), _helpText(helpText), _actionType(actionType) {} + : BasicCommand(name), _helpText(helpText), _actionType(actionType) {} private: std::string _helpText; diff --git a/src/mongo/s/commands/cluster_profile_cmd.cpp b/src/mongo/s/commands/cluster_profile_cmd.cpp index 9927ba08a65..5c1fde01243 100644 --- a/src/mongo/s/commands/cluster_profile_cmd.cpp +++ b/src/mongo/s/commands/cluster_profile_cmd.cpp @@ -33,9 +33,9 @@ namespace mongo { namespace { -class ProfileCmd : public Command { +class ProfileCmd : public BasicCommand { public: - ProfileCmd() : Command("profile") {} + ProfileCmd() : BasicCommand("profile") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp index b6d5ebca214..8a649cf52a4 100644 --- a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp +++ b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp @@ -50,9 +50,9 @@ using std::vector; namespace { -class RemoveShardCmd : public Command { +class RemoveShardCmd : public BasicCommand { public: - RemoveShardCmd() : Command("removeShard", "removeshard") {} + RemoveShardCmd() : BasicCommand("removeShard", "removeshard") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp b/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp index 26ba207131b..88d019b7847 100644 --- a/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp +++ b/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp @@ -65,9 +65,9 @@ const WriteConcernOptions kMajorityWriteConcern(WriteConcernOptions::kMajority, * zone: <string zoneName> * } */ -class RemoveShardFromZoneCmd : public Command { +class RemoveShardFromZoneCmd : public BasicCommand { public: - RemoveShardFromZoneCmd() : Command("removeShardFromZone", "removeshardfromzone") {} + RemoveShardFromZoneCmd() : BasicCommand("removeShardFromZone", "removeshardfromzone") {} virtual bool slaveOk() const { return true; 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 8dbb0411d14..24f1e8dd31d 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,9 +36,9 @@ namespace mongo { namespace { -class CmdReplSetGetStatus : public Command { +class CmdReplSetGetStatus : public BasicCommand { public: - CmdReplSetGetStatus() : Command("replSetGetStatus") {} + CmdReplSetGetStatus() : BasicCommand("replSetGetStatus") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_reset_error_cmd.cpp b/src/mongo/s/commands/cluster_reset_error_cmd.cpp index 8757e8944a6..30fef011f72 100644 --- a/src/mongo/s/commands/cluster_reset_error_cmd.cpp +++ b/src/mongo/s/commands/cluster_reset_error_cmd.cpp @@ -40,9 +40,9 @@ namespace mongo { namespace { -class CmdShardingResetError : public Command { +class CmdShardingResetError : public BasicCommand { public: - CmdShardingResetError() : Command("resetError", "reseterror") {} + CmdShardingResetError() : BasicCommand("resetError", "reseterror") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { diff --git a/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp index de864f2d44f..1b865553b30 100644 --- a/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp +++ b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp @@ -48,9 +48,9 @@ namespace { * setFeatureCompatibilityVersion: <string version> * } */ -class SetFeatureCompatibilityVersionCmd : public Command { +class SetFeatureCompatibilityVersionCmd : public BasicCommand { public: - SetFeatureCompatibilityVersionCmd() : Command("setFeatureCompatibilityVersion") {} + SetFeatureCompatibilityVersionCmd() : BasicCommand("setFeatureCompatibilityVersion") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/s/commands/cluster_shard_collection_cmd.cpp b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp index bfb0c046cfd..d58268bb9ae 100644 --- a/src/mongo/s/commands/cluster_shard_collection_cmd.cpp +++ b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp @@ -66,9 +66,9 @@ namespace mongo { namespace { -class ShardCollectionCmd : public Command { +class ShardCollectionCmd : public BasicCommand { public: - ShardCollectionCmd() : Command("shardCollection", "shardcollection") {} + ShardCollectionCmd() : BasicCommand("shardCollection", "shardcollection") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_split_cmd.cpp b/src/mongo/s/commands/cluster_split_cmd.cpp index 244e235c24a..2deaebb830f 100644 --- a/src/mongo/s/commands/cluster_split_cmd.cpp +++ b/src/mongo/s/commands/cluster_split_cmd.cpp @@ -84,9 +84,9 @@ BSONObj selectMedianKey(OperationContext* opCtx, "Unable to find median in chunk, possibly because chunk is empty."); } -class SplitCollectionCmd : public Command { +class SplitCollectionCmd : public BasicCommand { public: - SplitCollectionCmd() : Command("split", "split") {} + SplitCollectionCmd() : BasicCommand("split", "split") {} bool slaveOk() const override { return true; diff --git a/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp b/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp index c27f6f78a02..72b479c32c7 100644 --- a/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp +++ b/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp @@ -68,9 +68,9 @@ const WriteConcernOptions kMajorityWriteConcern(WriteConcernOptions::kMajority, * zone: <string zone|null>, * } */ -class UpdateZoneKeyRangeCmd : public Command { +class UpdateZoneKeyRangeCmd : public BasicCommand { public: - UpdateZoneKeyRangeCmd() : Command("updateZoneKeyRange", "updatezonekeyRange") {} + UpdateZoneKeyRangeCmd() : BasicCommand("updateZoneKeyRange", "updatezonekeyRange") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_user_management_commands.cpp b/src/mongo/s/commands/cluster_user_management_commands.cpp index 9b9fc7b0d82..e29b970d04d 100644 --- a/src/mongo/s/commands/cluster_user_management_commands.cpp +++ b/src/mongo/s/commands/cluster_user_management_commands.cpp @@ -63,9 +63,9 @@ const WriteConcernOptions kMajorityWriteConcern(WriteConcernOptions::kMajority, WriteConcernOptions::SyncMode::UNSET, Seconds(30)); -class CmdCreateUser : public Command { +class CmdCreateUser : public BasicCommand { public: - CmdCreateUser() : Command("createUser") {} + CmdCreateUser() : BasicCommand("createUser") {} virtual bool slaveOk() const { return false; @@ -101,9 +101,9 @@ public: } cmdCreateUser; -class CmdUpdateUser : public Command { +class CmdUpdateUser : public BasicCommand { public: - CmdUpdateUser() : Command("updateUser") {} + CmdUpdateUser() : BasicCommand("updateUser") {} virtual bool slaveOk() const { return false; @@ -150,9 +150,9 @@ public: } cmdUpdateUser; -class CmdDropUser : public Command { +class CmdDropUser : public BasicCommand { public: - CmdDropUser() : Command("dropUser") {} + CmdDropUser() : BasicCommand("dropUser") {} virtual bool slaveOk() const { return false; @@ -195,9 +195,9 @@ public: } cmdDropUser; -class CmdDropAllUsersFromDatabase : public Command { +class CmdDropAllUsersFromDatabase : public BasicCommand { public: - CmdDropAllUsersFromDatabase() : Command("dropAllUsersFromDatabase") {} + CmdDropAllUsersFromDatabase() : BasicCommand("dropAllUsersFromDatabase") {} virtual bool slaveOk() const { return false; @@ -235,9 +235,9 @@ public: } cmdDropAllUsersFromDatabase; -class CmdGrantRolesToUser : public Command { +class CmdGrantRolesToUser : public BasicCommand { public: - CmdGrantRolesToUser() : Command("grantRolesToUser") {} + CmdGrantRolesToUser() : BasicCommand("grantRolesToUser") {} virtual bool slaveOk() const { return false; @@ -282,9 +282,9 @@ public: } cmdGrantRolesToUser; -class CmdRevokeRolesFromUser : public Command { +class CmdRevokeRolesFromUser : public BasicCommand { public: - CmdRevokeRolesFromUser() : Command("revokeRolesFromUser") {} + CmdRevokeRolesFromUser() : BasicCommand("revokeRolesFromUser") {} virtual bool slaveOk() const { return false; @@ -329,7 +329,7 @@ public: } cmdRevokeRolesFromUser; -class CmdUsersInfo : public Command { +class CmdUsersInfo : public BasicCommand { public: virtual bool slaveOk() const { return false; @@ -344,7 +344,7 @@ public: return false; } - CmdUsersInfo() : Command("usersInfo") {} + CmdUsersInfo() : BasicCommand("usersInfo") {} virtual void help(stringstream& ss) const { ss << "Returns information about users."; @@ -367,9 +367,9 @@ public: } cmdUsersInfo; -class CmdCreateRole : public Command { +class CmdCreateRole : public BasicCommand { public: - CmdCreateRole() : Command("createRole") {} + CmdCreateRole() : BasicCommand("createRole") {} virtual bool slaveOk() const { return false; @@ -401,9 +401,9 @@ public: } cmdCreateRole; -class CmdUpdateRole : public Command { +class CmdUpdateRole : public BasicCommand { public: - CmdUpdateRole() : Command("updateRole") {} + CmdUpdateRole() : BasicCommand("updateRole") {} virtual bool slaveOk() const { return false; @@ -441,9 +441,9 @@ public: } cmdUpdateRole; -class CmdGrantPrivilegesToRole : public Command { +class CmdGrantPrivilegesToRole : public BasicCommand { public: - CmdGrantPrivilegesToRole() : Command("grantPrivilegesToRole") {} + CmdGrantPrivilegesToRole() : BasicCommand("grantPrivilegesToRole") {} virtual bool slaveOk() const { return false; @@ -481,9 +481,9 @@ public: } cmdGrantPrivilegesToRole; -class CmdRevokePrivilegesFromRole : public Command { +class CmdRevokePrivilegesFromRole : public BasicCommand { public: - CmdRevokePrivilegesFromRole() : Command("revokePrivilegesFromRole") {} + CmdRevokePrivilegesFromRole() : BasicCommand("revokePrivilegesFromRole") {} virtual bool slaveOk() const { return false; @@ -521,9 +521,9 @@ public: } cmdRevokePrivilegesFromRole; -class CmdGrantRolesToRole : public Command { +class CmdGrantRolesToRole : public BasicCommand { public: - CmdGrantRolesToRole() : Command("grantRolesToRole") {} + CmdGrantRolesToRole() : BasicCommand("grantRolesToRole") {} virtual bool slaveOk() const { return false; @@ -561,9 +561,9 @@ public: } cmdGrantRolesToRole; -class CmdRevokeRolesFromRole : public Command { +class CmdRevokeRolesFromRole : public BasicCommand { public: - CmdRevokeRolesFromRole() : Command("revokeRolesFromRole") {} + CmdRevokeRolesFromRole() : BasicCommand("revokeRolesFromRole") {} virtual bool slaveOk() const { return false; @@ -601,9 +601,9 @@ public: } cmdRevokeRolesFromRole; -class CmdDropRole : public Command { +class CmdDropRole : public BasicCommand { public: - CmdDropRole() : Command("dropRole") {} + CmdDropRole() : BasicCommand("dropRole") {} virtual bool slaveOk() const { return false; @@ -644,9 +644,9 @@ public: } cmdDropRole; -class CmdDropAllRolesFromDatabase : public Command { +class CmdDropAllRolesFromDatabase : public BasicCommand { public: - CmdDropAllRolesFromDatabase() : Command("dropAllRolesFromDatabase") {} + CmdDropAllRolesFromDatabase() : BasicCommand("dropAllRolesFromDatabase") {} virtual bool slaveOk() const { return false; @@ -688,9 +688,9 @@ public: } cmdDropAllRolesFromDatabase; -class CmdRolesInfo : public Command { +class CmdRolesInfo : public BasicCommand { public: - CmdRolesInfo() : Command("rolesInfo") {} + CmdRolesInfo() : BasicCommand("rolesInfo") {} virtual bool slaveOk() const { return false; @@ -726,9 +726,9 @@ public: } cmdRolesInfo; -class CmdInvalidateUserCache : public Command { +class CmdInvalidateUserCache : public BasicCommand { public: - CmdInvalidateUserCache() : Command("invalidateUserCache") {} + CmdInvalidateUserCache() : BasicCommand("invalidateUserCache") {} virtual bool slaveOk() const { return true; @@ -776,9 +776,9 @@ public: * It either adds the users/roles to the existing ones or replaces the existing ones, depending * on whether the "drop" argument is true or false. */ -class CmdMergeAuthzCollections : public Command { +class CmdMergeAuthzCollections : public BasicCommand { public: - CmdMergeAuthzCollections() : Command("_mergeAuthzCollections") {} + CmdMergeAuthzCollections() : BasicCommand("_mergeAuthzCollections") {} virtual bool slaveOk() const { return false; @@ -866,9 +866,9 @@ Status runUpgradeOnAllShards(OperationContext* opCtx, int maxSteps, BSONObjBuild return Status::OK(); } -class CmdAuthSchemaUpgrade : public Command { +class CmdAuthSchemaUpgrade : public BasicCommand { public: - CmdAuthSchemaUpgrade() : Command("authSchemaUpgrade") {} + CmdAuthSchemaUpgrade() : BasicCommand("authSchemaUpgrade") {} virtual bool slaveOk() const { return false; diff --git a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp index 207a30c38ee..bdb8cce85a8 100644 --- a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp +++ b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp @@ -34,9 +34,9 @@ namespace mongo { namespace { -class WhatsMyUriCmd : public Command { +class WhatsMyUriCmd : public BasicCommand { public: - WhatsMyUriCmd() : Command("whatsmyuri") {} + WhatsMyUriCmd() : BasicCommand("whatsmyuri") {} virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp index b4dd380fae5..166768d3033 100644 --- a/src/mongo/s/commands/cluster_write_cmd.cpp +++ b/src/mongo/s/commands/cluster_write_cmd.cpp @@ -63,7 +63,7 @@ namespace { * * Batch execution (targeting and dispatching) is performed by the BatchWriteExec class. */ -class ClusterWriteCmd : public Command { +class ClusterWriteCmd : public BasicCommand { public: virtual ~ClusterWriteCmd() {} @@ -195,7 +195,7 @@ protected: * write batches of type "writeType", and will require privilege "action" to run. */ ClusterWriteCmd(StringData name, BatchedCommandRequest::BatchType writeType) - : Command(name), _writeType(writeType) {} + : BasicCommand(name), _writeType(writeType) {} private: // Type of batch (e.g. insert, update). diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp index 9ba05a7298b..717f7057fba 100644 --- a/src/mongo/s/commands/commands_public.cpp +++ b/src/mongo/s/commands/commands_public.cpp @@ -147,9 +147,9 @@ StatusWith<BSONObj> getCollation(const BSONObj& cmdObj) { return BSONObj(); } -class PublicGridCommand : public Command { +class PublicGridCommand : public BasicCommand { protected: - PublicGridCommand(const char* n, const char* oldname = NULL) : Command(n, oldname) {} + PublicGridCommand(const char* n, const char* oldname = NULL) : BasicCommand(n, oldname) {} virtual bool slaveOk() const { return true; @@ -194,13 +194,13 @@ protected: * Base class for commands on collections that simply need to broadcast the command to shards that * own data for the collection and aggregate the raw results. */ -class AllShardsCollectionCommand : public Command { +class AllShardsCollectionCommand : public BasicCommand { protected: AllShardsCollectionCommand(const char* name, const char* oldname = NULL, bool implicitCreateDb = false, bool appendShardVersion = true) - : Command(name, oldname), + : BasicCommand(name, oldname), _implicitCreateDb(implicitCreateDb), _appendShardVersion(appendShardVersion) {} |