summaryrefslogtreecommitdiff
path: root/src/mongo/client/sdam/topology_listener_mock.cpp
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2020-04-29 17:02:58 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-06 18:16:39 +0000
commitac891ed967fa7568c584e0fafe43c3d24b112fb4 (patch)
treeb0e01f7531d6870c77768f1f5118297dc314653d /src/mongo/client/sdam/topology_listener_mock.cpp
parentd5d0401e518beab5b659c1a01a092286f8a9c792 (diff)
downloadmongo-ac891ed967fa7568c584e0fafe43c3d24b112fb4.tar.gz
SERVER-45395 Change ServerAddress type to be HostAndPort
Diffstat (limited to 'src/mongo/client/sdam/topology_listener_mock.cpp')
-rw-r--r--src/mongo/client/sdam/topology_listener_mock.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/client/sdam/topology_listener_mock.cpp b/src/mongo/client/sdam/topology_listener_mock.cpp
index b737402d181..22aebbd2c2e 100644
--- a/src/mongo/client/sdam/topology_listener_mock.cpp
+++ b/src/mongo/client/sdam/topology_listener_mock.cpp
@@ -34,7 +34,7 @@
namespace mongo::sdam {
-void TopologyListenerMock::onServerHeartbeatSucceededEvent(const ServerAddress& hostAndPort,
+void TopologyListenerMock::onServerHeartbeatSucceededEvent(const HostAndPort& hostAndPort,
const BSONObj reply) {
stdx::lock_guard lk(_mutex);
auto it = _serverIsMasterReplies.find(hostAndPort);
@@ -46,7 +46,7 @@ void TopologyListenerMock::onServerHeartbeatSucceededEvent(const ServerAddress&
}
void TopologyListenerMock::onServerHeartbeatFailureEvent(Status errorStatus,
- const ServerAddress& hostAndPort,
+ const HostAndPort& hostAndPort,
const BSONObj reply) {
stdx::lock_guard lk(_mutex);
// If the map already contains an element for hostAndPort, append to its already existing
@@ -59,16 +59,16 @@ void TopologyListenerMock::onServerHeartbeatFailureEvent(Status errorStatus,
}
}
-bool TopologyListenerMock::hasIsMasterResponse(const ServerAddress& hostAndPort) {
+bool TopologyListenerMock::hasIsMasterResponse(const HostAndPort& hostAndPort) {
stdx::lock_guard lock(_mutex);
return _hasIsMasterResponse(lock, hostAndPort);
}
-bool TopologyListenerMock::_hasIsMasterResponse(WithLock, const ServerAddress& hostAndPort) {
+bool TopologyListenerMock::_hasIsMasterResponse(WithLock, const HostAndPort& hostAndPort) {
return _serverIsMasterReplies.find(hostAndPort) != _serverIsMasterReplies.end();
}
-std::vector<Status> TopologyListenerMock::getIsMasterResponse(const ServerAddress& hostAndPort) {
+std::vector<Status> TopologyListenerMock::getIsMasterResponse(const HostAndPort& hostAndPort) {
stdx::lock_guard lock(_mutex);
invariant(_hasIsMasterResponse(lock, hostAndPort));
auto it = _serverIsMasterReplies.find(hostAndPort);
@@ -78,7 +78,7 @@ std::vector<Status> TopologyListenerMock::getIsMasterResponse(const ServerAddres
}
void TopologyListenerMock::onServerPingSucceededEvent(IsMasterRTT latency,
- const ServerAddress& hostAndPort) {
+ const HostAndPort& hostAndPort) {
stdx::lock_guard lk(_mutex);
auto it = _serverPingRTTs.find(hostAndPort);
if (it != _serverPingRTTs.end()) {
@@ -88,7 +88,7 @@ void TopologyListenerMock::onServerPingSucceededEvent(IsMasterRTT latency,
}
}
-void TopologyListenerMock::onServerPingFailedEvent(const ServerAddress& hostAndPort,
+void TopologyListenerMock::onServerPingFailedEvent(const HostAndPort& hostAndPort,
const Status& errorStatus) {
stdx::lock_guard lk(_mutex);
// If the map already contains an element for hostAndPort, append to its already existing
@@ -101,17 +101,17 @@ void TopologyListenerMock::onServerPingFailedEvent(const ServerAddress& hostAndP
}
}
-bool TopologyListenerMock::hasPingResponse(const ServerAddress& hostAndPort) {
+bool TopologyListenerMock::hasPingResponse(const HostAndPort& hostAndPort) {
stdx::lock_guard lock(_mutex);
return _hasPingResponse(lock, hostAndPort);
}
-bool TopologyListenerMock::_hasPingResponse(WithLock, const ServerAddress& hostAndPort) {
+bool TopologyListenerMock::_hasPingResponse(WithLock, const HostAndPort& hostAndPort) {
return _serverPingRTTs.find(hostAndPort) != _serverPingRTTs.end();
}
std::vector<StatusWith<IsMasterRTT>> TopologyListenerMock::getPingResponse(
- const ServerAddress& hostAndPort) {
+ const HostAndPort& hostAndPort) {
stdx::lock_guard lock(_mutex);
invariant(_hasPingResponse(lock, hostAndPort));
auto it = _serverPingRTTs.find(hostAndPort);