summaryrefslogtreecommitdiff
path: root/src/mongo/db/run_op_kill_cursors.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2019-02-04 10:45:12 -0500
committerDavid Storch <david.storch@10gen.com>2019-02-05 08:34:35 -0500
commitcb1aabbba7093b6c42b6986a9ad0aea31528929a (patch)
treeacd49931110ac57d13e70f870528929b1b2dd631 /src/mongo/db/run_op_kill_cursors.h
parent9a90dfc2fbe769d3caf02a3550f00bc9fa9df483 (diff)
downloadmongo-cb1aabbba7093b6c42b6986a9ad0aea31528929a.tar.gz
SERVER-37454 Delete GlobalCursorIdCache.
Diffstat (limited to 'src/mongo/db/run_op_kill_cursors.h')
-rw-r--r--src/mongo/db/run_op_kill_cursors.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/mongo/db/run_op_kill_cursors.h b/src/mongo/db/run_op_kill_cursors.h
new file mode 100644
index 00000000000..c4ffc1d742d
--- /dev/null
+++ b/src/mongo/db/run_op_kill_cursors.h
@@ -0,0 +1,48 @@
+/**
+ * Copyright (C) 2018-present MongoDB, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the Server Side Public License, version 1,
+ * as published by MongoDB, Inc.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Server Side Public License for more details.
+ *
+ * You should have received a copy of the Server Side Public License
+ * along with this program. If not, see
+ * <http://www.mongodb.com/licensing/server-side-public-license>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the Server Side Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#pragma once
+
+#include "mongo/db/operation_context.h"
+
+namespace mongo {
+
+/**
+ * Kills the cursors inside the array of cursor ids pointed to by 'idsArray', after checking that
+ * the logged in user is authorized to do so. 'numCursorIds' is the number of cursors in 'idsArray'.
+ * Also responsible for audit logging.
+ *
+ * Returns the number of cursors killed.
+ *
+ * The caller is responsible for validating that 'numCursorIds' > 0 and that the array is actually
+ * of size 'numCursorIds'.
+ */
+int runOpKillCursors(OperationContext* opCtx, size_t numCursorIds, const char* idsArray);
+
+} // namespace mongo