From 9d0f6650eff7c1e467a55d01ceb9e425eb86e7c6 Mon Sep 17 00:00:00 2001 From: Scott Hernandez Date: Tue, 7 Oct 2014 14:09:12 -0400 Subject: SERVER-14531: ensure enough freshness responses --- src/mongo/db/repl/replica_set_config.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/mongo/db/repl/replica_set_config.h') diff --git a/src/mongo/db/repl/replica_set_config.h b/src/mongo/db/repl/replica_set_config.h index 0b16386a565..5a9dc9cc493 100644 --- a/src/mongo/db/repl/replica_set_config.h +++ b/src/mongo/db/repl/replica_set_config.h @@ -128,6 +128,18 @@ namespace repl { */ const MemberConfig* findMemberByID(int id) const; + /** + * Returns a pointer to the MemberConfig corresponding to the member with the given + * HostAndPort in the config, or NULL if there is no member with that address. + */ + const MemberConfig* findMemberByHostAndPort(const HostAndPort& hap) const; + + /** + * Returns a MemberConfig index position corresponding to the member with the given + * HostAndPort in the config, or -1 if there is no member with that address. + */ + const int findMemberIndexByHostAndPort(const HostAndPort& hap) const; + /** * Gets the default write concern for the replica set described by this configuration. */ @@ -159,6 +171,11 @@ namespace repl { */ int getMajorityVoteCount() const { return _majorityVoteCount; } + /** + * Gets the number of voters. + */ + int getTotalVotingMembers() const { return _totalVotingMembers; } + /** * Returns true if automatic (not explicitly set) chaining is allowed. */ @@ -216,6 +233,7 @@ namespace repl { bool _chainingAllowed; int _majorityNumber; int _majorityVoteCount; + int _totalVotingMembers; ReplicaSetTagConfig _tagConfig; StringMap _customWriteConcernModes; }; -- cgit v1.2.1