diff options
author | James Wahlin <james.wahlin@10gen.com> | 2016-12-02 11:15:23 -0500 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2016-12-06 08:42:52 -0500 |
commit | 62245660d4567096c184befc08267b77c9e3a3bb (patch) | |
tree | 01b10d2585286ff93267fd8d49e6c0cfdbd51e46 /src/mongo/db/write_concern.h | |
parent | 8624eb6c5234abfba31dcf4f8cff4f89c9bcfee6 (diff) | |
download | mongo-62245660d4567096c184befc08267b77c9e3a3bb.tar.gz |
SERVER-27176 Improve performance of command writeConcern parsing
Diffstat (limited to 'src/mongo/db/write_concern.h')
-rw-r--r-- | src/mongo/db/write_concern.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/write_concern.h b/src/mongo/db/write_concern.h index 9a9720f26ee..13bae072b05 100644 --- a/src/mongo/db/write_concern.h +++ b/src/mongo/db/write_concern.h @@ -28,6 +28,7 @@ #pragma once +#include "mongo/bson/bsonobj.h" #include "mongo/db/write_concern_options.h" #include "mongo/util/net/hostandport.h" @@ -42,14 +43,18 @@ class OpTime; } /** + * Returns true if 'cmdObj' has a 'writeConcern' field. + */ +bool commandSpecifiesWriteConcern(const BSONObj& cmdObj); + +/** * Attempts to extract a writeConcern from cmdObj. * Verifies that the writeConcern is of type Object (BSON type) and * that the resulting writeConcern is valid for this particular host. */ StatusWith<WriteConcernOptions> extractWriteConcern(OperationContext* txn, const BSONObj& cmdObj, - const std::string& dbName, - const bool supportsWriteConcern); + const std::string& dbName); /** * Verifies that a WriteConcern is valid for this particular host and database. |