From 6d7fdcb385e481aea784de2eb515f3d27b46675c Mon Sep 17 00:00:00 2001 From: Kaloian Manassiev Date: Tue, 12 May 2015 11:10:51 -0400 Subject: SERVER-18418 Remote command targeter This change introduces a remote command targeter interface to be used as a stub to start implementing the targeting logic. --- src/mongo/db/write_concern_options.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/mongo/db/write_concern_options.cpp') diff --git a/src/mongo/db/write_concern_options.cpp b/src/mongo/db/write_concern_options.cpp index 4b744fedd45..7f1ce2e13ff 100644 --- a/src/mongo/db/write_concern_options.cpp +++ b/src/mongo/db/write_concern_options.cpp @@ -35,15 +35,31 @@ namespace mongo { using std::string; +namespace { + + /** + * Controls how much a client cares about writes and serves as initializer for the pre-defined + * write concern options. + * + * Default is NORMAL. + */ + enum WriteConcern { + W_NONE = 0 , + W_NORMAL = 1 + }; + + const BSONField mongosSecondaryThrottleField("_secondaryThrottle", true); + const BSONField secondaryThrottleField("secondaryThrottle", true); + const BSONField writeConcernField("writeConcern"); + +} // namespace + const BSONObj WriteConcernOptions::Default = BSONObj(); const BSONObj WriteConcernOptions::Acknowledged(BSON("w" << W_NORMAL)); const BSONObj WriteConcernOptions::Unacknowledged(BSON("w" << W_NONE)); const char WriteConcernOptions::kMajority[] = "majority"; - static const BSONField mongosSecondaryThrottleField("_secondaryThrottle", true); - static const BSONField secondaryThrottleField("secondaryThrottle", true); - static const BSONField writeConcernField("writeConcern"); WriteConcernOptions::WriteConcernOptions(int numNodes, SyncMode sync, -- cgit v1.2.1