summaryrefslogtreecommitdiff
path: root/src/mongo/client/read_preference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client/read_preference.cpp')
-rw-r--r--src/mongo/client/read_preference.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/mongo/client/read_preference.cpp b/src/mongo/client/read_preference.cpp
index 4391db7c388..b71825ad395 100644
--- a/src/mongo/client/read_preference.cpp
+++ b/src/mongo/client/read_preference.cpp
@@ -86,16 +86,9 @@ StatusWith<ReadPreference> parseReadPreferenceMode(StringData prefStr) {
}
return Status(ErrorCodes::FailedToParse,
str::stream() << "Could not parse $readPreference mode '" << prefStr
- << "'. Only the modes '"
- << kPrimaryOnly
- << "', '"
- << kPrimaryPreferred
- << "', '"
- << kSecondaryOnly
- << "', '"
- << kSecondaryPreferred
- << "', and '"
- << kNearest
+ << "'. Only the modes '" << kPrimaryOnly << "', '"
+ << kPrimaryPreferred << "', '" << kSecondaryOnly << "', '"
+ << kSecondaryPreferred << "', and '" << kNearest
<< "' are supported.");
}
@@ -206,8 +199,8 @@ StatusWith<ReadPreferenceSetting> ReadPreferenceSetting::fromInnerBSON(const BSO
if (maxStalenessSecondsValue && maxStalenessSecondsValue < 0) {
return Status(ErrorCodes::BadValue,
- str::stream() << kMaxStalenessSecondsFieldName
- << " must be a non-negative integer");
+ str::stream()
+ << kMaxStalenessSecondsFieldName << " must be a non-negative integer");
}
if (maxStalenessSecondsValue && maxStalenessSecondsValue >= Seconds::max().count()) {
@@ -218,9 +211,9 @@ StatusWith<ReadPreferenceSetting> ReadPreferenceSetting::fromInnerBSON(const BSO
if (maxStalenessSecondsValue && maxStalenessSecondsValue < kMinimalMaxStalenessValue.count()) {
return Status(ErrorCodes::MaxStalenessOutOfRange,
- str::stream() << kMaxStalenessSecondsFieldName
- << " value can not be less than "
- << kMinimalMaxStalenessValue.count());
+ str::stream()
+ << kMaxStalenessSecondsFieldName << " value can not be less than "
+ << kMinimalMaxStalenessValue.count());
}
if ((mode == ReadPreference::PrimaryOnly) && maxStalenessSecondsValue) {
@@ -236,9 +229,7 @@ StatusWith<ReadPreferenceSetting> ReadPreferenceSetting::fromInnerBSON(const BSO
if (elem.type() != mongo::Object) {
return Status(ErrorCodes::TypeMismatch,
str::stream() << "$readPreference has incorrect type: expected "
- << mongo::Object
- << " but got "
- << elem.type());
+ << mongo::Object << " but got " << elem.type());
}
return fromInnerBSON(elem.Obj());
}