diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-05-16 19:26:05 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-05-17 19:29:36 -0400 |
commit | a5bfc0ee7d76e02f050eb24735d25d71fb111db8 (patch) | |
tree | fc0bd4ddf4c606fa0fa0fdb0105c7d4c4ed03743 /src/mongo/db/commands.h | |
parent | 2c8f21deb338a7482553dec6797356843156854b (diff) | |
download | mongo-a5bfc0ee7d76e02f050eb24735d25d71fb111db8.tar.gz |
SERVER-29249 Move mongod-specific command logic to run_commands.cpp
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r-- | src/mongo/db/commands.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index f169f651e6f..39246d357a2 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -297,28 +297,6 @@ public: static Command* findCommand(StringData name); - /** - * Executes a command after stripping metadata, performing authorization checks, - * handling audit impersonation, and (potentially) setting maintenance mode. This method - * also checks that the command is permissible to run on the node given its current - * replication state. All the logic here is independent of any particular command; any - * functionality relevant to a specific command should be confined to its run() method. - * - * This is currently used by mongod and dbwebserver. - */ - static void execCommand(OperationContext* opCtx, - Command* command, - const rpc::RequestInterface& request, - rpc::ReplyBuilderInterface* replyBuilder); - - using ExecCommandHandler = decltype(Command::execCommand); - - /** - * Registers the implementation of the `registerExecCommand` function. This must be called from - * a MONGO_INITIALIZER context and/or a single-threaded context. - */ - static void registerExecCommand(stdx::function<ExecCommandHandler> handler); - // Helper for setting errmsg and ok field in command result object. static void appendCommandStatus(BSONObjBuilder& result, bool ok, const std::string& errmsg); @@ -387,66 +365,6 @@ public: const Command& command); /** - * When an assertion is hit during command execution, this method is used to fill the fields - * of the command reply with the information from the error. In addition, information about - * the command is logged. This function does not return anything, because there is typically - * already an active exception when this function is called, so there - * is little that can be done if it fails. - */ - static void generateErrorResponse(OperationContext* opCtx, - rpc::ReplyBuilderInterface* replyBuilder, - const DBException& exception, - const rpc::RequestInterface& request, - Command* command, - const BSONObj& metadata); - - /** - * Generates a command error response. This overload of generateErrorResponse is intended - * to also add an operationTime. - */ - static void generateErrorResponse(OperationContext* opCtx, - rpc::ReplyBuilderInterface* replyBuilder, - const DBException& exception, - const rpc::RequestInterface& request, - Command* command, - const BSONObj& metadata, - LogicalTime operationTime); - /** - * Generates a command error response. This overload of generateErrorResponse is intended - * to be called if the command is successfully parsed, but there is an error before we have - * a handle to the actual Command object. This can happen, for example, when the command - * is not found. - */ - static void generateErrorResponse(OperationContext* opCtx, - rpc::ReplyBuilderInterface* replyBuilder, - const DBException& exception, - const rpc::RequestInterface& request); - - /** - * Generates a command error response. Similar to other overloads of generateErrorResponse, - * but doesn't print any information about the specific command being executed. This is - * neccessary, for example, if there is - * an assertion hit while parsing the command. - */ - static void generateErrorResponse(OperationContext* opCtx, - rpc::ReplyBuilderInterface* replyBuilder, - const DBException& exception); - - /** - * Records the error on to the OperationContext. This hook is needed because mongos - * does not have CurOp linked in to it. - */ - static void registerError(OperationContext* opCtx, const DBException& exception); - - /** - * Registers the implementation of the `registerError` function. This hook is needed because - * mongos does not have CurOp linked in to it. This must be called from a MONGO_INITIALIZER - * context and/or a single-threaded context. - */ - static void registerRegisterError( - stdx::function<void(OperationContext*, const DBException&)> registerErrorHandler); - - /** * This function checks if a command is a user management command by name. */ static bool isUserManagementCommand(const std::string& name); |