diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2017-07-14 17:15:52 -0400 |
---|---|---|
committer | Matthew Russotto <matthew.russotto@10gen.com> | 2017-07-17 08:52:57 -0400 |
commit | 3d38a6ff86b47b71d735b77f39704adec3ef3da7 (patch) | |
tree | 8f318b2b52852a1511ed6da6ede9ac62cbe67d4d /src/mongo/db/clientcursor.h | |
parent | a1c67941bf08c69cab04eba20bc9ce9a763e1c7f (diff) | |
download | mongo-3d38a6ff86b47b71d735b77f39704adec3ef3da7.tar.gz |
SERVER-29128 Fix performance regression on awaitData with lastKnownCommittedOpTime
Revert "Revert "SERVER-29128 Make $changeNotification stage return a tailable, awaitData cursor that continuously gives out oplog entries""
This reverts commit d29e92cffcb4db3cdd77b1e53d5d005db6cc309d.
Diffstat (limited to 'src/mongo/db/clientcursor.h')
-rw-r--r-- | src/mongo/db/clientcursor.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h index 32fb018a8e1..f75d41e3089 100644 --- a/src/mongo/db/clientcursor.h +++ b/src/mongo/db/clientcursor.h @@ -71,6 +71,20 @@ struct ClientCursorParams { } } + void setTailable(bool tailable) { + if (tailable) + queryOptions |= QueryOption_CursorTailable; + else + queryOptions &= ~QueryOption_CursorTailable; + } + + void setAwaitData(bool awaitData) { + if (awaitData) + queryOptions |= QueryOption_AwaitData; + else + queryOptions &= ~QueryOption_AwaitData; + } + std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> exec; const NamespaceString nss; std::vector<UserName> authenticatedUsers; @@ -127,10 +141,23 @@ public: return _exec.get(); } + /** + * Returns the query options bitmask. If you'd like to know if the cursor is tailable or + * awaitData, prefer using the specific methods isTailable() and isAwaitData() over using this + * method. + */ int queryOptions() const { return _queryOptions; } + bool isTailable() const { + return _queryOptions & QueryOption_CursorTailable; + } + + bool isAwaitData() const { + return _queryOptions & QueryOption_AwaitData; + } + const BSONObj& getOriginatingCommandObj() const { return _originatingCommand; } |