summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/aggregation_request.h
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@10gen.com>2017-03-15 17:09:33 -0400
committerJames Wahlin <james.wahlin@10gen.com>2017-04-05 13:51:03 -0400
commitc3341d179db1c36722284676d99cb1c664fb1821 (patch)
treef69c9c00fc8df3ccf6db6df50a78319ff1e38950 /src/mongo/db/pipeline/aggregation_request.h
parent8765acc0fcc6ca3dd7158521ba8d864af4e0f2df (diff)
downloadmongo-c3341d179db1c36722284676d99cb1c664fb1821.tar.gz
SERVER-28040 Fix maxTimeMS/readPref/readConcern for sharded view query
Diffstat (limited to 'src/mongo/db/pipeline/aggregation_request.h')
-rw-r--r--src/mongo/db/pipeline/aggregation_request.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/aggregation_request.h b/src/mongo/db/pipeline/aggregation_request.h
index 935b98fed97..1f290f26a90 100644
--- a/src/mongo/db/pipeline/aggregation_request.h
+++ b/src/mongo/db/pipeline/aggregation_request.h
@@ -140,6 +140,18 @@ public:
return _explainMode;
}
+ unsigned int getMaxTimeMS() const {
+ return _maxTimeMS;
+ }
+
+ const BSONObj& getReadConcern() const {
+ return _readConcern;
+ }
+
+ const BSONObj& getUnwrappedReadPref() const {
+ return _unwrappedReadPref;
+ }
+
//
// Setters for optional fields.
//
@@ -180,6 +192,18 @@ public:
_bypassDocumentValidation = shouldBypassDocumentValidation;
}
+ void setMaxTimeMS(unsigned int maxTimeMS) {
+ _maxTimeMS = maxTimeMS;
+ }
+
+ void setReadConcern(BSONObj readConcern) {
+ _readConcern = readConcern.getOwned();
+ }
+
+ void setUnwrappedReadPref(BSONObj unwrappedReadPref) {
+ _unwrappedReadPref = unwrappedReadPref.getOwned();
+ }
+
private:
// Required fields.
const NamespaceString _nss;
@@ -203,11 +227,21 @@ private:
// The comment parameter attached to this aggregation.
std::string _comment;
+ BSONObj _readConcern;
+
+ // The unwrapped readPreference object, if one was given to us by the mongos command processor.
+ // This object will be empty when no readPreference is specified or if the request does not
+ // originate from mongos.
+ BSONObj _unwrappedReadPref;
+
// The explain mode to use, or boost::none if this is not a request for an aggregation explain.
boost::optional<ExplainOptions::Verbosity> _explainMode;
bool _allowDiskUse = false;
bool _fromRouter = false;
bool _bypassDocumentValidation = false;
+
+ // A user-specified maxTimeMS limit, or a value of '0' if not specified.
+ unsigned int _maxTimeMS = 0;
};
} // namespace mongo