summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.h
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2018-03-09 15:29:36 -0500
committerBilly Donahue <billy.donahue@mongodb.com>2018-03-15 16:09:55 -0400
commitff3674197c34af10b438bb99e3ac77571347660a (patch)
tree0211a7ef42f3d9ae371497941372efb666a33c1d /src/mongo/db/commands.h
parent146bc6e17c9b38889c00b62f80b070735d96a8f5 (diff)
downloadmongo-ff3674197c34af10b438bb99e3ac77571347660a.tar.gz
SERVER-33816 convert "explain" command to single-parse model
logAuthViolation depurify Command::enhancedRun lifetime issue with inner OpMsgRequest parse() return needs explicit unique_ptr ctor checkAuthForOperation elim move commandCanRunHere check from parse() to run()
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r--src/mongo/db/commands.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h
index 25ce1f056b0..7c3e7c63b0c 100644
--- a/src/mongo/db/commands.h
+++ b/src/mongo/db/commands.h
@@ -192,6 +192,13 @@ struct CommandHelpers {
*/
static BSONObj runCommandDirectly(OperationContext* opCtx, const OpMsgRequest& request);
+ static void logAuthViolation(OperationContext* opCtx,
+ const Command* command,
+ const OpMsgRequest& request,
+ ErrorCodes::Error err);
+
+ static void uassertNoDocumentSequences(StringData commandName, const OpMsgRequest& request);
+
static constexpr StringData kHelpFieldName = "help"_sd;
};
@@ -447,7 +454,9 @@ private:
*/
virtual bool enhancedRun(OperationContext* opCtx,
const OpMsgRequest& request,
- BSONObjBuilder& result) = 0;
+ BSONObjBuilder& result) {
+ MONGO_UNREACHABLE;
+ }
// Counters for how many times this command has been executed and failed
Counter64 _commandsExecuted;
@@ -646,8 +655,6 @@ private:
* Calls checkAuthForOperation.
*/
Status checkAuthForRequest(OperationContext* opCtx, const OpMsgRequest& request) const final;
-
- void uassertNoDocumentSequences(const OpMsgRequest& request) const;
};
/**