summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient_cursor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client/dbclient_cursor.h')
-rw-r--r--src/mongo/client/dbclient_cursor.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mongo/client/dbclient_cursor.h b/src/mongo/client/dbclient_cursor.h
index b342d432443..b0e1551802b 100644
--- a/src/mongo/client/dbclient_cursor.h
+++ b/src/mongo/client/dbclient_cursor.h
@@ -244,6 +244,13 @@ public:
_lastKnownCommittedOpTime = lastCommittedOpTime;
}
+ /**
+ * Returns the resume token for the latest batch, it set.
+ */
+ virtual boost::optional<BSONObj> getPostBatchResumeToken() const {
+ return _postBatchResumeToken;
+ }
+
protected:
struct Batch {
// TODO remove constructors after c++17 toolchain upgrade
@@ -299,6 +306,7 @@ private:
Milliseconds _awaitDataTimeout = Milliseconds{0};
boost::optional<long long> _term;
boost::optional<repl::OpTime> _lastKnownCommittedOpTime;
+ boost::optional<BSONObj> _postBatchResumeToken;
void dataReceived(const Message& reply) {
bool retry;
@@ -341,6 +349,14 @@ public:
return _c.getNamespaceString();
}
+ const long long getCursorId() const {
+ return _c.getCursorId();
+ }
+
+ boost::optional<BSONObj> getPostBatchResumeToken() const {
+ return _c.getPostBatchResumeToken();
+ }
+
private:
DBClientCursor& _c;
int _n;