diff options
author | Randolph Tan <randolph@10gen.com> | 2014-07-15 16:13:31 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2014-07-15 16:13:50 -0400 |
commit | 37f2a1e3b724dbd9e1f8eafd4ac87c5bf613c048 (patch) | |
tree | 2bcd919c93803f294d562761c2920fc9dd712bcd /src/mongo/db/write_concern_options.h | |
parent | d60fd22dec1c0bd104622eab463cdbba18bf11a9 (diff) | |
download | mongo-37f2a1e3b724dbd9e1f8eafd4ac87c5bf613c048.tar.gz |
Revert "SERVER-14041 enhance secondaryThrottle parameter"
This reverts commit fa1233fbe4a48ef0675820f381987f1df4f42f75.
Diffstat (limited to 'src/mongo/db/write_concern_options.h')
-rw-r--r-- | src/mongo/db/write_concern_options.h | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/src/mongo/db/write_concern_options.h b/src/mongo/db/write_concern_options.h index 31b0f556c30..44c67b2938b 100644 --- a/src/mongo/db/write_concern_options.h +++ b/src/mongo/db/write_concern_options.h @@ -37,11 +37,8 @@ namespace mongo { struct WriteConcernOptions { public: - enum SyncMode { NONE, FSYNC, JOURNAL }; - static const int kNoTimeout = 0; static const int kNoWaiting = -1; - static const BSONObj Default; static const BSONObj Acknowledged; static const BSONObj AllConfigs; @@ -49,43 +46,8 @@ namespace mongo { WriteConcernOptions() { reset(); } - WriteConcernOptions(int numNodes, - SyncMode sync, - int timeout); - - WriteConcernOptions(const std::string& mode, - SyncMode sync, - int timeout); - Status parse( const BSONObj& obj ); - /** - * Extracts the write concern settings from the BSONObj. The BSON object should have - * the format: - * - * { - * ... - * secondaryThrottle: <bool>, // optional - * _secondaryThrottle: <bool>, // optional - * writeConcern: <BSONObj> // optional - * } - * - * Note: secondaryThrottle takes precedence over _secondaryThrottle. - * - * Also sets output parameter rawWriteConcernObj if the writeCocnern field exists. - * - * Returns OK if the parse was successful. Also returns ErrorCodes::WriteConcernNotDefined - * when secondary throttle is true but write concern was not specified. - */ - Status parseSecondaryThrottle(const BSONObj& doc, - BSONObj* rawWriteConcernObj); - - /** - * Return true if the server needs to wait for other secondary nodes to satisfy this - * write concern setting. Errs on the false positive for non-empty wMode. - */ - bool shouldWaitForOtherNodes() const; - void reset() { syncMode = NONE; wNumNodes = 0; @@ -93,18 +55,11 @@ namespace mongo { wTimeout = 0; } - // Returns the BSON representation of this object. - // Warning: does not return the same object passed on the last parse() call. - BSONObj toBSON() const; - - SyncMode syncMode; + enum SyncMode { NONE, FSYNC, JOURNAL } syncMode; - // The w parameter for this write concern. The wMode represents the string format and - // takes precedence over the numeric format wNumNodes. int wNumNodes; std::string wMode; - // Timeout in milliseconds. int wTimeout; }; |