summaryrefslogtreecommitdiff
path: root/src/mongo/client/replica_set_monitor.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/replica_set_monitor.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/replica_set_monitor.h')
-rw-r--r--src/mongo/client/replica_set_monitor.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/client/replica_set_monitor.h b/src/mongo/client/replica_set_monitor.h
index b28364c6a25..92aa3a15add 100644
--- a/src/mongo/client/replica_set_monitor.h
+++ b/src/mongo/client/replica_set_monitor.h
@@ -90,6 +90,9 @@ public:
SemiFuture<HostAndPort> getHostOrRefresh(const ReadPreferenceSetting& readPref,
Milliseconds maxWait = kDefaultFindHostTimeout);
+ SemiFuture<std::vector<HostAndPort>> getHostsOrRefresh(
+ const ReadPreferenceSetting& readPref, Milliseconds maxWait = kDefaultFindHostTimeout);
+
/**
* Returns the host we think is the current master or uasserts.
*
@@ -258,6 +261,9 @@ public:
void runScanForMockReplicaSet();
private:
+ Future<std::vector<HostAndPort>> _getHostsOrRefresh(const ReadPreferenceSetting& readPref,
+ Milliseconds maxWait);
+
/**
* Schedules a refresh via the task executor. (Task is automatically canceled in the d-tor.)
*/