summaryrefslogtreecommitdiff
path: root/src/mongo/client/replica_set_monitor_internal.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_internal.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_internal.h')
-rw-r--r--src/mongo/client/replica_set_monitor_internal.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/client/replica_set_monitor_internal.h b/src/mongo/client/replica_set_monitor_internal.h
index 04479b6dab9..c4a90b47d79 100644
--- a/src/mongo/client/replica_set_monitor_internal.h
+++ b/src/mongo/client/replica_set_monitor_internal.h
@@ -142,7 +142,7 @@ public:
struct Waiter {
Date_t deadline;
ReadPreferenceSetting criteria;
- Promise<HostAndPort> promise;
+ Promise<std::vector<HostAndPort>> promise;
};
SetState(const MongoURI& uri, ReplicaSetChangeNotifier*, executor::TaskExecutor*);
@@ -154,6 +154,8 @@ public:
*
* Note: Uses only local data and does not go over the network.
*/
+ std::vector<HostAndPort> getMatchingHosts(const ReadPreferenceSetting& criteria) const;
+
HostAndPort getMatchingHost(const ReadPreferenceSetting& criteria) const;
/**