diff options
Diffstat (limited to 'src/mongo/db/repl/replica_set_config.h')
-rw-r--r-- | src/mongo/db/repl/replica_set_config.h | 18 |
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; }; |