summaryrefslogtreecommitdiff
path: root/src/mongo/db/sessions_collection_mock.cpp
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2017-06-08 09:37:29 -0400
committerJames Wahlin <james@mongodb.com>2017-06-08 09:37:29 -0400
commit12e54a966bde02389224b78db6500978ca68a54e (patch)
tree815944562c042f09f9664c3e32ab00de12370215 /src/mongo/db/sessions_collection_mock.cpp
parent6f8b26a49dd6fb150689ecd970f47a48e15bd28b (diff)
downloadmongo-12e54a966bde02389224b78db6500978ca68a54e.tar.gz
Revert "SERVER-28346 Add more unit tests for the logical session cache"
This reverts commit 4c3337abe512a37c8e4cb22e16eafcd04bc5bd3a.
Diffstat (limited to 'src/mongo/db/sessions_collection_mock.cpp')
-rw-r--r--src/mongo/db/sessions_collection_mock.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/db/sessions_collection_mock.cpp b/src/mongo/db/sessions_collection_mock.cpp
index 4abc5a326d1..a56f6dec21a 100644
--- a/src/mongo/db/sessions_collection_mock.cpp
+++ b/src/mongo/db/sessions_collection_mock.cpp
@@ -73,11 +73,12 @@ Status MockSessionsCollectionImpl::insertRecord(LogicalSessionRecord record) {
return _insert(std::move(record));
}
-LogicalSessionIdSet MockSessionsCollectionImpl::refreshSessions(LogicalSessionIdSet sessions) {
+MockSessionsCollectionImpl::SessionList MockSessionsCollectionImpl::refreshSessions(
+ SessionList sessions) {
return _refresh(std::move(sessions));
}
-void MockSessionsCollectionImpl::removeRecords(LogicalSessionIdSet sessions) {
+void MockSessionsCollectionImpl::removeRecords(SessionList sessions) {
_remove(std::move(sessions));
}
@@ -130,15 +131,16 @@ Status MockSessionsCollectionImpl::_insertRecord(LogicalSessionRecord record) {
return Status::OK();
}
-LogicalSessionIdSet MockSessionsCollectionImpl::_refreshSessions(LogicalSessionIdSet sessions) {
- LogicalSessionIdSet notFound{};
+MockSessionsCollectionImpl::SessionList MockSessionsCollectionImpl::_refreshSessions(
+ SessionList sessions) {
+ SessionList notFound{};
{
stdx::unique_lock<stdx::mutex> lk(_mutex);
for (auto& lsid : sessions) {
auto it = _sessions.find(lsid);
if (it == _sessions.end()) {
- notFound.insert(lsid);
+ notFound.push_back(lsid);
}
}
}
@@ -146,7 +148,7 @@ LogicalSessionIdSet MockSessionsCollectionImpl::_refreshSessions(LogicalSessionI
return notFound;
}
-void MockSessionsCollectionImpl::_removeRecords(LogicalSessionIdSet sessions) {
+void MockSessionsCollectionImpl::_removeRecords(SessionList sessions) {
stdx::unique_lock<stdx::mutex> lk(_mutex);
for (auto& lsid : sessions) {
_sessions.erase(lsid);