diff options
author | jannaerin <golden.janna@gmail.com> | 2020-02-10 18:16:55 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-04 18:00:52 +0000 |
commit | b74fd5ae11cb95a42cf18e996e81136546cfddda (patch) | |
tree | c79a66e1158207996440aae11d3beb0d2eb64a61 /src/mongo/client/replica_set_monitor_manager.h | |
parent | fdb12065e79cd46bd0dae0f93ccd682dfeff120c (diff) | |
download | mongo-b74fd5ae11cb95a42cf18e996e81136546cfddda.tar.gz |
SERVER-45230 Rtt and isMaster from initial handshake should populate initial server description
Diffstat (limited to 'src/mongo/client/replica_set_monitor_manager.h')
-rw-r--r-- | src/mongo/client/replica_set_monitor_manager.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mongo/client/replica_set_monitor_manager.h b/src/mongo/client/replica_set_monitor_manager.h index dc6913fa905..de628867b6e 100644 --- a/src/mongo/client/replica_set_monitor_manager.h +++ b/src/mongo/client/replica_set_monitor_manager.h @@ -33,6 +33,7 @@ #include <vector> #include "mongo/client/replica_set_change_notifier.h" +#include "mongo/executor/network_connection_hook.h" #include "mongo/executor/task_executor.h" #include "mongo/platform/mutex.h" #include "mongo/util/hierarchical_acquisition.h" @@ -45,6 +46,22 @@ class ConnectionString; class ReplicaSetMonitor; class MongoURI; +class ReplicaSetMonitorManagerNetworkConnectionHook final : public executor::NetworkConnectionHook { +public: + ReplicaSetMonitorManagerNetworkConnectionHook() = default; + virtual ~ReplicaSetMonitorManagerNetworkConnectionHook() = default; + + Status validateHost(const HostAndPort& remoteHost, + const BSONObj& isMasterRequest, + const executor::RemoteCommandResponse& isMasterReply) override; + + StatusWith<boost::optional<executor::RemoteCommandRequest>> makeRequest( + const HostAndPort& remoteHost) override; + + Status handleReply(const HostAndPort& remoteHost, + executor::RemoteCommandResponse&& response) override; +}; + /** * Manages the lifetime of a set of replica set monitors. */ @@ -78,6 +95,8 @@ public: */ void removeMonitor(StringData setName); + std::shared_ptr<ReplicaSetMonitor> getMonitorForHost(const HostAndPort& host); + /** * Removes and destroys all replica set monitors. Should be used for unit tests only. */ |