summaryrefslogtreecommitdiff
path: root/src/mongo/db/sessions_collection_standalone.cpp
diff options
context:
space:
mode:
authorsamantharitter <samantha.ritter@10gen.com>2017-08-15 16:17:37 -0400
committersamantharitter <samantha.ritter@10gen.com>2017-08-18 08:49:39 -0400
commit854cc3ca62115c0296e27c75ff017a11614254c6 (patch)
treea68e64b99d5fb4ece3c4562aa5463d42cd02c66c /src/mongo/db/sessions_collection_standalone.cpp
parent583127818f1ead21b67a57eb117b9678232e5472 (diff)
downloadmongo-854cc3ca62115c0296e27c75ff017a11614254c6.tar.gz
SERVER-29202 Implement SessionsCollectionRS
Diffstat (limited to 'src/mongo/db/sessions_collection_standalone.cpp')
-rw-r--r--src/mongo/db/sessions_collection_standalone.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/mongo/db/sessions_collection_standalone.cpp b/src/mongo/db/sessions_collection_standalone.cpp
index 093b61ef959..bbff1db1757 100644
--- a/src/mongo/db/sessions_collection_standalone.cpp
+++ b/src/mongo/db/sessions_collection_standalone.cpp
@@ -64,28 +64,13 @@ Status SessionsCollectionStandalone::refreshSessions(OperationContext* opCtx,
const LogicalSessionRecordSet& sessions,
Date_t refreshTime) {
DBDirectClient client(opCtx);
- return doRefresh(sessions, refreshTime, makeSendFn(&client));
+ return doRefresh(sessions, refreshTime, makeSendFnForBatchWrite(&client));
}
Status SessionsCollectionStandalone::removeRecords(OperationContext* opCtx,
const LogicalSessionIdSet& sessions) {
DBDirectClient client(opCtx);
- return doRemove(sessions, makeSendFn(&client));
+ return doRemove(sessions, makeSendFnForBatchWrite(&client));
}
-SessionsCollection::SendBatchFn SessionsCollectionStandalone::makeSendFn(DBDirectClient* client) {
- auto send = [client](BSONObj batch) -> Status {
- BSONObj res;
- auto ok = client->runCommand(SessionsCollection::kSessionsDb.toString(), batch, res);
- if (!ok) {
- return {ErrorCodes::UnknownError,
- client->getLastError(SessionsCollection::kSessionsDb.toString())};
- }
- return Status::OK();
- };
-
- return send;
-}
-
-
} // namespace mongo