summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replica_set_config.h
diff options
context:
space:
mode:
authorScott Hernandez <scotthernandez@gmail.com>2014-10-07 14:09:12 -0400
committerScott Hernandez <scotthernandez@gmail.com>2014-10-10 11:38:33 -0400
commit9d0f6650eff7c1e467a55d01ceb9e425eb86e7c6 (patch)
tree8b8306e1c708821d609eefd923c363d25f5dfae7 /src/mongo/db/repl/replica_set_config.h
parent42df1b57c337917be42afca60319afec198114bb (diff)
downloadmongo-9d0f6650eff7c1e467a55d01ceb9e425eb86e7c6.tar.gz
SERVER-14531: ensure enough freshness responses
Diffstat (limited to 'src/mongo/db/repl/replica_set_config.h')
-rw-r--r--src/mongo/db/repl/replica_set_config.h18
1 files changed, 18 insertions, 0 deletions
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
@@ -129,6 +129,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.
*/
const WriteConcernOptions& getDefaultWriteConcern() const { return _defaultWriteConcern; }
@@ -160,6 +172,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.
*/
bool isChainingAllowed() const { return _chainingAllowed; }
@@ -216,6 +233,7 @@ namespace repl {
bool _chainingAllowed;
int _majorityNumber;
int _majorityVoteCount;
+ int _totalVotingMembers;
ReplicaSetTagConfig _tagConfig;
StringMap<ReplicaSetTagPattern> _customWriteConcernModes;
};