summaryrefslogtreecommitdiff
path: root/src/mongo/db/s
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r--src/mongo/db/s/active_migrations_registry.h2
-rw-r--r--src/mongo/db/s/active_shard_collection_registry.h2
-rw-r--r--src/mongo/db/s/balancer/balancer.cpp8
-rw-r--r--src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp2
-rw-r--r--src/mongo/db/s/balancer/migration_manager_test.cpp5
-rw-r--r--src/mongo/db/s/collection_metadata.cpp3
-rw-r--r--src/mongo/db/s/collection_metadata_test.cpp5
-rw-r--r--src/mongo/db/s/collection_range_deleter_test.cpp2
-rw-r--r--src/mongo/db/s/collection_sharding_state_factory_shard.cpp6
-rw-r--r--src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp40
-rw-r--r--src/mongo/db/s/config/sharding_catalog_manager_shard_collection_test.cpp22
-rw-r--r--src/mongo/db/s/metadata_manager.cpp3
-rw-r--r--src/mongo/db/s/metadata_manager.h2
-rw-r--r--src/mongo/db/s/metadata_manager_test.cpp2
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp2
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy.h2
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp4
-rw-r--r--src/mongo/db/s/migration_destination_manager.cpp2
-rw-r--r--src/mongo/db/s/migration_source_manager.cpp5
-rw-r--r--src/mongo/db/s/namespace_metadata_change_notifications_test.cpp5
-rw-r--r--src/mongo/db/s/session_catalog_migration_destination_test.cpp7
-rw-r--r--src/mongo/db/s/session_catalog_migration_source.cpp7
-rw-r--r--src/mongo/db/s/shard_metadata_util.cpp3
-rw-r--r--src/mongo/db/s/shard_server_catalog_cache_loader.cpp3
-rw-r--r--src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp5
-rw-r--r--src/mongo/db/s/sharding_initialization_mongod.cpp41
-rw-r--r--src/mongo/db/s/sharding_initialization_mongod_test.cpp20
-rw-r--r--src/mongo/db/s/transaction_coordinator.cpp2
-rw-r--r--src/mongo/db/s/transaction_coordinator_futures_util.cpp2
-rw-r--r--src/mongo/db/s/transaction_coordinator_futures_util_test.cpp2
-rw-r--r--src/mongo/db/s/transaction_coordinator_test.cpp4
-rw-r--r--src/mongo/db/s/transaction_coordinator_test_fixture.cpp2
32 files changed, 114 insertions, 108 deletions
diff --git a/src/mongo/db/s/active_migrations_registry.h b/src/mongo/db/s/active_migrations_registry.h
index d2e3f4b2ad0..2f5dc3b56ae 100644
--- a/src/mongo/db/s/active_migrations_registry.h
+++ b/src/mongo/db/s/active_migrations_registry.h
@@ -30,10 +30,10 @@
#pragma once
#include <boost/optional.hpp>
+#include <memory>
#include "mongo/db/s/migration_session_id.h"
#include "mongo/s/request_types/move_chunk_request.h"
-#include "mongo/stdx/memory.h"
#include "mongo/stdx/mutex.h"
#include "mongo/util/concurrency/notification.h"
diff --git a/src/mongo/db/s/active_shard_collection_registry.h b/src/mongo/db/s/active_shard_collection_registry.h
index cab710b5ee5..06f7f69d906 100644
--- a/src/mongo/db/s/active_shard_collection_registry.h
+++ b/src/mongo/db/s/active_shard_collection_registry.h
@@ -30,9 +30,9 @@
#pragma once
#include <boost/optional.hpp>
+#include <memory>
#include "mongo/s/request_types/shard_collection_gen.h"
-#include "mongo/stdx/memory.h"
#include "mongo/stdx/mutex.h"
#include "mongo/util/concurrency/notification.h"
diff --git a/src/mongo/db/s/balancer/balancer.cpp b/src/mongo/db/s/balancer/balancer.cpp
index 43f924132aa..b8e0a57f5b8 100644
--- a/src/mongo/db/s/balancer/balancer.cpp
+++ b/src/mongo/db/s/balancer/balancer.cpp
@@ -34,6 +34,7 @@
#include "mongo/db/s/balancer/balancer.h"
#include <algorithm>
+#include <memory>
#include <string>
#include "mongo/base/status_with.h"
@@ -51,7 +52,6 @@
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/grid.h"
#include "mongo/s/shard_util.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/concurrency/idle_thread_block.h"
#include "mongo/util/exit.h"
#include "mongo/util/log.h"
@@ -154,9 +154,9 @@ void warnOnMultiVersion(const vector<ClusterStatistics::ShardStatistics>& cluste
Balancer::Balancer(ServiceContext* serviceContext)
: _balancedLastTime(0),
_random(std::random_device{}()),
- _clusterStats(stdx::make_unique<ClusterStatisticsImpl>(_random)),
+ _clusterStats(std::make_unique<ClusterStatisticsImpl>(_random)),
_chunkSelectionPolicy(
- stdx::make_unique<BalancerChunkSelectionPolicyImpl>(_clusterStats.get(), _random)),
+ std::make_unique<BalancerChunkSelectionPolicyImpl>(_clusterStats.get(), _random)),
_migrationManager(serviceContext) {}
Balancer::~Balancer() {
@@ -167,7 +167,7 @@ Balancer::~Balancer() {
void Balancer::create(ServiceContext* serviceContext) {
invariant(!getBalancer(serviceContext));
- getBalancer(serviceContext) = stdx::make_unique<Balancer>(serviceContext);
+ getBalancer(serviceContext) = std::make_unique<Balancer>(serviceContext);
}
Balancer* Balancer::get(ServiceContext* serviceContext) {
diff --git a/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp b/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp
index 3162ca40daf..e6d358e982b 100644
--- a/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp
+++ b/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp
@@ -34,6 +34,7 @@
#include "mongo/db/s/balancer/balancer_chunk_selection_policy_impl.h"
#include <algorithm>
+#include <memory>
#include <vector>
#include "mongo/base/status_with.h"
@@ -43,7 +44,6 @@
#include "mongo/s/catalog/type_tags.h"
#include "mongo/s/catalog_cache.h"
#include "mongo/s/grid.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/log.h"
#include "mongo/util/str.h"
diff --git a/src/mongo/db/s/balancer/migration_manager_test.cpp b/src/mongo/db/s/balancer/migration_manager_test.cpp
index ec2bdc8b12d..3e25160c065 100644
--- a/src/mongo/db/s/balancer/migration_manager_test.cpp
+++ b/src/mongo/db/s/balancer/migration_manager_test.cpp
@@ -29,6 +29,8 @@
#include "mongo/platform/basic.h"
+#include <memory>
+
#include "mongo/client/remote_command_targeter_mock.h"
#include "mongo/db/commands.h"
#include "mongo/db/s/balancer/migration_manager.h"
@@ -42,7 +44,6 @@
#include "mongo/s/config_server_test_fixture.h"
#include "mongo/s/database_version_helpers.h"
#include "mongo/s/request_types/move_chunk_request.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/scopeguard.h"
namespace mongo {
@@ -160,7 +161,7 @@ private:
void MigrationManagerTest::setUp() {
ConfigServerTestFixture::setUp();
- _migrationManager = stdx::make_unique<MigrationManager>(getServiceContext());
+ _migrationManager = std::make_unique<MigrationManager>(getServiceContext());
_migrationManager->startRecoveryAndAcquireDistLocks(operationContext());
_migrationManager->finishRecovery(operationContext(), 0, kDefaultSecondaryThrottle);
}
diff --git a/src/mongo/db/s/collection_metadata.cpp b/src/mongo/db/s/collection_metadata.cpp
index 112499944af..bb9063b8395 100644
--- a/src/mongo/db/s/collection_metadata.cpp
+++ b/src/mongo/db/s/collection_metadata.cpp
@@ -33,11 +33,12 @@
#include "mongo/db/s/collection_metadata.h"
+#include <memory>
+
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/bson/util/builder.h"
#include "mongo/db/bson/dotted_path_support.h"
#include "mongo/s/catalog/type_chunk.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/log.h"
#include "mongo/util/str.h"
diff --git a/src/mongo/db/s/collection_metadata_test.cpp b/src/mongo/db/s/collection_metadata_test.cpp
index 33f81707841..ac36558a234 100644
--- a/src/mongo/db/s/collection_metadata_test.cpp
+++ b/src/mongo/db/s/collection_metadata_test.cpp
@@ -29,12 +29,13 @@
#include "mongo/platform/basic.h"
+#include <memory>
+
#include "mongo/base/status.h"
#include "mongo/db/range_arithmetic.h"
#include "mongo/db/s/collection_metadata.h"
#include "mongo/s/catalog/type_chunk.h"
#include "mongo/s/chunk_version.h"
-#include "mongo/stdx/memory.h"
#include "mongo/unittest/unittest.h"
namespace mongo {
@@ -82,7 +83,7 @@ std::unique_ptr<CollectionMetadata> makeCollectionMetadataImpl(
auto rt =
RoutingTableHistory::makeNew(kNss, uuid, shardKeyPattern, nullptr, false, epoch, allChunks);
std::shared_ptr<ChunkManager> cm = std::make_shared<ChunkManager>(rt, kChunkManager);
- return stdx::make_unique<CollectionMetadata>(cm, kThisShard);
+ return std::make_unique<CollectionMetadata>(cm, kThisShard);
}
struct ConstructedRangeMap : public RangeMap {
diff --git a/src/mongo/db/s/collection_range_deleter_test.cpp b/src/mongo/db/s/collection_range_deleter_test.cpp
index 0ca096c8307..320b6b3796b 100644
--- a/src/mongo/db/s/collection_range_deleter_test.cpp
+++ b/src/mongo/db/s/collection_range_deleter_test.cpp
@@ -113,7 +113,7 @@ protected:
}
std::unique_ptr<BalancerConfiguration> makeBalancerConfiguration() override {
- return stdx::make_unique<BalancerConfiguration>();
+ return std::make_unique<BalancerConfiguration>();
}
private:
diff --git a/src/mongo/db/s/collection_sharding_state_factory_shard.cpp b/src/mongo/db/s/collection_sharding_state_factory_shard.cpp
index a7f0f5f8dc5..49a4f118ce5 100644
--- a/src/mongo/db/s/collection_sharding_state_factory_shard.cpp
+++ b/src/mongo/db/s/collection_sharding_state_factory_shard.cpp
@@ -63,9 +63,9 @@ private:
const std::string kExecName("CollectionRangeDeleter-TaskExecutor");
auto net = executor::makeNetworkInterface(kExecName);
- auto pool = stdx::make_unique<executor::NetworkInterfaceThreadPool>(net.get());
- auto taskExecutor = stdx::make_unique<executor::ThreadPoolTaskExecutor>(std::move(pool),
- std::move(net));
+ auto pool = std::make_unique<executor::NetworkInterfaceThreadPool>(net.get());
+ auto taskExecutor =
+ std::make_unique<executor::ThreadPoolTaskExecutor>(std::move(pool), std::move(net));
taskExecutor->startup();
_taskExecutor = std::move(taskExecutor);
diff --git a/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp b/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp
index 23a107a43b5..2afb325d565 100644
--- a/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp
+++ b/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp
@@ -383,7 +383,7 @@ TEST_F(AddShardTest, CreateShardIdentityUpsertForAddShard) {
TEST_F(AddShardTest, StandaloneBasicSuccess) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
HostAndPort shardTarget("StandaloneHost:12345");
targeter->setConnectionStringReturnValue(ConnectionString(shardTarget));
targeter->setFindHostReturnValue(shardTarget);
@@ -456,7 +456,7 @@ TEST_F(AddShardTest, StandaloneBasicSuccess) {
TEST_F(AddShardTest, StandaloneGenerateName) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
HostAndPort shardTarget("StandaloneHost:12345");
targeter->setConnectionStringReturnValue(ConnectionString(shardTarget));
targeter->setFindHostReturnValue(shardTarget);
@@ -537,7 +537,7 @@ TEST_F(AddShardTest, StandaloneGenerateName) {
TEST_F(AddShardTest, AddSCCCConnectionStringAsShard) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
auto invalidConn =
ConnectionString("host1:12345,host2:12345,host3:12345", ConnectionString::INVALID);
targeter->setConnectionStringReturnValue(invalidConn);
@@ -555,7 +555,7 @@ TEST_F(AddShardTest, AddSCCCConnectionStringAsShard) {
TEST_F(AddShardTest, EmptyShardName) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
std::string expectedShardName = "";
auto future = launchAsync([this, expectedShardName] {
@@ -574,7 +574,7 @@ TEST_F(AddShardTest, EmptyShardName) {
// Host is unreachable, cannot verify host.
TEST_F(AddShardTest, UnreachableHost) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
HostAndPort shardTarget("StandaloneHost:12345");
targeter->setConnectionStringReturnValue(ConnectionString(shardTarget));
targeter->setFindHostReturnValue(shardTarget);
@@ -601,7 +601,7 @@ TEST_F(AddShardTest, UnreachableHost) {
// Cannot add mongos as a shard.
TEST_F(AddShardTest, AddMongosAsShard) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
HostAndPort shardTarget("StandaloneHost:12345");
targeter->setConnectionStringReturnValue(ConnectionString(shardTarget));
targeter->setFindHostReturnValue(shardTarget);
@@ -628,7 +628,7 @@ TEST_F(AddShardTest, AddMongosAsShard) {
// A replica set name was found for the host but no name was provided with the host.
TEST_F(AddShardTest, AddReplicaSetShardAsStandalone) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
HostAndPort shardTarget = HostAndPort("host1:12345");
targeter->setConnectionStringReturnValue(ConnectionString(shardTarget));
targeter->setFindHostReturnValue(shardTarget);
@@ -658,7 +658,7 @@ TEST_F(AddShardTest, AddReplicaSetShardAsStandalone) {
// A replica set name was provided with the host but no name was found for the host.
TEST_F(AddShardTest, AddStandaloneHostShardAsReplicaSet) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
ConnectionString connString =
assertGet(ConnectionString::parse("mySet/host1:12345,host2:12345"));
HostAndPort shardTarget = connString.getServers().front();
@@ -686,7 +686,7 @@ TEST_F(AddShardTest, AddStandaloneHostShardAsReplicaSet) {
// Provided replica set name does not match found replica set name.
TEST_F(AddShardTest, ReplicaSetMistmatchedReplicaSetName) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
ConnectionString connString =
assertGet(ConnectionString::parse("mySet/host1:12345,host2:12345"));
targeter->setConnectionStringReturnValue(connString);
@@ -716,7 +716,7 @@ TEST_F(AddShardTest, ReplicaSetMistmatchedReplicaSetName) {
// Cannot add config server as a shard.
TEST_F(AddShardTest, ShardIsCSRSConfigServer) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
ConnectionString connString =
assertGet(ConnectionString::parse("config/host1:12345,host2:12345"));
targeter->setConnectionStringReturnValue(connString);
@@ -749,7 +749,7 @@ TEST_F(AddShardTest, ShardIsCSRSConfigServer) {
// One of the hosts is not part of the found replica set.
TEST_F(AddShardTest, ReplicaSetMissingHostsProvidedInSeedList) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
ConnectionString connString =
assertGet(ConnectionString::parse("mySet/host1:12345,host2:12345"));
targeter->setConnectionStringReturnValue(connString);
@@ -784,7 +784,7 @@ TEST_F(AddShardTest, ReplicaSetMissingHostsProvidedInSeedList) {
// Cannot add a shard with the shard name "config".
TEST_F(AddShardTest, AddShardWithNameConfigFails) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
ConnectionString connString =
assertGet(ConnectionString::parse("mySet/host1:12345,host2:12345"));
targeter->setConnectionStringReturnValue(connString);
@@ -819,7 +819,7 @@ TEST_F(AddShardTest, AddShardWithNameConfigFails) {
TEST_F(AddShardTest, ShardContainsExistingDatabase) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
ConnectionString connString =
assertGet(ConnectionString::parse("mySet/host1:12345,host2:12345"));
targeter->setConnectionStringReturnValue(connString);
@@ -868,7 +868,7 @@ TEST_F(AddShardTest, ShardContainsExistingDatabase) {
TEST_F(AddShardTest, SuccessfullyAddReplicaSet) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
ConnectionString connString =
assertGet(ConnectionString::parse("mySet/host1:12345,host2:12345"));
targeter->setConnectionStringReturnValue(connString);
@@ -932,7 +932,7 @@ TEST_F(AddShardTest, SuccessfullyAddReplicaSet) {
TEST_F(AddShardTest, ReplicaSetExtraHostsDiscovered) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
ConnectionString seedString =
assertGet(ConnectionString::parse("mySet/host1:12345,host2:12345"));
ConnectionString fullConnString =
@@ -1001,7 +1001,7 @@ TEST_F(AddShardTest, ReplicaSetExtraHostsDiscovered) {
TEST_F(AddShardTest, AddShardSucceedsEvenIfAddingDBsFromNewShardFails) {
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
HostAndPort shardTarget("StandaloneHost:12345");
targeter->setConnectionStringReturnValue(ConnectionString(shardTarget));
targeter->setFindHostReturnValue(shardTarget);
@@ -1092,14 +1092,14 @@ TEST_F(AddShardTest, AddShardSucceedsEvenIfAddingDBsFromNewShardFails) {
TEST_F(AddShardTest, AddExistingShardStandalone) {
HostAndPort shardTarget("StandaloneHost:12345");
std::unique_ptr<RemoteCommandTargeterMock> standaloneTargeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
standaloneTargeter->setConnectionStringReturnValue(ConnectionString(shardTarget));
standaloneTargeter->setFindHostReturnValue(shardTarget);
targeterFactory()->addTargeterToReturn(ConnectionString(shardTarget),
std::move(standaloneTargeter));
std::unique_ptr<RemoteCommandTargeterMock> replsetTargeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
replsetTargeter->setConnectionStringReturnValue(
ConnectionString::forReplicaSet("mySet", {shardTarget}));
replsetTargeter->setFindHostReturnValue(shardTarget);
@@ -1203,7 +1203,7 @@ TEST_F(AddShardTest, AddExistingShardStandalone) {
// with the *same* options succeeds.
TEST_F(AddShardTest, AddExistingShardReplicaSet) {
std::unique_ptr<RemoteCommandTargeterMock> replsetTargeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
ConnectionString connString = assertGet(ConnectionString::parse("mySet/host1:12345"));
replsetTargeter->setConnectionStringReturnValue(connString);
HostAndPort shardTarget = connString.getServers().front();
@@ -1324,7 +1324,7 @@ TEST_F(AddShardTest, AddExistingShardReplicaSet) {
{
// Add a targeter for the different seed string this addShard request will use.
std::unique_ptr<RemoteCommandTargeterMock> otherHostTargeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
otherHostTargeter->setConnectionStringReturnValue(otherHostConnString);
otherHostTargeter->setFindHostReturnValue(otherHost);
targeterFactory()->addTargeterToReturn(otherHostConnString, std::move(otherHostTargeter));
diff --git a/src/mongo/db/s/config/sharding_catalog_manager_shard_collection_test.cpp b/src/mongo/db/s/config/sharding_catalog_manager_shard_collection_test.cpp
index 264a4f4cc42..18419863c2f 100644
--- a/src/mongo/db/s/config/sharding_catalog_manager_shard_collection_test.cpp
+++ b/src/mongo/db/s/config/sharding_catalog_manager_shard_collection_test.cpp
@@ -173,7 +173,7 @@ TEST_F(ConfigServerShardCollectionTest, RangeSharding_ForMapReduce_NoInitialSpli
shard.setHost(shardHost.toString());
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
targeter->setConnectionStringReturnValue(ConnectionString(shardHost));
targeter->setFindHostReturnValue(shardHost);
targeterFactory()->addTargeterToReturn(ConnectionString(shardHost), std::move(targeter));
@@ -231,11 +231,11 @@ TEST_F(ConfigServerShardCollectionTest, RangeSharding_ForMapReduce_WithInitialSp
shard2.setHost(shard2Host.toString());
std::unique_ptr<RemoteCommandTargeterMock> targeter0(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
std::unique_ptr<RemoteCommandTargeterMock> targeter1(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
std::unique_ptr<RemoteCommandTargeterMock> targeter2(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
targeter0->setConnectionStringReturnValue(ConnectionString(shard0Host));
targeter0->setFindHostReturnValue(shard0Host);
targeterFactory()->addTargeterToReturn(ConnectionString(shard0Host), std::move(targeter0));
@@ -308,7 +308,7 @@ TEST_F(ConfigServerShardCollectionTest, RangeSharding_NoInitialSplitPoints_NoSpl
shard.setHost(shardHost.toString());
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
targeter->setConnectionStringReturnValue(ConnectionString(shardHost));
targeter->setFindHostReturnValue(shardHost);
targeterFactory()->addTargeterToReturn(ConnectionString(shardHost), std::move(targeter));
@@ -358,7 +358,7 @@ TEST_F(ConfigServerShardCollectionTest, RangeSharding_NoInitialSplitPoints_WithS
shard.setHost(shardHost.toString());
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
targeter->setConnectionStringReturnValue(ConnectionString(shardHost));
targeter->setFindHostReturnValue(shardHost);
targeterFactory()->addTargeterToReturn(ConnectionString(shardHost), std::move(targeter));
@@ -430,7 +430,7 @@ TEST_F(ConfigServerShardCollectionTest, RangeSharding_WithInitialSplitPoints_NoS
shard.setHost(shardHost.toString());
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
targeter->setConnectionStringReturnValue(ConnectionString(shardHost));
targeter->setFindHostReturnValue(shardHost);
targeterFactory()->addTargeterToReturn(ConnectionString(shardHost), std::move(targeter));
@@ -538,7 +538,7 @@ TEST_F(CreateFirstChunksTest, NonEmptyCollection_SplitPoints_FromSplitVector_Man
const auto connStr = assertGet(ConnectionString::parse(kShards[1].getHost()));
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
targeter->setConnectionStringReturnValue(connStr);
targeter->setFindHostReturnValue(connStr.getServers()[0]);
targeterFactory()->addTargeterToReturn(connStr, std::move(targeter));
@@ -576,7 +576,7 @@ TEST_F(CreateFirstChunksTest, NonEmptyCollection_SplitPoints_FromClient_ManyChun
const auto connStr = assertGet(ConnectionString::parse(kShards[1].getHost()));
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
targeter->setConnectionStringReturnValue(connStr);
targeter->setFindHostReturnValue(connStr.getServers()[0]);
targeterFactory()->addTargeterToReturn(connStr, std::move(targeter));
@@ -652,7 +652,7 @@ TEST_F(CreateFirstChunksTest, EmptyCollection_SplitPoints_FromClient_ManyChunksD
const auto connStr = assertGet(ConnectionString::parse(kShards[1].getHost()));
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
targeter->setConnectionStringReturnValue(connStr);
targeter->setFindHostReturnValue(connStr.getServers()[0]);
targeterFactory()->addTargeterToReturn(connStr, std::move(targeter));
@@ -697,7 +697,7 @@ TEST_F(CreateFirstChunksTest, EmptyCollection_NoSplitPoints_OneChunkToPrimary) {
const auto connStr = assertGet(ConnectionString::parse(kShards[1].getHost()));
std::unique_ptr<RemoteCommandTargeterMock> targeter(
- stdx::make_unique<RemoteCommandTargeterMock>());
+ std::make_unique<RemoteCommandTargeterMock>());
targeter->setConnectionStringReturnValue(connStr);
targeter->setFindHostReturnValue(connStr.getServers()[0]);
targeterFactory()->addTargeterToReturn(connStr, std::move(targeter));
diff --git a/src/mongo/db/s/metadata_manager.cpp b/src/mongo/db/s/metadata_manager.cpp
index b111875db39..7394d7dae15 100644
--- a/src/mongo/db/s/metadata_manager.cpp
+++ b/src/mongo/db/s/metadata_manager.cpp
@@ -33,6 +33,8 @@
#include "mongo/db/s/metadata_manager.h"
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/bson/util/builder.h"
@@ -40,7 +42,6 @@
#include "mongo/db/range_arithmetic.h"
#include "mongo/db/s/collection_sharding_state.h"
#include "mongo/s/grid.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/fail_point_service.h"
#include "mongo/util/log.h"
diff --git a/src/mongo/db/s/metadata_manager.h b/src/mongo/db/s/metadata_manager.h
index 26cb452ac28..0eb43d529c2 100644
--- a/src/mongo/db/s/metadata_manager.h
+++ b/src/mongo/db/s/metadata_manager.h
@@ -30,6 +30,7 @@
#pragma once
#include <list>
+#include <memory>
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/db/logical_time.h"
@@ -40,7 +41,6 @@
#include "mongo/db/service_context.h"
#include "mongo/executor/task_executor.h"
#include "mongo/s/catalog/type_chunk.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/concurrency/notification.h"
#include "mongo/util/concurrency/with_lock.h"
diff --git a/src/mongo/db/s/metadata_manager_test.cpp b/src/mongo/db/s/metadata_manager_test.cpp
index db701ec0a60..99c6ca25c5f 100644
--- a/src/mongo/db/s/metadata_manager_test.cpp
+++ b/src/mongo/db/s/metadata_manager_test.cpp
@@ -30,6 +30,7 @@
#include "mongo/platform/basic.h"
#include <boost/optional.hpp>
+#include <memory>
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/catalog_raii.h"
@@ -45,7 +46,6 @@
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/shard_server_test_fixture.h"
#include "mongo/stdx/condition_variable.h"
-#include "mongo/stdx/memory.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/assert_util.h"
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
index bcb5cd266e6..a78553c804e 100644
--- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
+++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
@@ -173,7 +173,7 @@ Status MigrationChunkClonerSourceLegacy::startClone(OperationContext* opCtx) {
auto const replCoord = repl::ReplicationCoordinator::get(opCtx);
if (replCoord->getReplicationMode() == repl::ReplicationCoordinator::modeReplSet) {
- _sessionCatalogSource = stdx::make_unique<SessionCatalogMigrationSource>(
+ _sessionCatalogSource = std::make_unique<SessionCatalogMigrationSource>(
opCtx,
_args.getNss(),
ChunkRange(_args.getMinKey(), _args.getMaxKey()),
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.h b/src/mongo/db/s/migration_chunk_cloner_source_legacy.h
index 4bea1703306..c737716b93f 100644
--- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.h
+++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.h
@@ -30,6 +30,7 @@
#pragma once
#include <list>
+#include <memory>
#include <set>
#include "mongo/bson/bsonobj.h"
@@ -42,7 +43,6 @@
#include "mongo/s/request_types/move_chunk_request.h"
#include "mongo/s/shard_key_pattern.h"
#include "mongo/stdx/condition_variable.h"
-#include "mongo/stdx/memory.h"
#include "mongo/stdx/mutex.h"
#include "mongo/util/net/hostandport.h"
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp
index 3e4f509d6a8..678557c5a1e 100644
--- a/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp
+++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp
@@ -94,7 +94,7 @@ protected:
->setFindHostReturnValue(kRecipientConnStr.getServers()[0]);
}
- auto clockSource = stdx::make_unique<ClockSourceMock>();
+ auto clockSource = std::make_unique<ClockSourceMock>();
// Timestamps of "0 seconds" are not allowed, so we must advance our clock mock to the first
// real second.
@@ -188,7 +188,7 @@ private:
}
};
- return stdx::make_unique<StaticCatalogClient>();
+ return std::make_unique<StaticCatalogClient>();
}
boost::optional<DBDirectClient> _client;
diff --git a/src/mongo/db/s/migration_destination_manager.cpp b/src/mongo/db/s/migration_destination_manager.cpp
index 03fdc521c80..7df4fdeef0b 100644
--- a/src/mongo/db/s/migration_destination_manager.cpp
+++ b/src/mongo/db/s/migration_destination_manager.cpp
@@ -368,7 +368,7 @@ Status MigrationDestinationManager::start(OperationContext* opCtx,
}
_sessionMigration =
- stdx::make_unique<SessionCatalogMigrationDestination>(_fromShard, *_sessionId);
+ std::make_unique<SessionCatalogMigrationDestination>(_fromShard, *_sessionId);
ShardingStatistics::get(opCtx).countRecipientMoveChunkStarted.addAndFetch(1);
_migrateThreadHandle = stdx::thread([this]() { _migrateThread(); });
diff --git a/src/mongo/db/s/migration_source_manager.cpp b/src/mongo/db/s/migration_source_manager.cpp
index 42e5a35a2d0..8935b676e45 100644
--- a/src/mongo/db/s/migration_source_manager.cpp
+++ b/src/mongo/db/s/migration_source_manager.cpp
@@ -33,6 +33,8 @@
#include "mongo/db/s/migration_source_manager.h"
+#include <memory>
+
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/catalog_raii.h"
#include "mongo/db/concurrency/write_conflict_exception.h"
@@ -58,7 +60,6 @@
#include "mongo/s/request_types/commit_chunk_migration_request_type.h"
#include "mongo/s/request_types/set_shard_version_request.h"
#include "mongo/s/shard_key_pattern.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/duration.h"
#include "mongo/util/elapsed_tracker.h"
#include "mongo/util/exit.h"
@@ -246,7 +247,7 @@ Status MigrationSourceManager::startClone(OperationContext* opCtx) {
// that a chunk on that collection is being migrated. With an active migration, write
// operations require the cloner to be present in order to track changes to the chunk which
// needs to be transmitted to the recipient.
- _cloneDriver = stdx::make_unique<MigrationChunkClonerSourceLegacy>(
+ _cloneDriver = std::make_unique<MigrationChunkClonerSourceLegacy>(
_args, metadata->getKeyPattern(), _donorConnStr, _recipientHost);
boost::optional<AutoGetCollection> autoColl;
diff --git a/src/mongo/db/s/namespace_metadata_change_notifications_test.cpp b/src/mongo/db/s/namespace_metadata_change_notifications_test.cpp
index 052f8a6d352..e6c922d0ed5 100644
--- a/src/mongo/db/s/namespace_metadata_change_notifications_test.cpp
+++ b/src/mongo/db/s/namespace_metadata_change_notifications_test.cpp
@@ -29,11 +29,12 @@
#include "mongo/platform/basic.h"
+#include <memory>
+
#include "mongo/db/operation_context_noop.h"
#include "mongo/db/s/namespace_metadata_change_notifications.h"
#include "mongo/db/service_context.h"
#include "mongo/db/service_context_d_test_fixture.h"
-#include "mongo/stdx/memory.h"
#include "mongo/stdx/thread.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/tick_source_mock.h"
@@ -46,7 +47,7 @@ const NamespaceString kNss("foo.bar");
class NamespaceMetadataChangeNotificationsTest : public ServiceContextMongoDTest {
protected:
NamespaceMetadataChangeNotificationsTest() {
- getServiceContext()->setTickSource(stdx::make_unique<TickSourceMock<>>());
+ getServiceContext()->setTickSource(std::make_unique<TickSourceMock<>>());
}
};
diff --git a/src/mongo/db/s/session_catalog_migration_destination_test.cpp b/src/mongo/db/s/session_catalog_migration_destination_test.cpp
index 2bdd5d3b62a..483a8285a0f 100644
--- a/src/mongo/db/s/session_catalog_migration_destination_test.cpp
+++ b/src/mongo/db/s/session_catalog_migration_destination_test.cpp
@@ -29,6 +29,8 @@
#include "mongo/platform/basic.h"
+#include <memory>
+
#include "mongo/client/connection_string.h"
#include "mongo/client/remote_command_targeter_mock.h"
#include "mongo/db/concurrency/d_concurrency.h"
@@ -52,7 +54,6 @@
#include "mongo/s/catalog/type_shard.h"
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/shard_server_test_fixture.h"
-#include "mongo/stdx/memory.h"
#include "mongo/stdx/thread.h"
#include "mongo/unittest/unittest.h"
@@ -132,7 +133,7 @@ public:
}
MongoDSessionCatalog::onStepUp(operationContext());
- LogicalSessionCache::set(getServiceContext(), stdx::make_unique<LogicalSessionCacheNoop>());
+ LogicalSessionCache::set(getServiceContext(), std::make_unique<LogicalSessionCacheNoop>());
}
void returnOplog(const std::vector<OplogEntry>& oplogList) {
@@ -283,7 +284,7 @@ private:
}
};
- return stdx::make_unique<StaticCatalogClient>();
+ return std::make_unique<StaticCatalogClient>();
}
void _checkOplogExceptO2(const repl::OplogEntry& originalOplog,
diff --git a/src/mongo/db/s/session_catalog_migration_source.cpp b/src/mongo/db/s/session_catalog_migration_source.cpp
index 11efb9ad1d3..94e052851ca 100644
--- a/src/mongo/db/s/session_catalog_migration_source.cpp
+++ b/src/mongo/db/s/session_catalog_migration_source.cpp
@@ -31,6 +31,8 @@
#include "mongo/db/s/session_catalog_migration_source.h"
+#include <memory>
+
#include "mongo/db/catalog_raii.h"
#include "mongo/db/concurrency/write_conflict_exception.h"
#include "mongo/db/dbdirectclient.h"
@@ -44,7 +46,6 @@
#include "mongo/db/transaction_participant.h"
#include "mongo/db/write_concern.h"
#include "mongo/platform/random.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/str.h"
@@ -148,7 +149,7 @@ SessionCatalogMigrationSource::SessionCatalogMigrationSource(OperationContext* o
IDLParserErrorContext("Session migration cloning"), cursor->next());
if (!nextSession.getLastWriteOpTime().isNull()) {
_sessionOplogIterators.push_back(
- stdx::make_unique<SessionOplogIterator>(std::move(nextSession), _rollbackIdAtInit));
+ std::make_unique<SessionOplogIterator>(std::move(nextSession), _rollbackIdAtInit));
}
}
@@ -390,7 +391,7 @@ SessionCatalogMigrationSource::SessionOplogIterator::SessionOplogIterator(
SessionTxnRecord txnRecord, int expectedRollbackId)
: _record(std::move(txnRecord)), _initialRollbackId(expectedRollbackId) {
_writeHistoryIterator =
- stdx::make_unique<TransactionHistoryIterator>(_record.getLastWriteOpTime());
+ std::make_unique<TransactionHistoryIterator>(_record.getLastWriteOpTime());
}
boost::optional<repl::OplogEntry> SessionCatalogMigrationSource::SessionOplogIterator::getNext(
diff --git a/src/mongo/db/s/shard_metadata_util.cpp b/src/mongo/db/s/shard_metadata_util.cpp
index 7e0cc51ccd4..59b6a5562f3 100644
--- a/src/mongo/db/s/shard_metadata_util.cpp
+++ b/src/mongo/db/s/shard_metadata_util.cpp
@@ -33,6 +33,8 @@
#include "mongo/db/s/shard_metadata_util.h"
+#include <memory>
+
#include "mongo/db/dbdirectclient.h"
#include "mongo/db/ops/write_ops.h"
#include "mongo/db/write_concern_options.h"
@@ -43,7 +45,6 @@
#include "mongo/s/catalog/type_shard_database.h"
#include "mongo/s/chunk_version.h"
#include "mongo/s/write_ops/batched_command_response.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/log.h"
namespace mongo {
diff --git a/src/mongo/db/s/shard_server_catalog_cache_loader.cpp b/src/mongo/db/s/shard_server_catalog_cache_loader.cpp
index e6d312f6db4..7266adfc233 100644
--- a/src/mongo/db/s/shard_server_catalog_cache_loader.cpp
+++ b/src/mongo/db/s/shard_server_catalog_cache_loader.cpp
@@ -33,6 +33,8 @@
#include "mongo/db/s/shard_server_catalog_cache_loader.h"
+#include <memory>
+
#include "mongo/db/client.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/operation_context_group.h"
@@ -44,7 +46,6 @@
#include "mongo/s/catalog/type_shard_database.h"
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/grid.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/log.h"
namespace mongo {
diff --git a/src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp b/src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp
index 20241ce52fc..368b4a52421 100644
--- a/src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp
+++ b/src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp
@@ -98,10 +98,9 @@ void ShardServerCatalogCacheLoaderTest::setUp() {
// Create mock remote and real shard loader, retaining a pointer to the mock remote loader so
// that unit tests can manipulate it to return certain responses.
- std::unique_ptr<CatalogCacheLoaderMock> mockLoader =
- stdx::make_unique<CatalogCacheLoaderMock>();
+ std::unique_ptr<CatalogCacheLoaderMock> mockLoader = std::make_unique<CatalogCacheLoaderMock>();
_remoteLoaderMock = mockLoader.get();
- _shardLoader = stdx::make_unique<ShardServerCatalogCacheLoader>(std::move(mockLoader));
+ _shardLoader = std::make_unique<ShardServerCatalogCacheLoader>(std::move(mockLoader));
// Set the shard loader to primary mode, and set it for testing.
_shardLoader->initializeReplicaSetRole(true);
diff --git a/src/mongo/db/s/sharding_initialization_mongod.cpp b/src/mongo/db/s/sharding_initialization_mongod.cpp
index e95c954e10d..c3ca8877773 100644
--- a/src/mongo/db/s/sharding_initialization_mongod.cpp
+++ b/src/mongo/db/s/sharding_initialization_mongod.cpp
@@ -76,10 +76,9 @@ namespace {
const auto getInstance = ServiceContext::declareDecoration<ShardingInitializationMongoD>();
auto makeEgressHooksList(ServiceContext* service) {
- auto unshardedHookList = stdx::make_unique<rpc::EgressMetadataHookList>();
- unshardedHookList->addHook(stdx::make_unique<rpc::LogicalTimeMetadataHook>(service));
- unshardedHookList->addHook(
- stdx::make_unique<rpc::ShardingEgressMetadataHookForMongod>(service));
+ auto unshardedHookList = std::make_unique<rpc::EgressMetadataHookList>();
+ unshardedHookList->addHook(std::make_unique<rpc::LogicalTimeMetadataHook>(service));
+ unshardedHookList->addHook(std::make_unique<rpc::ShardingEgressMetadataHookForMongod>(service));
return unshardedHookList;
}
@@ -370,24 +369,22 @@ void ShardingInitializationMongoD::updateShardIdentityConfigString(
void initializeGlobalShardingStateForMongoD(OperationContext* opCtx,
const ConnectionString& configCS,
StringData distLockProcessId) {
- auto targeterFactory = stdx::make_unique<RemoteCommandTargeterFactoryImpl>();
+ auto targeterFactory = std::make_unique<RemoteCommandTargeterFactoryImpl>();
auto targeterFactoryPtr = targeterFactory.get();
- ShardFactory::BuilderCallable setBuilder =
- [targeterFactoryPtr](const ShardId& shardId, const ConnectionString& connStr) {
- return stdx::make_unique<ShardRemote>(
- shardId, connStr, targeterFactoryPtr->create(connStr));
- };
+ ShardFactory::BuilderCallable setBuilder = [targeterFactoryPtr](
+ const ShardId& shardId, const ConnectionString& connStr) {
+ return std::make_unique<ShardRemote>(shardId, connStr, targeterFactoryPtr->create(connStr));
+ };
- ShardFactory::BuilderCallable masterBuilder =
- [targeterFactoryPtr](const ShardId& shardId, const ConnectionString& connStr) {
- return stdx::make_unique<ShardRemote>(
- shardId, connStr, targeterFactoryPtr->create(connStr));
- };
+ ShardFactory::BuilderCallable masterBuilder = [targeterFactoryPtr](
+ const ShardId& shardId, const ConnectionString& connStr) {
+ return std::make_unique<ShardRemote>(shardId, connStr, targeterFactoryPtr->create(connStr));
+ };
ShardFactory::BuilderCallable localBuilder = [](const ShardId& shardId,
const ConnectionString& connStr) {
- return stdx::make_unique<ShardLocal>(shardId);
+ return std::make_unique<ShardLocal>(shardId);
};
ShardFactory::BuildersMap buildersMap{
@@ -397,20 +394,20 @@ void initializeGlobalShardingStateForMongoD(OperationContext* opCtx,
};
auto shardFactory =
- stdx::make_unique<ShardFactory>(std::move(buildersMap), std::move(targeterFactory));
+ std::make_unique<ShardFactory>(std::move(buildersMap), std::move(targeterFactory));
auto const service = opCtx->getServiceContext();
if (serverGlobalParams.clusterRole == ClusterRole::ShardServer) {
if (storageGlobalParams.readOnly) {
- CatalogCacheLoader::set(service, stdx::make_unique<ReadOnlyCatalogCacheLoader>());
+ CatalogCacheLoader::set(service, std::make_unique<ReadOnlyCatalogCacheLoader>());
} else {
CatalogCacheLoader::set(service,
- stdx::make_unique<ShardServerCatalogCacheLoader>(
- stdx::make_unique<ConfigServerCatalogCacheLoader>()));
+ std::make_unique<ShardServerCatalogCacheLoader>(
+ std::make_unique<ConfigServerCatalogCacheLoader>()));
}
} else {
- CatalogCacheLoader::set(service, stdx::make_unique<ConfigServerCatalogCacheLoader>());
+ CatalogCacheLoader::set(service, std::make_unique<ConfigServerCatalogCacheLoader>());
}
auto validator = LogicalTimeValidator::get(service);
@@ -426,7 +423,7 @@ void initializeGlobalShardingStateForMongoD(OperationContext* opCtx,
configCS,
distLockProcessId,
std::move(shardFactory),
- stdx::make_unique<CatalogCache>(CatalogCacheLoader::get(opCtx)),
+ std::make_unique<CatalogCache>(CatalogCacheLoader::get(opCtx)),
[service] { return makeEgressHooksList(service); },
// We only need one task executor here because sharding task executors aren't used for user
// queries in mongod.
diff --git a/src/mongo/db/s/sharding_initialization_mongod_test.cpp b/src/mongo/db/s/sharding_initialization_mongod_test.cpp
index d124b98cc21..21bbe8553ff 100644
--- a/src/mongo/db/s/sharding_initialization_mongod_test.cpp
+++ b/src/mongo/db/s/sharding_initialization_mongod_test.cpp
@@ -70,8 +70,8 @@ protected:
serverGlobalParams.clusterRole = ClusterRole::ShardServer;
CatalogCacheLoader::set(getServiceContext(),
- stdx::make_unique<ShardServerCatalogCacheLoader>(
- stdx::make_unique<ConfigServerCatalogCacheLoader>()));
+ std::make_unique<ShardServerCatalogCacheLoader>(
+ std::make_unique<ConfigServerCatalogCacheLoader>()));
ShardingInitializationMongoD::get(getServiceContext())
->setGlobalInitMethodForTest([&](OperationContext* opCtx,
@@ -92,7 +92,7 @@ protected:
return Status::OK();
});
- _dbDirectClient = stdx::make_unique<DBDirectClient>(operationContext());
+ _dbDirectClient = std::make_unique<DBDirectClient>(operationContext());
}
void tearDown() override {
@@ -110,13 +110,13 @@ protected:
std::unique_ptr<DistLockManager> makeDistLockManager(
std::unique_ptr<DistLockCatalog> distLockCatalog) override {
- return stdx::make_unique<DistLockManagerMock>(nullptr);
+ return std::make_unique<DistLockManagerMock>(nullptr);
}
std::unique_ptr<ShardingCatalogClient> makeShardingCatalogClient(
std::unique_ptr<DistLockManager> distLockManager) override {
invariant(distLockManager);
- return stdx::make_unique<ShardingCatalogClientImpl>(std::move(distLockManager));
+ return std::make_unique<ShardingCatalogClientImpl>(std::move(distLockManager));
}
auto* shardingInitialization() {
@@ -136,16 +136,16 @@ class ScopedSetStandaloneMode {
public:
ScopedSetStandaloneMode(ServiceContext* serviceContext) : _serviceContext(serviceContext) {
serverGlobalParams.clusterRole = ClusterRole::None;
- _serviceContext->setOpObserver(stdx::make_unique<OpObserverRegistry>());
+ _serviceContext->setOpObserver(std::make_unique<OpObserverRegistry>());
}
~ScopedSetStandaloneMode() {
serverGlobalParams.clusterRole = ClusterRole::ShardServer;
auto makeOpObserver = [&] {
- auto opObserver = stdx::make_unique<OpObserverRegistry>();
- opObserver->addObserver(stdx::make_unique<OpObserverShardingImpl>());
- opObserver->addObserver(stdx::make_unique<ConfigServerOpObserver>());
- opObserver->addObserver(stdx::make_unique<ShardServerOpObserver>());
+ auto opObserver = std::make_unique<OpObserverRegistry>();
+ opObserver->addObserver(std::make_unique<OpObserverShardingImpl>());
+ opObserver->addObserver(std::make_unique<ConfigServerOpObserver>());
+ opObserver->addObserver(std::make_unique<ShardServerOpObserver>());
return opObserver;
};
diff --git a/src/mongo/db/s/transaction_coordinator.cpp b/src/mongo/db/s/transaction_coordinator.cpp
index 414bd3c058f..fb264cd2e3f 100644
--- a/src/mongo/db/s/transaction_coordinator.cpp
+++ b/src/mongo/db/s/transaction_coordinator.cpp
@@ -58,7 +58,7 @@ TransactionCoordinator::TransactionCoordinator(ServiceContext* serviceContext,
_scheduler(std::move(scheduler)),
_sendPrepareScheduler(_scheduler->makeChildScheduler()),
_transactionCoordinatorMetricsObserver(
- stdx::make_unique<TransactionCoordinatorMetricsObserver>()) {
+ std::make_unique<TransactionCoordinatorMetricsObserver>()) {
auto kickOffCommitPF = makePromiseFuture<void>();
_kickOffCommitPromise = std::move(kickOffCommitPF.promise);
diff --git a/src/mongo/db/s/transaction_coordinator_futures_util.cpp b/src/mongo/db/s/transaction_coordinator_futures_util.cpp
index 0af8b465353..c27e4c21eee 100644
--- a/src/mongo/db/s/transaction_coordinator_futures_util.cpp
+++ b/src/mongo/db/s/transaction_coordinator_futures_util.cpp
@@ -175,7 +175,7 @@ Future<executor::TaskExecutor::ResponseStatus> AsyncWorkScheduler::scheduleRemot
}
std::unique_ptr<AsyncWorkScheduler> AsyncWorkScheduler::makeChildScheduler() {
- auto child = stdx::make_unique<AsyncWorkScheduler>(_serviceContext);
+ auto child = std::make_unique<AsyncWorkScheduler>(_serviceContext);
stdx::lock_guard<stdx::mutex> lg(_mutex);
if (!_shutdownStatus.isOK())
diff --git a/src/mongo/db/s/transaction_coordinator_futures_util_test.cpp b/src/mongo/db/s/transaction_coordinator_futures_util_test.cpp
index bed0927a650..f2054c59f62 100644
--- a/src/mongo/db/s/transaction_coordinator_futures_util_test.cpp
+++ b/src/mongo/db/s/transaction_coordinator_futures_util_test.cpp
@@ -315,7 +315,7 @@ protected:
}
};
- return stdx::make_unique<StaticCatalogClient>();
+ return std::make_unique<StaticCatalogClient>();
}
static std::vector<ShardId> makeThreeShardIdsList() {
diff --git a/src/mongo/db/s/transaction_coordinator_test.cpp b/src/mongo/db/s/transaction_coordinator_test.cpp
index 77bd01d1173..f87120f419d 100644
--- a/src/mongo/db/s/transaction_coordinator_test.cpp
+++ b/src/mongo/db/s/transaction_coordinator_test.cpp
@@ -826,9 +826,9 @@ public:
void setUp() override {
TransactionCoordinatorTestBase::setUp();
- getServiceContext()->setPreciseClockSource(stdx::make_unique<ClockSourceMock>());
+ getServiceContext()->setPreciseClockSource(std::make_unique<ClockSourceMock>());
- auto tickSource = stdx::make_unique<TickSourceMock<Microseconds>>();
+ auto tickSource = std::make_unique<TickSourceMock<Microseconds>>();
tickSource->reset(1);
getServiceContext()->setTickSource(std::move(tickSource));
}
diff --git a/src/mongo/db/s/transaction_coordinator_test_fixture.cpp b/src/mongo/db/s/transaction_coordinator_test_fixture.cpp
index e33da68ab2b..bced1fcb575 100644
--- a/src/mongo/db/s/transaction_coordinator_test_fixture.cpp
+++ b/src/mongo/db/s/transaction_coordinator_test_fixture.cpp
@@ -92,7 +92,7 @@ std::unique_ptr<ShardingCatalogClient> TransactionCoordinatorTestFixture::makeSh
const std::vector<ShardId> _shardIds;
};
- return stdx::make_unique<StaticCatalogClient>(kThreeShardIdList);
+ return std::make_unique<StaticCatalogClient>(kThreeShardIdList);
}
void TransactionCoordinatorTestFixture::assertCommandSentAndRespondWith(