summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-04-08 16:27:50 -0400
committerBilly Donahue <billy.donahue@mongodb.com>2019-04-09 15:38:40 -0400
commit1041dd848e25e879260d1015d8da4f72ee7993fe (patch)
treef8ddb4ee7c841e4ef790ea7bd53e75c0a09c4cc2 /src/mongo/db/commands
parent8cdc51e7810f7fd8898a4c60b935e389f04659ee (diff)
downloadmongo-1041dd848e25e879260d1015d8da4f72ee7993fe.tar.gz
SERVER-40476 remove mongoutils::str
Rename utils/mongoutils/str.h => utils/str.h Rename namespace mongoutils::str => str Rename mongo::strcasecmp => str::caseInsensitiveCompare.
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r--src/mongo/db/commands/explain_cmd.cpp2
-rw-r--r--src/mongo/db/commands/kill_op.cpp2
-rw-r--r--src/mongo/db/commands/kill_op_cmd_base.cpp2
-rw-r--r--src/mongo/db/commands/mr.cpp2
-rw-r--r--src/mongo/db/commands/mr_common.cpp7
-rw-r--r--src/mongo/db/commands/parameters.cpp19
-rw-r--r--src/mongo/db/commands/plan_cache_commands_test.cpp2
-rw-r--r--src/mongo/db/commands/server_status_internal.cpp4
-rw-r--r--src/mongo/db/commands/user_management_commands.cpp15
-rw-r--r--src/mongo/db/commands/user_management_commands_common.cpp2
10 files changed, 26 insertions, 31 deletions
diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp
index e745945a7fe..6a8c49f3e20 100644
--- a/src/mongo/db/commands/explain_cmd.cpp
+++ b/src/mongo/db/commands/explain_cmd.cpp
@@ -32,7 +32,7 @@
#include "mongo/db/command_can_run_here.h"
#include "mongo/db/commands.h"
#include "mongo/db/query/explain.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace {
diff --git a/src/mongo/db/commands/kill_op.cpp b/src/mongo/db/commands/kill_op.cpp
index ab2fad42af5..5a9b639427e 100644
--- a/src/mongo/db/commands/kill_op.cpp
+++ b/src/mongo/db/commands/kill_op.cpp
@@ -44,7 +44,7 @@
#include "mongo/db/operation_context.h"
#include "mongo/db/service_context.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/db/commands/kill_op_cmd_base.cpp b/src/mongo/db/commands/kill_op_cmd_base.cpp
index f6394998de4..71b23d52424 100644
--- a/src/mongo/db/commands/kill_op_cmd_base.cpp
+++ b/src/mongo/db/commands/kill_op_cmd_base.cpp
@@ -36,7 +36,7 @@
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/client.h"
#include "mongo/db/operation_context.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index 99dacfecbfa..1327d5fe560 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -75,8 +75,8 @@
#include "mongo/scripting/engine.h"
#include "mongo/stdx/mutex.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/scopeguard.h"
+#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/db/commands/mr_common.cpp b/src/mongo/db/commands/mr_common.cpp
index 6e739a8ea2d..252f81379ac 100644
--- a/src/mongo/db/commands/mr_common.cpp
+++ b/src/mongo/db/commands/mr_common.cpp
@@ -38,7 +38,7 @@
#include "mongo/db/catalog/document_validation.h"
#include "mongo/db/commands.h"
#include "mongo/db/jsobj.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
@@ -108,7 +108,7 @@ void addPrivilegesRequiredForMapReduce(const BasicCommand* commandTemplate,
ResourcePattern inputResource(commandTemplate->parseResourcePattern(dbname, cmdObj));
uassert(ErrorCodes::InvalidNamespace,
- mongoutils::str::stream() << "Invalid input resource " << inputResource.toString(),
+ str::stream() << "Invalid input resource " << inputResource.toString(),
inputResource.isExactNamespacePattern());
out->push_back(Privilege(inputResource, ActionType::find));
@@ -128,8 +128,7 @@ void addPrivilegesRequiredForMapReduce(const BasicCommand* commandTemplate,
ResourcePattern outputResource(
ResourcePattern::forExactNamespace(NamespaceString(outputOptions.finalNamespace)));
uassert(ErrorCodes::InvalidNamespace,
- mongoutils::str::stream() << "Invalid target namespace "
- << outputResource.ns().ns(),
+ str::stream() << "Invalid target namespace " << outputResource.ns().ns(),
outputResource.ns().isValid());
// TODO: check if outputNs exists and add createCollection privilege if not
diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp
index 3d765eb8838..b68630938dc 100644
--- a/src/mongo/db/commands/parameters.cpp
+++ b/src/mongo/db/commands/parameters.cpp
@@ -45,7 +45,7 @@
#include "mongo/logger/logger.h"
#include "mongo/logger/parse_log_component_settings.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
using std::string;
using std::stringstream;
@@ -392,8 +392,7 @@ Status LogLevelServerParameter::set(const BSONElement& newValueElement) {
int newValue;
if (!newValueElement.coerce(&newValue) || newValue < 0)
return Status(ErrorCodes::BadValue,
- mongoutils::str::stream() << "Invalid value for logLevel: "
- << newValueElement);
+ str::stream() << "Invalid value for logLevel: " << newValueElement);
LogSeverity newSeverity = (newValue > 0) ? LogSeverity::Debug(newValue) : LogSeverity::Log();
globalLogDomain()->setMinimumLoggedSeverity(newSeverity);
return Status::OK();
@@ -406,7 +405,7 @@ Status LogLevelServerParameter::setFromString(const std::string& strLevel) {
return status;
if (newValue < 0)
return Status(ErrorCodes::BadValue,
- mongoutils::str::stream() << "Invalid value for logLevel: " << newValue);
+ str::stream() << "Invalid value for logLevel: " << newValue);
LogSeverity newSeverity = (newValue > 0) ? LogSeverity::Debug(newValue) : LogSeverity::Log();
globalLogDomain()->setMinimumLoggedSeverity(newSeverity);
return Status::OK();
@@ -423,8 +422,8 @@ void LogComponentVerbosityServerParameter::append(OperationContext*,
Status LogComponentVerbosityServerParameter::set(const BSONElement& newValueElement) {
if (!newValueElement.isABSONObj()) {
return Status(ErrorCodes::TypeMismatch,
- mongoutils::str::stream() << "log component verbosity is not a BSON object: "
- << newValueElement);
+ str::stream() << "log component verbosity is not a BSON object: "
+ << newValueElement);
}
return setLogComponentVerbosity(newValueElement.Obj());
}
@@ -456,10 +455,10 @@ Status AutomationServiceDescriptorServerParameter::setFromString(const std::stri
auto kMaxSize = 64U;
if (str.size() > kMaxSize)
return {ErrorCodes::Overflow,
- mongoutils::str::stream() << "Value for parameter automationServiceDescriptor"
- << " must be no more than "
- << kMaxSize
- << " bytes"};
+ str::stream() << "Value for parameter automationServiceDescriptor"
+ << " must be no more than "
+ << kMaxSize
+ << " bytes"};
{
const stdx::lock_guard<stdx::mutex> lock(autoServiceDescriptorMutex);
diff --git a/src/mongo/db/commands/plan_cache_commands_test.cpp b/src/mongo/db/commands/plan_cache_commands_test.cpp
index c079100491a..08cd42ae9af 100644
--- a/src/mongo/db/commands/plan_cache_commands_test.cpp
+++ b/src/mongo/db/commands/plan_cache_commands_test.cpp
@@ -42,7 +42,7 @@
#include "mongo/db/query/query_test_service_context.h"
#include "mongo/stdx/memory.h"
#include "mongo/unittest/unittest.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
using namespace mongo;
diff --git a/src/mongo/db/commands/server_status_internal.cpp b/src/mongo/db/commands/server_status_internal.cpp
index e85108c9493..738b22e8945 100644
--- a/src/mongo/db/commands/server_status_internal.cpp
+++ b/src/mongo/db/commands/server_status_internal.cpp
@@ -32,7 +32,7 @@
#include <iostream>
#include "mongo/db/commands/server_status_metric.h"
-#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/str.h"
namespace mongo {
@@ -41,8 +41,6 @@ using std::endl;
using std::map;
using std::string;
-using namespace mongoutils;
-
MetricTree* MetricTree::theMetricTree = NULL;
void MetricTree::add(ServerStatusMetric* metric) {
diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp
index 3520097a5c3..ee93eafdf49 100644
--- a/src/mongo/db/commands/user_management_commands.cpp
+++ b/src/mongo/db/commands/user_management_commands.cpp
@@ -73,10 +73,10 @@
#include "mongo/stdx/unordered_set.h"
#include "mongo/util/icu.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/ssl_manager.h"
#include "mongo/util/password_digest.h"
#include "mongo/util/sequence_util.h"
+#include "mongo/util/str.h"
#include "mongo/util/time_support.h"
#include "mongo/util/uuid.h"
@@ -174,8 +174,8 @@ Status checkOkayToGrantRolesToRole(OperationContext* opCtx,
const RoleName& roleToAdd = *it;
if (roleToAdd == role) {
return Status(ErrorCodes::InvalidRoleModification,
- mongoutils::str::stream() << "Cannot grant role " << role.getFullName()
- << " to itself.");
+ str::stream() << "Cannot grant role " << role.getFullName()
+ << " to itself.");
}
if (role.getDB() != "admin" && roleToAdd.getDB() != role.getDB()) {
@@ -202,11 +202,10 @@ Status checkOkayToGrantRolesToRole(OperationContext* opCtx,
}
if (sequenceContains(indirectRoles, role)) {
- return Status(
- ErrorCodes::InvalidRoleModification,
- mongoutils::str::stream() << "Granting " << roleToAdd.getFullName() << " to "
- << role.getFullName()
- << " would introduce a cycle in the role graph.");
+ return Status(ErrorCodes::InvalidRoleModification,
+ str::stream() << "Granting " << roleToAdd.getFullName() << " to "
+ << role.getFullName()
+ << " would introduce a cycle in the role graph.");
}
}
return Status::OK();
diff --git a/src/mongo/db/commands/user_management_commands_common.cpp b/src/mongo/db/commands/user_management_commands_common.cpp
index 27a573926b3..7abc55ab60a 100644
--- a/src/mongo/db/commands/user_management_commands_common.cpp
+++ b/src/mongo/db/commands/user_management_commands_common.cpp
@@ -47,8 +47,8 @@
#include "mongo/db/auth/user_management_commands_parser.h"
#include "mongo/db/jsobj.h"
#include "mongo/util/log.h"
-#include "mongo/util/mongoutils/str.h"
#include "mongo/util/sequence_util.h"
+#include "mongo/util/str.h"
namespace mongo {
namespace auth {