summaryrefslogtreecommitdiff
path: root/src/mongo/client/replica_set_monitor.h
diff options
context:
space:
mode:
authorBen Caimano <ben.caimano@10gen.com>2018-06-19 15:46:57 -0400
committerBen Caimano <ben.caimano@10gen.com>2018-06-22 13:18:22 -0400
commit8381c31204d5ed2dc9cd9bace213f9df923af6cb (patch)
tree3caf660f333f40e837d06c1236686e096e964849 /src/mongo/client/replica_set_monitor.h
parentd520be0814492c262515cf0a5d62a127ace70dce (diff)
downloadmongo-8381c31204d5ed2dc9cd9bace213f9df923af6cb.tar.gz
SERVER-35216 Expose ReplicaSetManager refresh period to the mongo shell
Fixed after revert commit b7ac4549ba1658b31c6701a758cef670c90848ca
Diffstat (limited to 'src/mongo/client/replica_set_monitor.h')
-rw-r--r--src/mongo/client/replica_set_monitor.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mongo/client/replica_set_monitor.h b/src/mongo/client/replica_set_monitor.h
index 1c9560b56a3..ab6afcb4be2 100644
--- a/src/mongo/client/replica_set_monitor.h
+++ b/src/mongo/client/replica_set_monitor.h
@@ -235,6 +235,11 @@ public:
*/
static void shutdown();
+ /**
+ * Returns the refresh period that is given to all new SetStates.
+ */
+ static Seconds getDefaultRefreshPeriod();
+
//
// internal types (defined in replica_set_monitor_internal.h)
//
@@ -268,10 +273,14 @@ public:
private:
/**
- * A callback passed to a task executor to refresh the replica set. It reschedules itself until
- * its canceled in d-tor.
+ * Schedules a refresh via the task executor. (Task is automatically canceled in the d-tor.)
+ */
+ void _scheduleRefresh(Date_t when);
+
+ /**
+ * This function refreshes the replica set and calls _scheduleRefresh() again.
*/
- void _refresh(const executor::TaskExecutor::CallbackArgs&);
+ void _doScheduledRefresh(const executor::TaskExecutor::CallbackHandle& currentHandle);
// Serializes refresh and protects _refresherHandle
stdx::mutex _mutex;