00001
00002
00019 #pragma once
00020
00021 namespace mongo {
00022
00023
00024 bool requestHeartbeat(string setname, string fromHost, string memberFullName, BSONObj& result, int myConfigVersion, int& theirConfigVersion, bool checkEmpty = false);
00025
00026 struct HealthOptions {
00027 HealthOptions() {
00028 heartbeatSleepMillis = 2000;
00029 heartbeatTimeoutMillis = 10000;
00030 heartbeatConnRetries = 2;
00031 }
00032
00033 bool isDefault() const { return *this == HealthOptions(); }
00034
00035
00036 unsigned heartbeatSleepMillis;
00037 unsigned heartbeatTimeoutMillis;
00038 unsigned heartbeatConnRetries ;
00039
00040 void check() {
00041 uassert(13112, "bad replset heartbeat option", heartbeatSleepMillis >= 10);
00042 uassert(13113, "bad replset heartbeat option", heartbeatTimeoutMillis >= 10);
00043 }
00044
00045 bool operator==(const HealthOptions& r) const {
00046 return heartbeatSleepMillis==r.heartbeatSleepMillis && heartbeatTimeoutMillis==r.heartbeatTimeoutMillis && heartbeatConnRetries==heartbeatConnRetries;
00047 }
00048 };
00049
00050 }