--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+class HBHandle {
+public:
+ virtual void reset_tp_timeout() = 0;
+ virtual void suspend_tp_timeout() = 0;
+ virtual ~HBHandle() {}
+};
#include "common/HeartbeatMap.h"
#include "common/Thread.h"
#include "include/Context.h"
+#include "common/HBHandle.h"
class CephContext;
ceph::condition_variable _wait_cond;
public:
- class TPHandle {
+ class TPHandle : public HBHandle {
friend class ThreadPool;
CephContext *cct;
ceph::heartbeat_handle_d *hb;
time_t grace,
time_t suicide_grace)
: cct(cct), hb(hb), grace(grace), suicide_grace(suicide_grace) {}
- void reset_tp_timeout();
- void suspend_tp_timeout();
+ void reset_tp_timeout() override final;
+ void suspend_tp_timeout() override final;
};
private:
void MissingLoc::add_batch_sources_info(
const set<pg_shard_t> &sources,
- ThreadPool::TPHandle* handle)
+ HBHandle *handle)
{
ldout(cct, 10) << __func__ << ": adding sources in batch "
<< sources.size() << dendl;
pg_shard_t fromosd,
const pg_info_t &oinfo,
const pg_missing_t &omissing,
- ThreadPool::TPHandle* handle)
+ HBHandle *handle)
{
bool found_missing = false;
unsigned loop = 0;
#include <set>
#include "OSDMap.h"
-#include "common/WorkQueue.h"
+#include "common/HBHandle.h"
#include "common/ceph_context.h"
#include "common/dout.h"
#include "osd_types.h"
pg_shard_t source, ///< [in] source
const pg_info_t &oinfo, ///< [in] info
const pg_missing_t &omissing, ///< [in] (optional) missing
- ThreadPool::TPHandle* handle ///< [in] ThreadPool handle
+ HBHandle *handle ///< [in] ThreadPool handle
); ///< @return whether a new object location was discovered
/// Adds recovery sources in batch
void add_batch_sources_info(
const set<pg_shard_t> &sources, ///< [in] a set of resources which can be used for all objects
- ThreadPool::TPHandle* handle ///< [in] ThreadPool handle
+ HBHandle *handle ///< [in] ThreadPool handle
);
/// Uses osdmap to update structures for now down sources