summaryrefslogtreecommitdiff
path: root/src/mongo/db/sessions_collection.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2019-10-31 16:38:01 +0000
committerevergreen <evergreen@mongodb.com>2019-10-31 16:38:01 +0000
commit1f94484d52064e12baedc7b586a8238d63560baf (patch)
tree5bb03cebfcb2d3137321b4762a0500f8831463dd /src/mongo/db/sessions_collection.h
parent7a3d17ea6b73bc916d94e59a44d5c1a56cbcb2e5 (diff)
downloadmongo-1f94484d52064e12baedc7b586a8238d63560baf.tar.gz
SERVER-42508 Get rid of some additional unused code in SessionsCollection
... and also improve comments.
Diffstat (limited to 'src/mongo/db/sessions_collection.h')
-rw-r--r--src/mongo/db/sessions_collection.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/mongo/db/sessions_collection.h b/src/mongo/db/sessions_collection.h
index 58230d7a83f..e10b493b332 100644
--- a/src/mongo/db/sessions_collection.h
+++ b/src/mongo/db/sessions_collection.h
@@ -51,7 +51,8 @@ public:
virtual ~SessionsCollection();
/**
- * Ensures that the sessions collection exists and has the proper indexes.
+ * Ensures that the sessions collection exists and has the proper indexes. Implementations of
+ * this method must support multiple concurrent invocations.
*/
virtual void setupSessionsCollection(OperationContext* opCtx) = 0;
@@ -61,8 +62,8 @@ public:
virtual void checkSessionsCollectionExists(OperationContext* opCtx) = 0;
/**
- * Updates the last-use times on the given sessions to be greater than
- * or equal to the given time. Throws an exception if a networking issue occurred.
+ * Updates the last-use times on the given sessions to be greater than or equal to the given
+ * time. Throws an exception if a networking issue occurred.
*/
virtual void refreshSessions(OperationContext* opCtx,
const LogicalSessionRecordSet& sessions) = 0;
@@ -70,15 +71,15 @@ public:
/**
* Removes the authoritative records for the specified sessions.
*
- * Implementations should perform authentication checks to ensure that
- * session records may only be removed if their owner is logged in.
+ * Implementations should perform authentication checks to ensure that session records may only
+ * be removed if their owner is logged in.
*
* Throws an exception if the removal fails, for example from a network error.
*/
virtual void removeRecords(OperationContext* opCtx, const LogicalSessionIdSet& sessions) = 0;
/**
- * Checks a set of lsids and returns the set that no longer exists
+ * Checks a set of lsids and returns the set that no longer exists.
*
* Throws an exception if the fetch cannot occur, for example from a network error.
*/
@@ -98,9 +99,6 @@ public:
protected:
SessionsCollection();
- /**
- * Makes a send function for the given client.
- */
using SendBatchFn = std::function<void(BSONObj batch)>;
static SendBatchFn makeSendFnForCommand(const NamespaceString& ns, DBClientBase* client);
static SendBatchFn makeSendFnForBatchWrite(const NamespaceString& ns, DBClientBase* client);
@@ -111,25 +109,25 @@ protected:
/**
* Formats and sends batches of refreshes for the given set of sessions.
*/
- void doRefresh(const NamespaceString& ns,
- const std::vector<LogicalSessionRecord>& sessions,
- SendBatchFn send);
+ void _doRefresh(const NamespaceString& ns,
+ const std::vector<LogicalSessionRecord>& sessions,
+ SendBatchFn send);
/**
* Formats and sends batches of deletes for the given set of sessions.
*/
- void doRemove(const NamespaceString& ns,
- const std::vector<LogicalSessionId>& sessions,
- SendBatchFn send);
+ void _doRemove(const NamespaceString& ns,
+ const std::vector<LogicalSessionId>& sessions,
+ SendBatchFn send);
/**
* Returns those lsids from the input 'sessions' array which are not present in the sessions
* collection (essentially performs an inner join of 'sessions' against the sessions
* collection).
*/
- LogicalSessionIdSet doFindRemoved(const NamespaceString& ns,
- const std::vector<LogicalSessionId>& sessions,
- FindBatchFn send);
+ LogicalSessionIdSet _doFindRemoved(const NamespaceString& ns,
+ const std::vector<LogicalSessionId>& sessions,
+ FindBatchFn send);
};
} // namespace mongo