diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-07-26 16:08:23 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-07-27 16:44:26 -0400 |
commit | adc2aa4991d3d11f1bfbe057ead70113211f6870 (patch) | |
tree | 67fb86716c7c00b6e507c9d47fac34480572764d /src/mongo/db/s/sharded_connection_info.cpp | |
parent | 00cf113dc5994b610e72607909fca9f839717e6c (diff) | |
download | mongo-adc2aa4991d3d11f1bfbe057ead70113211f6870.tar.gz |
SERVER-18084 Give ServiceContext to ShardingEgressMetadataHook
And remove its usages of grid in place of Grid::get()
Diffstat (limited to 'src/mongo/db/s/sharded_connection_info.cpp')
-rw-r--r-- | src/mongo/db/s/sharded_connection_info.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/mongo/db/s/sharded_connection_info.cpp b/src/mongo/db/s/sharded_connection_info.cpp index 7a09849417f..d9154ac7f42 100644 --- a/src/mongo/db/s/sharded_connection_info.cpp +++ b/src/mongo/db/s/sharded_connection_info.cpp @@ -107,17 +107,23 @@ void ShardedConnectionInfo::addHook(ServiceContext* service) { log() << "first cluster operation detected, adding sharding hook to enable versioning " "and authentication to remote servers"; - auto unshardedHookList = stdx::make_unique<rpc::EgressMetadataHookList>(); - unshardedHookList->addHook(stdx::make_unique<rpc::LogicalTimeMetadataHook>(service)); - unshardedHookList->addHook(stdx::make_unique<rpc::ShardingEgressMetadataHookForMongod>()); + { + auto unshardedHookList = stdx::make_unique<rpc::EgressMetadataHookList>(); + unshardedHookList->addHook(stdx::make_unique<rpc::LogicalTimeMetadataHook>(service)); + unshardedHookList->addHook( + stdx::make_unique<rpc::ShardingEgressMetadataHookForMongod>(service)); - globalConnPool.addHook(new ShardingConnectionHook(false, std::move(unshardedHookList))); + globalConnPool.addHook(new ShardingConnectionHook(false, std::move(unshardedHookList))); + } - auto shardedHookList = stdx::make_unique<rpc::EgressMetadataHookList>(); - shardedHookList->addHook(stdx::make_unique<rpc::LogicalTimeMetadataHook>(service)); - shardedHookList->addHook(stdx::make_unique<rpc::ShardingEgressMetadataHookForMongod>()); + { + auto shardedHookList = stdx::make_unique<rpc::EgressMetadataHookList>(); + shardedHookList->addHook(stdx::make_unique<rpc::LogicalTimeMetadataHook>(service)); + shardedHookList->addHook( + stdx::make_unique<rpc::ShardingEgressMetadataHookForMongod>(service)); - shardConnectionPool.addHook(new ShardingConnectionHook(true, std::move(shardedHookList))); + shardConnectionPool.addHook(new ShardingConnectionHook(true, std::move(shardedHookList))); + } alreadyAddedHook.store(1); } |