summaryrefslogtreecommitdiff
path: root/src/mongo/db/clientcursor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/clientcursor.h')
-rw-r--r--src/mongo/db/clientcursor.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h
index b0244aeb8f7..673fd92bf06 100644
--- a/src/mongo/db/clientcursor.h
+++ b/src/mongo/db/clientcursor.h
@@ -135,10 +135,23 @@ public:
return _idleAgeMillis;
}
- uint64_t getLeftoverMaxTimeMicros() const {
+ /**
+ * Returns the amount of time execution time available to this cursor. Only valid at the
+ * beginning of a getMore request, and only really for use by the maxTime tracking code.
+ *
+ * Microseconds::max() == infinity, values less than 1 mean no time left.
+ */
+ Microseconds getLeftoverMaxTimeMicros() const {
return _leftoverMaxTimeMicros;
}
- void setLeftoverMaxTimeMicros(uint64_t leftoverMaxTimeMicros) {
+
+ /**
+ * Sets the amount of execution time available to this cursor. This is only called when an
+ * operation that uses a cursor is finishing, to update its remaining time.
+ *
+ * Microseconds::max() == infinity, values less than 1 mean no time left.
+ */
+ void setLeftoverMaxTimeMicros(Microseconds leftoverMaxTimeMicros) {
_leftoverMaxTimeMicros = leftoverMaxTimeMicros;
}
@@ -248,8 +261,8 @@ private:
// How long has the cursor been idle?
int _idleAgeMillis;
- // TODO: Document.
- uint64_t _leftoverMaxTimeMicros;
+ // Unused maxTime budget for this cursor.
+ Microseconds _leftoverMaxTimeMicros = Microseconds::max();
//
// The underlying execution machinery.