diff options
author | samantharitter <samantha.ritter@10gen.com> | 2017-08-15 16:17:37 -0400 |
---|---|---|
committer | samantharitter <samantha.ritter@10gen.com> | 2017-08-18 08:49:39 -0400 |
commit | 854cc3ca62115c0296e27c75ff017a11614254c6 (patch) | |
tree | a68e64b99d5fb4ece3c4562aa5463d42cd02c66c /src/mongo/db/sessions_collection.h | |
parent | 583127818f1ead21b67a57eb117b9678232e5472 (diff) | |
download | mongo-854cc3ca62115c0296e27c75ff017a11614254c6.tar.gz |
SERVER-29202 Implement SessionsCollectionRS
Diffstat (limited to 'src/mongo/db/sessions_collection.h')
-rw-r--r-- | src/mongo/db/sessions_collection.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mongo/db/sessions_collection.h b/src/mongo/db/sessions_collection.h index 128898e63de..79a9b23535f 100644 --- a/src/mongo/db/sessions_collection.h +++ b/src/mongo/db/sessions_collection.h @@ -35,15 +35,17 @@ namespace mongo { class BSONArrayBuilder; class BSONObjBuilder; +class DBClientBase; class OperationContext; /** * An abstract interface describing the entrypoint into the sessions collection. * * Different server deployments (standalone, replica set, sharded cluster) should - * implement their own class that fulfill this interface. + * implement their own classes that fulfill this interface. */ class SessionsCollection { + public: virtual ~SessionsCollection(); @@ -77,17 +79,26 @@ public: virtual Status removeRecords(OperationContext* opCtx, const LogicalSessionIdSet& sessions) = 0; protected: + /** + * Makes a send function for the given client. + */ using SendBatchFn = stdx::function<Status(BSONObj batch)>; + SendBatchFn makeSendFnForCommand(DBClientBase* client); + SendBatchFn makeSendFnForBatchWrite(DBClientBase* client); /** * Formats and sends batches of refreshes for the given set of sessions. */ Status doRefresh(const LogicalSessionRecordSet& sessions, Date_t refreshTime, SendBatchFn send); + Status doRefreshExternal(const LogicalSessionRecordSet& sessions, + Date_t refreshTime, + SendBatchFn send); /** * Formats and sends batches of deletes for the given set of sessions. */ Status doRemove(const LogicalSessionIdSet& sessions, SendBatchFn send); + Status doRemoveExternal(const LogicalSessionIdSet& sessions, SendBatchFn send); }; } // namespace mongo |