summaryrefslogtreecommitdiff
path: root/src/mongo/db/cursor_manager.h
diff options
context:
space:
mode:
authorsamantharitter <samantha.ritter@10gen.com>2017-06-14 18:10:25 -0400
committersamantharitter <samantha.ritter@10gen.com>2017-06-14 18:10:25 -0400
commit65828661c6579989fdbb43f2c21de16f2bf72586 (patch)
treeb181eaf074e40a095639be071f2e2ef53a5004b9 /src/mongo/db/cursor_manager.h
parent6c0e2884a22a82d57f2cef12756fc6a7609e20c9 (diff)
downloadmongo-65828661c6579989fdbb43f2c21de16f2bf72586.tar.gz
SERVER-29417 Attach logical session ids to cursors
Diffstat (limited to 'src/mongo/db/cursor_manager.h')
-rw-r--r--src/mongo/db/cursor_manager.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mongo/db/cursor_manager.h b/src/mongo/db/cursor_manager.h
index 40408c48830..0b243e21996 100644
--- a/src/mongo/db/cursor_manager.h
+++ b/src/mongo/db/cursor_manager.h
@@ -36,6 +36,7 @@
#include "mongo/db/record_id.h"
#include "mongo/platform/unordered_map.h"
#include "mongo/platform/unordered_set.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/util/concurrency/mutex.h"
#include "mongo/util/duration.h"
@@ -78,6 +79,12 @@ public:
static constexpr Minutes kDefaultCursorTimeoutMinutes{10};
using RegistrationToken = Partitioned<unordered_set<PlanExecutor*>>::PartitionId;
+ /**
+ * Appends the sessions that have open cursors on the global cursor manager and across
+ * all collection-level cursor managers to the given set of lsids.
+ */
+ static void appendAllActiveSessions(OperationContext* opCtx, LogicalSessionIdSet* lsids);
+
CursorManager(NamespaceString nss);
/**
@@ -159,6 +166,16 @@ public:
void getCursorIds(std::set<CursorId>* openCursors) const;
/**
+ * Appends sessions that have open cursors in this cursor manager to the given set of lsids.
+ */
+ void appendActiveSessions(LogicalSessionIdSet* lsids) const;
+
+ /*
+ * Returns a list of all open cursors for the given session.
+ */
+ stdx::unordered_set<CursorId> getCursorsForSession(LogicalSessionId lsid) const;
+
+ /**
* Returns the number of ClientCursors currently registered. Excludes any registered bare
* PlanExecutors.
*/