summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJess Fan <jess.fan@10gen.com>2016-08-08 18:13:32 -0400
committerJess Fan <jess.fan@10gen.com>2016-08-10 16:03:24 -0400
commit3ffcc4b4a105ccacb6c8d8863d44f88338395b3a (patch)
treecde01e5a870ae0a1847ab5109e45e6a21b41e343
parent3daf1fb89b9bb3ef35616e476c48e23d26e6e38c (diff)
downloadmongo-3ffcc4b4a105ccacb6c8d8863d44f88338395b3a.tar.gz
SERVER-24999 Remove ShardingTextFixture's CatalogManager for libdep
-rw-r--r--src/mongo/s/SConscript1
-rw-r--r--src/mongo/s/catalog/replset/SConscript1
-rw-r--r--src/mongo/s/sharding_test_fixture.cpp27
3 files changed, 3 insertions, 26 deletions
diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript
index 542e3bb5b86..9a576511991 100644
--- a/src/mongo/s/SConscript
+++ b/src/mongo/s/SConscript
@@ -100,7 +100,6 @@ env.Library(
'$BUILD_DIR/mongo/rpc/metadata',
'$BUILD_DIR/mongo/s/catalog/dist_lock_manager_mock',
'$BUILD_DIR/mongo/s/catalog/replset/sharding_catalog_client_impl',
- '$BUILD_DIR/mongo/s/catalog/replset/sharding_catalog_manager_impl',
'$BUILD_DIR/mongo/s/coreshard',
'$BUILD_DIR/mongo/transport/transport_layer_mock',
'$BUILD_DIR/mongo/util/clock_source_mock',
diff --git a/src/mongo/s/catalog/replset/SConscript b/src/mongo/s/catalog/replset/SConscript
index 594a91c8e6f..6c8cc788e8d 100644
--- a/src/mongo/s/catalog/replset/SConscript
+++ b/src/mongo/s/catalog/replset/SConscript
@@ -83,6 +83,7 @@ env.Library(
'sharding_catalog_manager_impl.cpp',
],
LIBDEPS=[
+ '$BUILD_DIR/mongo/db/db_raii',
'$BUILD_DIR/mongo/db/repl/read_concern_args',
'$BUILD_DIR/mongo/executor/network_interface',
'$BUILD_DIR/mongo/s/client/sharding_client',
diff --git a/src/mongo/s/sharding_test_fixture.cpp b/src/mongo/s/sharding_test_fixture.cpp
index 81b4268737e..63b662ad308 100644
--- a/src/mongo/s/sharding_test_fixture.cpp
+++ b/src/mongo/s/sharding_test_fixture.cpp
@@ -121,13 +121,6 @@ void ShardingTestFixture::setUp() {
auto executorPool = stdx::make_unique<executor::TaskExecutorPool>();
executorPool->addExecutors(std::move(executorsForPool), std::move(fixedExec));
- // Set up executor used for a few special operations during addShard.
- auto specialNet(stdx::make_unique<executor::NetworkInterfaceMock>());
- auto specialMockNet = specialNet.get();
- auto specialExec = makeThreadPoolTestExecutor(std::move(specialNet));
- _addShardNetworkTestEnv = stdx::make_unique<NetworkTestEnv>(specialExec.get(), specialMockNet);
- _executorForAddShard = specialExec.get();
-
auto uniqueDistLockManager = stdx::make_unique<DistLockManagerMock>();
_distLockManager = uniqueDistLockManager.get();
std::unique_ptr<ShardingCatalogClientImpl> catalogClient(
@@ -135,11 +128,6 @@ void ShardingTestFixture::setUp() {
_catalogClient = catalogClient.get();
catalogClient->startup();
- std::unique_ptr<ShardingCatalogManagerImpl> catalogManager(
- stdx::make_unique<ShardingCatalogManagerImpl>(_catalogClient, std::move(specialExec)));
- _catalogManager = catalogManager.get();
- catalogManager->startup();
-
ConnectionString configCS = ConnectionString::forReplicaSet(
"configRS", {HostAndPort{"TestHost1"}, HostAndPort{"TestHost2"}});
@@ -177,7 +165,7 @@ void ShardingTestFixture::setUp() {
// For now initialize the global grid object. All sharding objects will be accessible from there
// until we get rid of it.
grid.init(std::move(catalogClient),
- std::move(catalogManager),
+ nullptr,
stdx::make_unique<CatalogCache>(),
std::move(shardRegistry),
stdx::make_unique<ClusterCursorManager>(_service->getPreciseClockSource()),
@@ -188,7 +176,6 @@ void ShardingTestFixture::setUp() {
void ShardingTestFixture::tearDown() {
grid.getExecutorPool()->shutdownAndJoin();
- grid.catalogManager()->shutDown(_opCtx.get());
grid.catalogClient(_opCtx.get())->shutDown(_opCtx.get());
grid.clearForUnitTests();
@@ -199,20 +186,14 @@ void ShardingTestFixture::tearDown() {
}
void ShardingTestFixture::shutdownExecutor() {
- if (_executor) {
+ if (_executor)
_executor->shutdown();
- _executorForAddShard->shutdown();
- }
}
ShardingCatalogClient* ShardingTestFixture::catalogClient() const {
return grid.catalogClient(_opCtx.get());
}
-ShardingCatalogManager* ShardingTestFixture::catalogManager() const {
- return grid.catalogManager();
-}
-
ShardingCatalogClientImpl* ShardingTestFixture::getCatalogClient() const {
return _catalogClient;
}
@@ -262,10 +243,6 @@ void ShardingTestFixture::onCommand(NetworkTestEnv::OnCommandFunction func) {
_networkTestEnv->onCommand(func);
}
-void ShardingTestFixture::onCommandForAddShard(NetworkTestEnv::OnCommandFunction func) {
- _addShardNetworkTestEnv->onCommand(func);
-}
-
void ShardingTestFixture::onCommandWithMetadata(
NetworkTestEnv::OnCommandWithMetadataFunction func) {
_networkTestEnv->onCommandWithMetadata(func);