summaryrefslogtreecommitdiffstats
path: root/src/common/ceph_context.h
diff options
context:
space:
mode:
authorSage Weil <sage.weil@dreamhost.com>2011-07-28 07:38:43 +0200
committerSage Weil <sage@newdream.net>2011-07-28 18:49:23 +0200
commitbdfccb099723f42fd543422acc8745aabeb8b738 (patch)
tree6b3f8e201872f3a2e32bc99d629b29accd89229b /src/common/ceph_context.h
parentmds: mark ambig imports in ESubtreeMap during resolve (diff)
downloadceph-bdfccb099723f42fd543422acc8745aabeb8b738.tar.xz
ceph-bdfccb099723f42fd543422acc8745aabeb8b738.zip
heartbeatmap: introduce heartbeat_map
Each thread registered and gets a private structure it can write a timeout value to. The timeout is time_t and always fits in a single word, so no locking is used to update it. Anyone can call is_healthy() to find out if any timeouts have expired. Eventually some background thread will do this. Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/common/ceph_context.h')
-rw-r--r--src/common/ceph_context.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/ceph_context.h b/src/common/ceph_context.h
index 957ab225a3f..ac8c39b7d09 100644
--- a/src/common/ceph_context.h
+++ b/src/common/ceph_context.h
@@ -28,6 +28,7 @@ class DoutLocker;
class PerfCountersCollection;
class md_config_obs_t;
class md_config_t;
+class HeartbeatMap;
/* A CephContext represents the context held by a single library user.
* There can be multiple CephContexts in the same process.
@@ -62,6 +63,10 @@ public:
/* Get the PerfCountersCollection of this CephContext */
PerfCountersCollection *GetPerfCountersCollection();
+ HeartbeatMap *get_heartbeat_map() {
+ return _heartbeat_map;
+ }
+
private:
CephContext(const CephContext &rhs);
CephContext &operator=(const CephContext &rhs);
@@ -86,6 +91,8 @@ private:
PerfCountersCollection *_perf_counters_collection;
md_config_obs_t *_perf_counters_conf_obs;
+
+ HeartbeatMap *_heartbeat_map;
};
#endif