#ifndef CEPH_WATCH_H
#define CEPH_WATCH_H
-#include "include/memory.h"
#include <set>
-
-#include "msg/Messenger.h"
+#include "msg/Connection.h"
#include "include/Context.h"
enum WatcherState {
class MWatchNotify;
class Watch;
-typedef ceph::shared_ptr<Watch> WatchRef;
-typedef ceph::weak_ptr<Watch> WWatchRef;
+typedef std::shared_ptr<Watch> WatchRef;
+typedef std::weak_ptr<Watch> WWatchRef;
class Notify;
-typedef ceph::shared_ptr<Notify> NotifyRef;
-typedef ceph::weak_ptr<Notify> WNotifyRef;
+typedef std::shared_ptr<Notify> NotifyRef;
+typedef std::weak_ptr<Notify> WNotifyRef;
struct CancelableContext;
void unregister_cb();
public:
- string gen_dbg_prefix() {
- stringstream ss;
- ss << "Notify(" << make_pair(cookie, notify_id) << " "
- << " watchers=" << watchers.size()
- << ") ";
- return ss.str();
+ std::ostream& gen_dbg_prefix(std::ostream& out) {
+ return out << "Notify(" << make_pair(cookie, notify_id) << " "
+ << " watchers=" << watchers.size()
+ << ") ";
}
void set_self(NotifyRef _self) {
self = _self;
OSDService *osd;
boost::intrusive_ptr<PrimaryLogPG> pg;
- ceph::shared_ptr<ObjectContext> obc;
+ std::shared_ptr<ObjectContext> obc;
std::map<uint64_t, NotifyRef> in_progress_notifies;
entity_addr_t addr;
bool will_ping; ///< is client new enough to ping the watch
- utime_t last_ping; ///< last cilent ping
+ utime_t last_ping; ///< last client ping
entity_name_t entity;
bool discarded;
Watch(
PrimaryLogPG *pg, OSDService *osd,
- ceph::shared_ptr<ObjectContext> obc, uint32_t timeout,
+ std::shared_ptr<ObjectContext> obc, uint32_t timeout,
uint64_t cookie, entity_name_t entity,
const entity_addr_t& addr);
return entity.num();
}
- string gen_dbg_prefix();
+ std::ostream& gen_dbg_prefix(std::ostream& out);
static WatchRef makeWatchRef(
PrimaryLogPG *pg, OSDService *osd,
- ceph::shared_ptr<ObjectContext> obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, const entity_addr_t &addr);
+ std::shared_ptr<ObjectContext> obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, const entity_addr_t &addr);
void set_self(WatchRef _self) {
self = _self;
}
/// Does not grant a ref count!
boost::intrusive_ptr<PrimaryLogPG> get_pg() { return pg; }
- ceph::shared_ptr<ObjectContext> get_obc() { return obc; }
+ std::shared_ptr<ObjectContext> get_obc() { return obc; }
uint64_t get_cookie() const { return cookie; }
entity_name_t get_entity() const { return entity; }
std::set<WatchRef> watches;
public:
CephContext* cct;
- WatchConState(CephContext* cct) : lock("WatchConState"), cct(cct) {}
+ explicit WatchConState(CephContext* cct) : lock("WatchConState"), cct(cct) {}
/// Add a watch
void addWatch(