diff options
author | samantharitter <samantha.ritter@10gen.com> | 2017-08-15 18:03:59 -0400 |
---|---|---|
committer | samantharitter <samantha.ritter@10gen.com> | 2017-08-18 08:49:39 -0400 |
commit | cacf36cb6647c9f3f6e895c7face718a54725567 (patch) | |
tree | 8c177186fadf8b109e5edac6e8b9f501fbad4966 /src/mongo/db/sessions_collection_mock.cpp | |
parent | 854cc3ca62115c0296e27c75ff017a11614254c6 (diff) | |
download | mongo-cacf36cb6647c9f3f6e895c7face718a54725567.tar.gz |
SERVER-29202 Remove unused fetch methods from logical session cache
Diffstat (limited to 'src/mongo/db/sessions_collection_mock.cpp')
-rw-r--r-- | src/mongo/db/sessions_collection_mock.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/mongo/db/sessions_collection_mock.cpp b/src/mongo/db/sessions_collection_mock.cpp index 09deaaa3b1f..b70f8e015bf 100644 --- a/src/mongo/db/sessions_collection_mock.cpp +++ b/src/mongo/db/sessions_collection_mock.cpp @@ -34,16 +34,11 @@ namespace mongo { MockSessionsCollectionImpl::MockSessionsCollectionImpl() : _sessions(), - _fetch(stdx::bind(&MockSessionsCollectionImpl::_fetchRecord, this, stdx::placeholders::_1)), _refresh( stdx::bind(&MockSessionsCollectionImpl::_refreshSessions, this, stdx::placeholders::_1)), _remove( stdx::bind(&MockSessionsCollectionImpl::_removeRecords, this, stdx::placeholders::_1)) {} -void MockSessionsCollectionImpl::setFetchHook(FetchHook hook) { - _fetch = std::move(hook); -} - void MockSessionsCollectionImpl::setRefreshHook(RefreshHook hook) { _refresh = std::move(hook); } @@ -53,17 +48,11 @@ void MockSessionsCollectionImpl::setRemoveHook(RemoveHook hook) { } void MockSessionsCollectionImpl::clearHooks() { - _fetch = stdx::bind(&MockSessionsCollectionImpl::_fetchRecord, this, stdx::placeholders::_1); _refresh = stdx::bind(&MockSessionsCollectionImpl::_refreshSessions, this, stdx::placeholders::_1); _remove = stdx::bind(&MockSessionsCollectionImpl::_removeRecords, this, stdx::placeholders::_1); } -StatusWith<LogicalSessionRecord> MockSessionsCollectionImpl::fetchRecord( - const LogicalSessionId& id) { - return _fetch(id); -} - Status MockSessionsCollectionImpl::refreshSessions(const LogicalSessionRecordSet& sessions) { return _refresh(sessions); } @@ -96,19 +85,6 @@ const MockSessionsCollectionImpl::SessionMap& MockSessionsCollectionImpl::sessio return _sessions; } -StatusWith<LogicalSessionRecord> MockSessionsCollectionImpl::_fetchRecord( - const LogicalSessionId& id) { - stdx::unique_lock<stdx::mutex> lk(_mutex); - - // If we do not have this record, return an error - auto it = _sessions.find(id); - if (it == _sessions.end()) { - return {ErrorCodes::NoSuchSession, "No matching record in the sessions collection"}; - } - - return it->second; -} - Status MockSessionsCollectionImpl::_refreshSessions(const LogicalSessionRecordSet& sessions) { for (auto& record : sessions) { if (!has(record.getId())) { |