diff options
Diffstat (limited to 'src/mongo/client')
-rw-r--r-- | src/mongo/client/async_client.cpp | 3 | ||||
-rw-r--r-- | src/mongo/client/connection_string_connect.cpp | 5 | ||||
-rw-r--r-- | src/mongo/client/dbclient_connection.cpp | 2 | ||||
-rw-r--r-- | src/mongo/client/dbclient_cursor.cpp | 3 | ||||
-rw-r--r-- | src/mongo/client/dbclient_rs.cpp | 3 | ||||
-rw-r--r-- | src/mongo/client/fetcher_test.cpp | 24 | ||||
-rw-r--r-- | src/mongo/client/remote_command_retry_scheduler.cpp | 4 | ||||
-rw-r--r-- | src/mongo/client/remote_command_retry_scheduler_test.cpp | 3 | ||||
-rw-r--r-- | src/mongo/client/remote_command_targeter_factory_impl.cpp | 9 | ||||
-rw-r--r-- | src/mongo/client/remote_command_targeter_factory_mock.cpp | 7 | ||||
-rw-r--r-- | src/mongo/client/replica_set_monitor_manager.cpp | 9 | ||||
-rw-r--r-- | src/mongo/client/replica_set_monitor_read_preference_test.cpp | 3 |
12 files changed, 39 insertions, 36 deletions
diff --git a/src/mongo/client/async_client.cpp b/src/mongo/client/async_client.cpp index 7410b1a89d9..d867a629e17 100644 --- a/src/mongo/client/async_client.cpp +++ b/src/mongo/client/async_client.cpp @@ -33,6 +33,8 @@ #include "mongo/client/async_client.h" +#include <memory> + #include "mongo/bson/bsonobjbuilder.h" #include "mongo/client/authenticate.h" #include "mongo/config.h" @@ -45,7 +47,6 @@ #include "mongo/rpc/legacy_request_builder.h" #include "mongo/rpc/metadata/client_metadata.h" #include "mongo/rpc/reply_interface.h" -#include "mongo/stdx/memory.h" #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/net/ssl_manager.h" diff --git a/src/mongo/client/connection_string_connect.cpp b/src/mongo/client/connection_string_connect.cpp index 888d702ab6e..76844368edc 100644 --- a/src/mongo/client/connection_string_connect.cpp +++ b/src/mongo/client/connection_string_connect.cpp @@ -38,7 +38,6 @@ #include "mongo/client/dbclient_rs.h" #include "mongo/client/mongo_uri.h" -#include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" @@ -59,7 +58,7 @@ std::unique_ptr<DBClientBase> ConnectionString::connect(StringData applicationNa switch (_type) { case MASTER: { for (const auto& server : _servers) { - auto c = stdx::make_unique<DBClientConnection>(true, 0, newURI); + auto c = std::make_unique<DBClientConnection>(true, 0, newURI); c->setSoTimeout(socketTimeout); LOG(1) << "creating new connection to:" << server; @@ -73,7 +72,7 @@ std::unique_ptr<DBClientBase> ConnectionString::connect(StringData applicationNa } case SET: { - auto set = stdx::make_unique<DBClientReplicaSet>( + auto set = std::make_unique<DBClientReplicaSet>( _setName, _servers, applicationName, socketTimeout, std::move(newURI)); if (!set->connect()) { errmsg = "connect failed to replica set "; diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp index c812cea4a11..a06f8d9227b 100644 --- a/src/mongo/client/dbclient_connection.cpp +++ b/src/mongo/client/dbclient_connection.cpp @@ -39,6 +39,7 @@ #include <algorithm> #include <functional> +#include <memory> #include <utility> #include "mongo/base/status.h" @@ -64,7 +65,6 @@ #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/rpc/metadata/client_metadata.h" #include "mongo/s/stale_exception.h" -#include "mongo/stdx/memory.h" #include "mongo/stdx/mutex.h" #include "mongo/util/assert_util.h" #include "mongo/util/concurrency/mutex.h" diff --git a/src/mongo/client/dbclient_cursor.cpp b/src/mongo/client/dbclient_cursor.cpp index 737c9c67d77..3e049f786e5 100644 --- a/src/mongo/client/dbclient_cursor.cpp +++ b/src/mongo/client/dbclient_cursor.cpp @@ -37,6 +37,8 @@ #include "mongo/client/dbclient_cursor.h" +#include <memory> + #include "mongo/client/connpool.h" #include "mongo/db/client.h" #include "mongo/db/dbmessage.h" @@ -49,7 +51,6 @@ #include "mongo/rpc/metadata.h" #include "mongo/rpc/object_check.h" #include "mongo/s/stale_exception.h" -#include "mongo/stdx/memory.h" #include "mongo/util/bufreader.h" #include "mongo/util/debug_util.h" #include "mongo/util/destructor_guard.h" diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp index d2c61154fc2..033f39b0bef 100644 --- a/src/mongo/client/dbclient_rs.cpp +++ b/src/mongo/client/dbclient_rs.cpp @@ -45,7 +45,6 @@ #include "mongo/db/auth/sasl_command_constants.h" #include "mongo/db/dbmessage.h" #include "mongo/db/jsobj.h" -#include "mongo/stdx/memory.h" #include "mongo/util/log.h" namespace mongo { @@ -117,7 +116,7 @@ std::unique_ptr<ReadPreferenceSetting> _extractReadPref(const BSONObj& query, in // The readPreference is embedded in the $queryOptions field. readPrefContainingObj = elem.Obj(); } - return stdx::make_unique<ReadPreferenceSetting>(uassertStatusOK( + return std::make_unique<ReadPreferenceSetting>(uassertStatusOK( ReadPreferenceSetting::fromContainingBSON(readPrefContainingObj, defaultReadPref))); } diff --git a/src/mongo/client/fetcher_test.cpp b/src/mongo/client/fetcher_test.cpp index 0f7768d458f..19713755b11 100644 --- a/src/mongo/client/fetcher_test.cpp +++ b/src/mongo/client/fetcher_test.cpp @@ -110,7 +110,7 @@ void FetcherTest::setUp() { executor::ThreadPoolExecutorTest::setUp(); clear(); callbackHook = Fetcher::CallbackFn(); - fetcher = stdx::make_unique<Fetcher>(&getExecutor(), source, "db", findCmdObj, makeCallback()); + fetcher = std::make_unique<Fetcher>(&getExecutor(), source, "db", findCmdObj, makeCallback()); launchExecutorThread(); } @@ -267,7 +267,7 @@ TEST_F(FetcherTest, RemoteCommandRequestShouldContainCommandParametersPassedToCo auto metadataObj = BSON("x" << 1); Milliseconds timeout(8000); - fetcher = stdx::make_unique<Fetcher>( + fetcher = std::make_unique<Fetcher>( &getExecutor(), source, "db", findCmdObj, doNothingCallback, metadataObj, timeout); ASSERT_EQUALS(source, fetcher->getSource()); @@ -1037,15 +1037,15 @@ TEST_F(FetcherTest, FetcherAppliesRetryPolicyToFirstCommandButNotToGetMoreReques executor::RemoteCommandRequest::kNoTimeout, {ErrorCodes::BadValue, ErrorCodes::InternalError}); - fetcher = stdx::make_unique<Fetcher>(&getExecutor(), - source, - "db", - findCmdObj, - makeCallback(), - rpc::makeEmptyMetadata(), - executor::RemoteCommandRequest::kNoTimeout, - executor::RemoteCommandRequest::kNoTimeout, - std::move(policy)); + fetcher = std::make_unique<Fetcher>(&getExecutor(), + source, + "db", + findCmdObj, + makeCallback(), + rpc::makeEmptyMetadata(), + executor::RemoteCommandRequest::kNoTimeout, + executor::RemoteCommandRequest::kNoTimeout, + std::move(policy)); callbackHook = appendGetMoreRequest; @@ -1094,7 +1094,7 @@ TEST_F(FetcherTest, FetcherResetsInternalFinishCallbackFunctionPointerAfterLastC auto sharedCallbackData = std::make_shared<SharedCallbackState>(); auto callbackInvoked = false; - fetcher = stdx::make_unique<Fetcher>( + fetcher = std::make_unique<Fetcher>( &getExecutor(), source, "db", diff --git a/src/mongo/client/remote_command_retry_scheduler.cpp b/src/mongo/client/remote_command_retry_scheduler.cpp index 01e2a43f6b0..347c6043a6a 100644 --- a/src/mongo/client/remote_command_retry_scheduler.cpp +++ b/src/mongo/client/remote_command_retry_scheduler.cpp @@ -32,10 +32,10 @@ #include "mongo/platform/basic.h" #include <algorithm> +#include <memory> #include <vector> #include "mongo/client/remote_command_retry_scheduler.h" -#include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" #include "mongo/util/destructor_guard.h" #include "mongo/util/log.h" @@ -127,7 +127,7 @@ RemoteCommandRetryScheduler::makeRetryPolicy( Milliseconds maxResponseElapsedTotal, const std::initializer_list<ErrorCodes::Error>& retryableErrors) { std::unique_ptr<RetryPolicy> policy = - stdx::make_unique<RetryPolicyImpl>(maxAttempts, maxResponseElapsedTotal, retryableErrors); + std::make_unique<RetryPolicyImpl>(maxAttempts, maxResponseElapsedTotal, retryableErrors); return policy; } diff --git a/src/mongo/client/remote_command_retry_scheduler_test.cpp b/src/mongo/client/remote_command_retry_scheduler_test.cpp index b8536d0fa48..6a543bc76f7 100644 --- a/src/mongo/client/remote_command_retry_scheduler_test.cpp +++ b/src/mongo/client/remote_command_retry_scheduler_test.cpp @@ -39,7 +39,6 @@ #include "mongo/executor/remote_command_response.h" #include "mongo/executor/task_executor.h" #include "mongo/executor/thread_pool_task_executor_test_fixture.h" -#include "mongo/stdx/memory.h" #include "mongo/unittest/task_executor_proxy.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" @@ -498,7 +497,7 @@ public: TEST_F(RemoteCommandRetrySchedulerTest, SchedulerReturnsCallbackCanceledIfShutdownBeforeSendingRetryCommand) { CallbackResponseSaver callback; - auto policy = stdx::make_unique<ShutdownSchedulerRetryPolicy>(); + auto policy = std::make_unique<ShutdownSchedulerRetryPolicy>(); auto policyPtr = policy.get(); TaskExecutorWithFailureInScheduleRemoteCommand badExecutor(&getExecutor()); RemoteCommandRetryScheduler scheduler( diff --git a/src/mongo/client/remote_command_targeter_factory_impl.cpp b/src/mongo/client/remote_command_targeter_factory_impl.cpp index c77a0f9f919..a0a1df7b6a7 100644 --- a/src/mongo/client/remote_command_targeter_factory_impl.cpp +++ b/src/mongo/client/remote_command_targeter_factory_impl.cpp @@ -31,11 +31,12 @@ #include "mongo/client/remote_command_targeter_factory_impl.h" +#include <memory> + #include "mongo/base/status_with.h" #include "mongo/client/connection_string.h" #include "mongo/client/remote_command_targeter_rs.h" #include "mongo/client/remote_command_targeter_standalone.h" -#include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" namespace mongo { @@ -50,10 +51,10 @@ std::unique_ptr<RemoteCommandTargeter> RemoteCommandTargeterFactoryImpl::create( case ConnectionString::MASTER: case ConnectionString::CUSTOM: invariant(connStr.getServers().size() == 1); - return stdx::make_unique<RemoteCommandTargeterStandalone>(connStr.getServers().front()); + return std::make_unique<RemoteCommandTargeterStandalone>(connStr.getServers().front()); case ConnectionString::SET: - return stdx::make_unique<RemoteCommandTargeterRS>(connStr.getSetName(), - connStr.getServers()); + return std::make_unique<RemoteCommandTargeterRS>(connStr.getSetName(), + connStr.getServers()); // These connections should never be seen case ConnectionString::INVALID: case ConnectionString::LOCAL: diff --git a/src/mongo/client/remote_command_targeter_factory_mock.cpp b/src/mongo/client/remote_command_targeter_factory_mock.cpp index 8c50ccd3dd8..41c2a6801b1 100644 --- a/src/mongo/client/remote_command_targeter_factory_mock.cpp +++ b/src/mongo/client/remote_command_targeter_factory_mock.cpp @@ -31,10 +31,11 @@ #include "mongo/client/remote_command_targeter_factory_mock.h" +#include <memory> + #include "mongo/base/status_with.h" #include "mongo/client/connection_string.h" #include "mongo/client/remote_command_targeter_mock.h" -#include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" namespace mongo { @@ -85,10 +86,10 @@ std::unique_ptr<RemoteCommandTargeter> RemoteCommandTargeterFactoryMock::create( const ConnectionString& connStr) { auto it = _mockTargeters.find(connStr); if (it != _mockTargeters.end()) { - return stdx::make_unique<TargeterProxy>(it->second); + return std::make_unique<TargeterProxy>(it->second); } - return stdx::make_unique<RemoteCommandTargeterMock>(); + return std::make_unique<RemoteCommandTargeterMock>(); } void RemoteCommandTargeterFactoryMock::addTargeterToReturn( diff --git a/src/mongo/client/replica_set_monitor_manager.cpp b/src/mongo/client/replica_set_monitor_manager.cpp index dff3d8a16c4..2d28b77e8a0 100644 --- a/src/mongo/client/replica_set_monitor_manager.cpp +++ b/src/mongo/client/replica_set_monitor_manager.cpp @@ -33,6 +33,8 @@ #include "mongo/client/replica_set_monitor_manager.h" +#include <memory> + #include "mongo/bson/bsonobjbuilder.h" #include "mongo/client/connection_string.h" #include "mongo/client/mongo_uri.h" @@ -44,7 +46,6 @@ #include "mongo/executor/task_executor_pool.h" #include "mongo/executor/thread_pool_task_executor.h" #include "mongo/rpc/metadata/egress_metadata_hook_list.h" -#include "mongo/stdx/memory.h" #include "mongo/stdx/mutex.h" #include "mongo/util/log.h" #include "mongo/util/map_util.h" @@ -79,7 +80,7 @@ shared_ptr<ReplicaSetMonitor> ReplicaSetMonitorManager::getMonitor(StringData se } void ReplicaSetMonitorManager::_setupTaskExecutorInLock(const std::string& name) { - auto hookList = stdx::make_unique<rpc::EgressMetadataHookList>(); + auto hookList = std::make_unique<rpc::EgressMetadataHookList>(); // do not restart taskExecutor if is in shutdown if (!_taskExecutor && !_isShutdown) { @@ -87,8 +88,8 @@ void ReplicaSetMonitorManager::_setupTaskExecutorInLock(const std::string& name) auto net = executor::makeNetworkInterface( "ReplicaSetMonitor-TaskExecutor", nullptr, std::move(hookList)); auto netPtr = net.get(); - _taskExecutor = stdx::make_unique<ThreadPoolTaskExecutor>( - stdx::make_unique<NetworkInterfaceThreadPool>(netPtr), std::move(net)); + _taskExecutor = std::make_unique<ThreadPoolTaskExecutor>( + std::make_unique<NetworkInterfaceThreadPool>(netPtr), std::move(net)); LOG(1) << "Starting up task executor for monitoring replica sets in response to request to " "monitor set: " << redact(name); diff --git a/src/mongo/client/replica_set_monitor_read_preference_test.cpp b/src/mongo/client/replica_set_monitor_read_preference_test.cpp index 3757c62dd61..3f738d6cd41 100644 --- a/src/mongo/client/replica_set_monitor_read_preference_test.cpp +++ b/src/mongo/client/replica_set_monitor_read_preference_test.cpp @@ -31,9 +31,10 @@ #include "mongo/client/replica_set_monitor_test_fixture.h" +#include <memory> + #include "mongo/client/mongo_uri.h" #include "mongo/client/read_preference.h" -#include "mongo/stdx/memory.h" namespace mongo { namespace { |