summaryrefslogtreecommitdiff
path: root/src/mongo/client/remote_command_targeter_mock.h
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2019-05-13 18:23:12 -0400
committerJason Carey <jcarey@argv.me>2019-05-28 15:44:50 -0400
commit6aab87a22ec4bd89c8ef6495eeaded0829ccff7f (patch)
tree73b40abb367e1adf11cddce1bf211823c50723f8 /src/mongo/client/remote_command_targeter_mock.h
parent31e9ec1aad0a27a0ad0f0cb731c2fdcd22805c41 (diff)
downloadmongo-6aab87a22ec4bd89c8ef6495eeaded0829ccff7f.tar.gz
SERVER-41134 Add RSM::findHostsWithMaxWait
Add support for a new method on the ReplicaSetMonitor, which finds all acceptable hosts for a read preference (rather than just a single host). This should use existing selection logic to return the host that would be returned by findHostWithMaxWait in the [0]th element
Diffstat (limited to 'src/mongo/client/remote_command_targeter_mock.h')
-rw-r--r--src/mongo/client/remote_command_targeter_mock.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/client/remote_command_targeter_mock.h b/src/mongo/client/remote_command_targeter_mock.h
index 89c7245d62b..3ea39b80d22 100644
--- a/src/mongo/client/remote_command_targeter_mock.h
+++ b/src/mongo/client/remote_command_targeter_mock.h
@@ -58,6 +58,9 @@ public:
SemiFuture<HostAndPort> findHostWithMaxWait(const ReadPreferenceSetting& readPref,
Milliseconds maxWait) override;
+ SemiFuture<std::vector<HostAndPort>> findHostsWithMaxWait(const ReadPreferenceSetting& readPref,
+ Milliseconds maxWait) override;
+
StatusWith<HostAndPort> findHost(OperationContext* opCtx,
const ReadPreferenceSetting& readPref) override;
@@ -81,6 +84,8 @@ public:
*/
void setFindHostReturnValue(StatusWith<HostAndPort> returnValue);
+ void setFindHostsReturnValue(StatusWith<std::vector<HostAndPort>> returnValue);
+
/**
* Returns the current set of hosts marked down and resets the mock's internal list of marked
* down hosts.
@@ -89,7 +94,7 @@ public:
private:
ConnectionString _connectionStringReturnValue;
- StatusWith<HostAndPort> _findHostReturnValue;
+ StatusWith<std::vector<HostAndPort>> _findHostReturnValue;
// Protects _hostsMarkedDown.
mutable stdx::mutex _mutex;