~MMonMgrReport() override {}
public:
-
+ bool needs_send = false;
const char *get_type_name() const override { return "monmgrreport"; }
void print(ostream& out) const override {
*/
#include "messages/MMgrDigest.h"
+#include "messages/MMonMgrReport.h"
#include "messages/MPGStats.h"
#include "mgr/ClusterState.h"
// while the full-blown PGMap lives only here.
}
+void ClusterState::tick(MMonMgrReport *m)
+{
+ dout(0) << __func__ << dendl;
+}
#include "mon/PGMap.h"
class MMgrDigest;
+class MMonMgrReport;
class MPGStats;
void notify_osdmap(const OSDMap &osd_map);
+ void tick(MMonMgrReport *m);
+
bool have_fsmap() const {
Mutex::Locker l(lock);
return fsmap.get_epoch() > 0;
class MMgrReport;
class MMgrOpen;
+class MMonMgrReport;
class MCommand;
struct MgrCommand;
bool handle_open(MMgrOpen *m);
bool handle_report(MMgrReport *m);
bool handle_command(MCommand *m);
+ void tick(MMonMgrReport *m) {}
};
#endif
#include "DaemonServer.h"
#include "messages/MMgrBeacon.h"
#include "messages/MMgrDigest.h"
+#include "messages/MMonMgrReport.h"
#include "messages/MCommand.h"
#include "messages/MCommandReply.h"
#include "messages/MLog.h"
m->put();
}
+void Mgr::tick()
+{
+ dout(0) << __func__ << dendl;
+ MMonMgrReport *m = new MMonMgrReport();
+ cluster_state.tick(m);
+ server.tick(m);
+ // TODO? We currently do not notify the PyModules
+ if (m->needs_send) {
+ monc->send_mon_message(m);
+ }
+}
bool ms_dispatch(Message *m);
+ void tick();
+
void background_init();
void shutdown();
};
void MgrStandby::tick()
{
+ dout(0) << __func__ << dendl;
send_beacon();
+ if (active_mgr) {
+ active_mgr->tick();
+ }
+
timer.add_event_after(g_conf->mgr_tick_period, new FunctionContext(
[this](int r){
tick();