@@ -68,10 +68,10 @@ class MemberHeartbeatData {
6868 const HostAndPort& getSyncSource () const {
6969 return _lastResponse.getSyncingTo ();
7070 }
71- OpTime getHeartbeatAppliedOpTime () const {
71+ OpTime getAppliedOpTime () const {
7272 return _lastResponse.getAppliedOpTime ();
7373 }
74- OpTime getHeartbeatDurableOpTime () const {
74+ OpTime getDurableOpTime () const {
7575 return _lastResponse.hasDurableOpTime () ? _lastResponse.getDurableOpTime () : OpTime ();
7676 }
7777 int getConfigVersion () const {
@@ -105,49 +105,10 @@ class MemberHeartbeatData {
105105 return _health != 0 ;
106106 }
107107
108- OpTime getLastAppliedOpTime () const {
109- return _lastAppliedOpTime;
110- }
111-
112- OpTime getLastDurableOpTime () const {
113- return _lastDurableOpTime;
114- }
115-
116- // When was the last time this data was updated via any means?
117- Date_t getLastUpdate () const {
118- return _lastUpdate;
119- }
120- // Was the last update stale as of the last check?
121- bool lastUpdateStale () const {
122- return _lastUpdateStale;
123- }
124-
125- // Index of this member in the replica set config member list.
126- int getConfigIndex () const {
127- return _configIndex;
128- }
129-
130- int getMemberId () const {
131- return _memberId;
132- }
133-
134- OID getRid () const {
135- return _rid;
136- }
137-
138- bool isSelf () const {
139- return _isSelf;
140- }
141-
142- HostAndPort getHostAndPort () const {
143- return _hostAndPort;
144- }
145-
146108 /* *
147109 * Sets values in this object from the results of a successful heartbeat command.
148- * Returns whether or not the optimes advanced as a result of this heartbeat response.
149110 */
150- bool setUpValues (Date_t now, const HostAndPort& host, ReplSetHeartbeatResponse&& hbResponse);
111+ void setUpValues (Date_t now, const HostAndPort& host, ReplSetHeartbeatResponse&& hbResponse);
151112
152113 /* *
153114 * Sets values in this object from the results of a erroring/failed heartbeat command.
@@ -173,66 +134,6 @@ class MemberHeartbeatData {
173134 return _updatedSinceRestart;
174135 }
175136
176- /* *
177- * Sets the last applied op time (not the heartbeat applied op time) and updates the
178- * lastUpdate time.
179- */
180- void setLastAppliedOpTime (OpTime opTime, Date_t now);
181-
182- /* *
183- * Sets the last durable op time (not the heartbeat durable op time)
184- */
185- void setLastDurableOpTime (OpTime opTime, Date_t now);
186-
187- /* *
188- * Sets the last applied op time (not the heartbeat applied op time) iff the new optime is
189- * later than the current optime, and updates the lastUpdate time. Returns true if the
190- * optime was advanced.
191- */
192- bool advanceLastAppliedOpTime (OpTime opTime, Date_t now);
193-
194- /* *
195- * Sets the last durable op time (not the heartbeat applied op time) iff the new optime is
196- * later than the current optime, and updates the lastUpdate time. Returns true if the
197- * optime was advanced.
198- */
199- bool advanceLastDurableOpTime (OpTime opTime, Date_t now);
200-
201- /*
202- * Indicates that this data is stale, based on _lastUpdateTime.
203- */
204- void markLastUpdateStale () {
205- _lastUpdateStale = true ;
206- }
207-
208- /*
209- * Updates the _lastUpdateTime and clears staleness without changing anything else.
210- */
211- void updateLiveness (Date_t now) {
212- _lastUpdate = now;
213- _lastUpdateStale = false ;
214- }
215-
216- void setConfigIndex (int configIndex) {
217- _configIndex = configIndex;
218- }
219-
220- void setIsSelf (bool isSelf) {
221- _isSelf = isSelf;
222- }
223-
224- void setHostAndPort (HostAndPort hostAndPort) {
225- _hostAndPort = hostAndPort;
226- }
227-
228- void setMemberId (int memberId) {
229- _memberId = memberId;
230- }
231-
232- void setRid (OID rid) {
233- _rid = rid;
234- }
235-
236137private:
237138 // -1 = not checked yet, 0 = member is down/unreachable, 1 = member is up
238139 int _health;
@@ -252,38 +153,6 @@ class MemberHeartbeatData {
252153
253154 // Have we received heartbeats since the last restart?
254155 bool _updatedSinceRestart = false ;
255-
256- // Last time we got any information about this member, whether heartbeat
257- // or replSetUpdatePosition.
258- Date_t _lastUpdate;
259-
260- // Set when lastUpdate time exceeds the election timeout. Implies that the member is down
261- // on the primary, but not the secondaries.
262- bool _lastUpdateStale = false ;
263-
264- // Last known OpTime that the replica has applied and journaled to.
265- OpTime _lastDurableOpTime;
266-
267- // Last known OpTime that the replica has applied, whether journaled or unjournaled.
268- OpTime _lastAppliedOpTime;
269-
270- // TODO(russotto): Since memberHeartbeatData is kept in config order, _configIndex
271- // and _isSelf may not be necessary.
272- // Index of this member in the replica set configuration.
273- int _configIndex;
274-
275- // Is this the data for this member?
276- bool _isSelf;
277-
278- // This member's RID, used only in master/slave replication.
279- OID _rid;
280-
281- // This member's member ID. memberId and hostAndPort duplicate information in the
282- // configuration for replica sets, but are required to be here for master/slave replication.
283- int _memberId = -1 ;
284-
285- // Client address of this member.
286- HostAndPort _hostAndPort;
287156};
288157
289158} // namespace repl
0 commit comments