diff options
Diffstat (limited to 'src/mongo/db/repl/topology_coordinator_impl.h')
-rw-r--r-- | src/mongo/db/repl/topology_coordinator_impl.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/mongo/db/repl/topology_coordinator_impl.h b/src/mongo/db/repl/topology_coordinator_impl.h index 3e9c9a48c18..e8d0d42a46a 100644 --- a/src/mongo/db/repl/topology_coordinator_impl.h +++ b/src/mongo/db/repl/topology_coordinator_impl.h @@ -31,7 +31,7 @@ #include <string> #include <vector> -#include "mongo/bson/optime.h" +#include "mongo/bson/timestamp.h" #include "mongo/db/repl/member_heartbeat_data.h" #include "mongo/db/repl/member_state.h" #include "mongo/db/repl/replica_set_config.h" @@ -127,7 +127,7 @@ namespace repl { virtual int getMaintenanceCount() const; virtual void setForceSyncSourceIndex(int index); virtual HostAndPort chooseNewSyncSource(Date_t now, - const OpTime& lastOpApplied); + const Timestamp& lastOpApplied); virtual void blacklistSyncSource(const HostAndPort& host, Date_t until); virtual void unblacklistSyncSource(const HostAndPort& host, Date_t now); virtual void clearSyncSourceBlacklist(); @@ -138,28 +138,28 @@ namespace repl { virtual void adjustMaintenanceCountBy(int inc); virtual void prepareSyncFromResponse(const ReplicationExecutor::CallbackData& data, const HostAndPort& target, - const OpTime& lastOpApplied, + const Timestamp& lastOpApplied, BSONObjBuilder* response, Status* result); virtual void prepareFreshResponse(const ReplicationCoordinator::ReplSetFreshArgs& args, Date_t now, - OpTime lastOpApplied, + Timestamp lastOpApplied, BSONObjBuilder* response, Status* result); virtual void prepareElectResponse(const ReplicationCoordinator::ReplSetElectArgs& args, Date_t now, - OpTime lastOpApplied, + Timestamp lastOpApplied, BSONObjBuilder* response, Status* result); virtual Status prepareHeartbeatResponse(Date_t now, const ReplSetHeartbeatArgs& args, const std::string& ourSetName, - const OpTime& lastOpApplied, + const Timestamp& lastOpApplied, ReplSetHeartbeatResponse* response); virtual void prepareStatusResponse(const ReplicationExecutor::CallbackData& data, Date_t now, unsigned uptime, - const OpTime& lastOpApplied, + const Timestamp& lastOpApplied, BSONObjBuilder* response, Status* result); virtual void fillIsMasterForReplSet(IsMasterResponse* response); @@ -167,7 +167,7 @@ namespace repl { virtual void updateConfig(const ReplicaSetConfig& newConfig, int selfIndex, Date_t now, - OpTime lastOpApplied); + Timestamp lastOpApplied); virtual std::pair<ReplSetHeartbeatArgs, Milliseconds> prepareHeartbeatRequest( Date_t now, const std::string& ourSetName, @@ -177,13 +177,13 @@ namespace repl { Milliseconds networkRoundTripTime, const HostAndPort& target, const StatusWith<ReplSetHeartbeatResponse>& hbResponse, - OpTime myLastOpApplied); + Timestamp myLastOpApplied); virtual bool voteForMyself(Date_t now); - virtual void processWinElection(OID electionId, OpTime electionOpTime); + virtual void processWinElection(OID electionId, Timestamp electionOpTime); virtual void processLoseElection(); - virtual bool checkShouldStandForElection(Date_t now, const OpTime& lastOpApplied); + virtual bool checkShouldStandForElection(Date_t now, const Timestamp& lastOpApplied); virtual void setMyHeartbeatMessage(const Date_t now, const std::string& message); - virtual bool stepDown(Date_t until, bool force, OpTime lastOpApplied); + virtual bool stepDown(Date_t until, bool force, Timestamp lastOpApplied); virtual bool stepDownIfPending(); virtual Date_t getStepDownTime() const; @@ -195,10 +195,10 @@ namespace repl { // Changes _memberState to newMemberState. Only for testing. void changeMemberState_forTest(const MemberState& newMemberState, - OpTime electionTime = OpTime(0,0)); + Timestamp electionTime = Timestamp(0,0)); // Sets "_electionTime" to "newElectionTime". Only for testing. - void _setElectionTime(const OpTime& newElectionTime); + void _setElectionTime(const Timestamp& newElectionTime); // Sets _currentPrimaryIndex to the given index. Should only be used in unit tests! // TODO(spencer): Remove this once we can easily call for an election in unit tests to @@ -206,7 +206,7 @@ namespace repl { void _setCurrentPrimaryForTest(int primaryIndex); // Returns _electionTime. Only used in unittests. - OpTime getElectionTime() const; + Timestamp getElectionTime() const; // Returns _electionId. Only used in unittests. OID getElectionId() const; @@ -242,7 +242,7 @@ namespace repl { // If we veto, the errmsg will be filled in with a reason bool _shouldVetoMember(const ReplicationCoordinator::ReplSetFreshArgs& args, const Date_t& now, - const OpTime& lastOpApplied, + const Timestamp& lastOpApplied, std::string* errmsg) const; // Returns the index of the member with the matching id, or -1 if none match. @@ -253,18 +253,18 @@ namespace repl { // Is otherOpTime close enough (within 10 seconds) to the latest known optime to qualify // for an election - bool _isOpTimeCloseEnoughToLatestToElect(const OpTime& otherOpTime, - const OpTime& ourLastOpApplied) const; + bool _isOpTimeCloseEnoughToLatestToElect(const Timestamp& otherOpTime, + const Timestamp& ourLastOpApplied) const; // Returns reason why "self" member is unelectable UnelectableReasonMask _getMyUnelectableReason( const Date_t now, - const OpTime lastOpApplied) const; + const Timestamp lastOpApplied) const; // Returns reason why memberIndex is unelectable UnelectableReasonMask _getUnelectableReason( int memberIndex, - const OpTime& lastOpApplied) const; + const Timestamp& lastOpApplied) const; // Returns the nice text of why the node is unelectable std::string _getUnelectableReasonString(UnelectableReasonMask ur) const; @@ -273,10 +273,10 @@ namespace repl { bool _iAmPrimary() const; // Scans through all members that are 'up' and return the latest known optime. - OpTime _latestKnownOpTime(OpTime ourLastOpApplied) const; + Timestamp _latestKnownOpTime(Timestamp ourLastOpApplied) const; // Scans the electable set and returns the highest priority member index - int _getHighestPriorityElectableIndex(Date_t now, OpTime lastOpApplied) const; + int _getHighestPriorityElectableIndex(Date_t now, Timestamp lastOpApplied) const; // Returns true if "one" member is higher priority than "two" member bool _isMemberHigherPriority(int memberOneIndex, int memberTwoIndex) const; @@ -294,7 +294,7 @@ namespace repl { int updatedConfigIndex, const MemberState& originalState, Date_t now, - const OpTime& lastOpApplied); + const Timestamp& lastOpApplied); /** * Updates _hbdata based on the newConfig, ensuring that every member in the newConfig @@ -325,7 +325,7 @@ namespace repl { // result of an election. OID _electionId; // The time at which the current PRIMARY was elected. - OpTime _electionTime; + Timestamp _electionTime; // the index of the member we currently believe is primary, if one exists, otherwise -1 int _currentPrimaryIndex; |