diff options
author | Andrew Morrow <acm@mongodb.com> | 2015-09-28 12:20:51 -0400 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2015-09-28 18:23:22 -0400 |
commit | a998887902dfd9cb6f125233c86361064f80c57e (patch) | |
tree | 7dc183bae7ac99dcd74e49b4dd944af30edf598f /src/mongo/executor/network_interface_factory.cpp | |
parent | 780565d818e82f841ba5f847b315358e519a47ec (diff) | |
download | mongo-a998887902dfd9cb6f125233c86361064f80c57e.tar.gz |
SERVER-20663 Remove support for running with thread based network interface
Diffstat (limited to 'src/mongo/executor/network_interface_factory.cpp')
-rw-r--r-- | src/mongo/executor/network_interface_factory.cpp | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/src/mongo/executor/network_interface_factory.cpp b/src/mongo/executor/network_interface_factory.cpp index 7b7446bcc11..7492e8bd16f 100644 --- a/src/mongo/executor/network_interface_factory.cpp +++ b/src/mongo/executor/network_interface_factory.cpp @@ -38,7 +38,6 @@ #include "mongo/executor/async_timer_asio.h" #include "mongo/executor/network_connection_hook.h" #include "mongo/executor/network_interface_asio.h" -#include "mongo/executor/network_interface_impl.h" #include "mongo/rpc/metadata/metadata_hook.h" #include "mongo/stdx/memory.h" #include "mongo/util/net/ssl_manager.h" @@ -46,22 +45,6 @@ namespace mongo { namespace executor { -namespace { - -const char kNetworkImplASIO[] = "ASIO"; -const char kNetworkImplThreadPool[] = "threadPool"; - -} // namespace - -MONGO_EXPORT_STARTUP_SERVER_PARAMETER(outboundNetworkImpl, std::string, kNetworkImplASIO); -MONGO_INITIALIZER(outboundNetworkImpl)(InitializerContext*) { - if (outboundNetworkImpl != kNetworkImplThreadPool && outboundNetworkImpl != kNetworkImplASIO) { - return Status(ErrorCodes::BadValue, - "unsupported networking option: " + outboundNetworkImpl); - } - return Status::OK(); -} - std::unique_ptr<NetworkInterface> makeNetworkInterface() { return makeNetworkInterface(nullptr, nullptr); } @@ -69,22 +52,21 @@ std::unique_ptr<NetworkInterface> makeNetworkInterface() { std::unique_ptr<NetworkInterface> makeNetworkInterface( std::unique_ptr<NetworkConnectionHook> hook, std::unique_ptr<rpc::EgressMetadataHook> metadataHook) { - if (outboundNetworkImpl == kNetworkImplASIO) { - NetworkInterfaceASIO::Options options{}; - options.networkConnectionHook = std::move(hook); - options.metadataHook = std::move(metadataHook); - options.timerFactory = stdx::make_unique<AsyncTimerFactoryASIO>(); + NetworkInterfaceASIO::Options options{}; + options.networkConnectionHook = std::move(hook); + options.metadataHook = std::move(metadataHook); + options.timerFactory = stdx::make_unique<AsyncTimerFactoryASIO>(); + #ifdef MONGO_CONFIG_SSL - if (SSLManagerInterface* manager = getSSLManager()) { - options.streamFactory = stdx::make_unique<AsyncSecureStreamFactory>(manager); - return stdx::make_unique<NetworkInterfaceASIO>(std::move(options)); - } + if (SSLManagerInterface* manager = getSSLManager()) { + options.streamFactory = stdx::make_unique<AsyncSecureStreamFactory>(manager); + } #endif + + if (!options.streamFactory) options.streamFactory = stdx::make_unique<AsyncStreamFactory>(); - return stdx::make_unique<NetworkInterfaceASIO>(std::move(options)); - } else { - return stdx::make_unique<NetworkInterfaceImpl>(std::move(hook)); - } + + return stdx::make_unique<NetworkInterfaceASIO>(std::move(options)); } } // namespace executor |