#include <stdlib.h>
#include <limits.h>
-#include <boost/intrusive_ptr.hpp>
-#include "include/assert.h"
-
#include "mon/Monitor.h"
#include "mon/QuorumService.h"
#include "mon/ConfigKeyService.h"
#ifndef CEPH_MON_CONFIG_KEY_SERVICE_H
#define CEPH_MON_CONFIG_KEY_SERVICE_H
-#include <boost/intrusive_ptr.hpp>
-#include "include/assert.h"
-
#include "mon/Monitor.h"
#include "mon/QuorumService.h"
paxos(p)
{ }
virtual ~ConfigKeyService() { }
- ConfigKeyService *get() {
- return static_cast<ConfigKeyService *>(RefCountedObject::get());
- }
/**
* @} // ConfigKeyService_Inherited_h
*/
};
-typedef boost::intrusive_ptr<ConfigKeyService> ConfigKeyServiceRef;
#endif // CEPH_MON_CONFIG_KEY_SERVICE_H
#ifndef CEPH_MON_DATA_HEALTH_SERVICE_H
#define CEPH_MON_DATA_HEALTH_SERVICE_H
-#include <boost/intrusive_ptr.hpp>
-// Because intusive_ptr clobbers our assert...
-#include "include/assert.h"
#include <errno.h>
#include "include/types.h"
set_update_period(g_conf->mon_health_data_update_interval);
}
virtual ~DataHealthService() { }
- DataHealthService *get() {
- return static_cast<DataHealthService *>(RefCountedObject::get());
- }
virtual void init() {
generic_dout(20) << "data_health " << __func__ << dendl;
return "data_health";
}
};
-typedef boost::intrusive_ptr<DataHealthService> DataHealthServiceRef;
#endif /* CEPH_MON_DATA_HEALTH_SERVICE_H */
{
dout(10) << __func__ << dendl;
assert(services.empty());
- services[HealthService::SERVICE_HEALTH_DATA] =
- HealthServiceRef(new DataHealthService(mon));
+ services[HealthService::SERVICE_HEALTH_DATA] = new DataHealthService(mon);
- for (map<int,HealthServiceRef>::iterator it = services.begin();
- it != services.end(); ++it) {
+ for (map<int,HealthService*>::iterator it = services.begin();
+ it != services.end();
+ ++it) {
it->second->init();
}
}
{
dout(0) << "HealthMonitor::service_shutdown "
<< services.size() << " services" << dendl;
- for (map<int,HealthServiceRef>::iterator it = services.begin();
- it != services.end(); ++it) {
+ for (map<int,HealthService*>::iterator it = services.begin();
+ it != services.end();
+ ++it) {
it->second->shutdown();
+ delete it->second;
}
services.clear();
}
f->open_array_section("health_services");
}
- for (map<int,HealthServiceRef>::iterator it = services.begin();
- it != services.end(); ++it) {
+ for (map<int,HealthService*>::iterator it = services.begin();
+ it != services.end();
+ ++it) {
health_status_t h = it->second->get_health(f, detail);
if (overall > h)
overall = h;
#ifndef CEPH_HEALTH_MONITOR_H
#define CEPH_HEALTH_MONITOR_H
-#include <boost/intrusive_ptr.hpp>
-// Because intusive_ptr clobbers our assert...
-#include "include/assert.h"
-
#include "mon/Monitor.h"
#include "mon/QuorumService.h"
#include "mon/HealthService.h"
class HealthMonitor : public QuorumService
{
- map<int,HealthServiceRef> services;
+ map<int,HealthService*> services;
protected:
virtual void service_shutdown();
public:
HealthMonitor(Monitor *m) : QuorumService(m) { }
- virtual ~HealthMonitor() { }
- HealthMonitor *get() {
- return static_cast<HealthMonitor *>(RefCountedObject::get());
+ virtual ~HealthMonitor() {
+ assert(services.empty());
}
virtual bool service_dispatch(Message *m);
virtual void start_epoch() {
- for (map<int,HealthServiceRef>::iterator it = services.begin();
+ for (map<int,HealthService*>::iterator it = services.begin();
it != services.end(); ++it) {
it->second->start(get_epoch());
}
virtual void finish_epoch() {
generic_dout(20) << "HealthMonitor::finish_epoch()" << dendl;
- for (map<int,HealthServiceRef>::iterator it = services.begin();
+ for (map<int,HealthService*>::iterator it = services.begin();
it != services.end(); ++it) {
- assert(it->second.get() != NULL);
+ assert(it->second != NULL);
it->second->finish();
}
}
* @} // HealthMonitor_Inherited_h
*/
};
-typedef boost::intrusive_ptr<HealthMonitor> HealthMonitorRef;
#endif // CEPH_HEALTH_MONITOR_H
#ifndef CEPH_MON_HEALTH_SERVICE_H
#define CEPH_MON_HEALTH_SERVICE_H
-#include <boost/intrusive_ptr.hpp>
-// Because intusive_ptr clobbers our assert...
-#include "include/assert.h"
-
#include "mon/Monitor.h"
#include "mon/QuorumService.h"
virtual bool service_dispatch(MMonHealth *m) = 0;
public:
- HealthService *get() {
- return static_cast<HealthService *>(RefCountedObject::get());
- }
virtual health_status_t get_health(Formatter *f,
list<pair<health_status_t,string> > *detail) = 0;
virtual int get_type() = 0;
virtual string get_name() const = 0;
};
-typedef boost::intrusive_ptr<HealthService> HealthServiceRef;
#endif // CEPH_MON_HEALTH_SERVICE_H
paxos_service[PAXOS_LOG] = new LogMonitor(this, paxos, "logm");
paxos_service[PAXOS_AUTH] = new AuthMonitor(this, paxos, "auth");
- health_monitor = QuorumServiceRef(new HealthMonitor(this));
- config_key_service = ConfigKeyServiceRef(new ConfigKeyService(this, paxos));
+ health_monitor = new HealthMonitor(this);
+ config_key_service = new ConfigKeyService(this, paxos);
mon_caps = new MonCaps();
mon_caps->set_allow_all(true);
{
for (vector<PaxosService*>::iterator p = paxos_service.begin(); p != paxos_service.end(); ++p)
delete *p;
+ delete health_monitor;
+ delete config_key_service;
delete paxos;
assert(session_map.sessions.empty());
delete mon_caps;
#include <memory>
#include <tr1/memory>
#include <errno.h>
-#include <boost/intrusive_ptr.hpp>
-// Because intusive_ptr clobbers our assert...
-#include "include/assert.h"
#define CEPH_MON_PROTOCOL 10 /* cluster internal */
friend class PGMonitor;
friend class LogMonitor;
- boost::intrusive_ptr<QuorumService> health_monitor;
- boost::intrusive_ptr<QuorumService> config_key_service;
+ QuorumService *health_monitor;
+ QuorumService *config_key_service;
// -- sessions --
MonSessionMap session_map;
#ifndef CEPH_MON_QUORUM_SERVICE_H
#define CEPH_MON_QUORUM_SERVICE_H
-#include <boost/intrusive_ptr.hpp>
-// Because intusive_ptr clobbers our assert...
-#include "include/assert.h"
-
#include <errno.h>
#include "include/types.h"
#include "mon/Monitor.h"
-class QuorumService : public RefCountedObject
+class QuorumService
{
Context *tick_event;
double tick_period;
struct C_Tick : public Context {
- boost::intrusive_ptr<QuorumService> s;
- C_Tick(boost::intrusive_ptr<QuorumService> qs) : s(qs) { }
+ QuorumService *s;
+ C_Tick(QuorumService *qs) : s(qs) { }
void finish(int r) {
if (r < 0)
return;
if (tick_period <= 0)
return;
- tick_event = new C_Tick(
- boost::intrusive_ptr<QuorumService>(this));
+ tick_event = new C_Tick(this);
mon->timer.add_event_after(tick_period, tick_event);
}
public:
virtual ~QuorumService() { }
- QuorumService *get() {
- return static_cast<QuorumService *>(RefCountedObject::get());
- }
void start(epoch_t new_epoch) {
epoch = new_epoch;
virtual string get_name() const = 0;
};
-typedef boost::intrusive_ptr<QuorumService> QuorumServiceRef;
#endif /* CEPH_MON_QUORUM_SERVICE_H */
else
echo "** going verbose **"
CMONDEBUG='
- lockdep = 1
debug mon = 20
debug paxos = 20
debug auth = 20
debug ms = 1'
COSDDEBUG='
- lockdep = 1
debug ms = 1
debug osd = 25
debug monc = 20
debug filestore = 20
debug objclass = 20'
CMDSDEBUG='
- lockdep = 1
debug ms = 1
debug mds = 20
debug auth = 20