diff options
author | Ben Caimano <ben.caimano@10gen.com> | 2018-05-24 18:54:32 -0400 |
---|---|---|
committer | Ben Caimano <ben.caimano@10gen.com> | 2018-06-08 19:12:46 -0400 |
commit | e95edfa14170e05a63a51df54d39e63cc49dbe91 (patch) | |
tree | a5ee8389d48f70d7b8ad7f5b70a63351473a803e /src/mongo/client/replica_set_monitor.h | |
parent | d1ef07466b2da86ad1933c1e607ef3f3364ba100 (diff) | |
download | mongo-e95edfa14170e05a63a51df54d39e63cc49dbe91.tar.gz |
SERVER-35216 Expose ReplicaSetManager refresh period to the mongo shell
Also made things slightly nicer in the RSM
Diffstat (limited to 'src/mongo/client/replica_set_monitor.h')
-rw-r--r-- | src/mongo/client/replica_set_monitor.h | 15 |
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; |